Skip to content

Latest commit

 

History

History
152 lines (93 loc) · 4.73 KB

readme.rst

File metadata and controls

152 lines (93 loc) · 4.73 KB

Intel(R) C for Metal Compiler

The Intel(R) C for Metal compiler is a open source compiler that implements C for Metal programming language. C for Metal is a new GPU kernel programming language for Intel HD Graphics.

This document is a starting guide for setting up the development environment, building and using this compiler.

The Intel(R) C for Metal Compiler is distributed under the MIT license. You may obtain a copy of the License at: https//opensource.org/licenses/MIT

Currently We test our opensource compiler on Centos-7.3 and Ubuntu-16.04.

In order to download and build the compiler, we need the following:

  • CMake
  • gcc
  • git
  • make
  • Python

There is no other dependences in order to build the compiler.

However, in order to build and run those sample applications we provide, the easiest way to get start is to download the development package, which we have uploaded under the release tab of this github project.

Please refer to the readme included in the package for its usage.

Several initial releases of the development packages are still saved on 01.org.

The source code for all the components in the development package are published on github.com/intel. We are planning to publish these scripts soon (work in progress).

The compiler can be built using the provided script.

To build the compiler in the default way, but in debug mode (so you get asserts and you can debug the compiler):

support/scripts/build.bash -d

The compiler has now been built to a single cmc executable in a build directory whose name depends on the options to build.bash. For example, build.64.linux/bin/cmc.

To see the other options available with build.bash, use

support/scripts/build.bash -h
build.64.linux/bin/cmc -isystem support/include test/open_examples/linear_walker/linear_walker_genx.cpp -march=SKL

That will generate a vISA file linear_walker_genx.isa in the current directory.

See document cmcuserguide for more command line options.

The formatted documentation starts at

support/docs/_build/html/index.html

(This path is relative to your cm-compiler root, i.e. where your llvm, support and test directories are.)

Having installed the C for Metal runtime + driver (from the developement package). You may use the compiler binary (cmc) you build from source to replace the cmc binary coming with the developement package (under compiler/bin).

You can build and run examples under test/open_examples.

Refer to the readme under test/open_examples.

Our build script is written in Bash. Therefore the recommended environment is Windows+Cygwin.

However, besides Cygwin, You also need Windows-native installation of the following:

  • Visual Studio (2012 or later)
  • CMake (the Windows version)
  • Python (the Windows version, installed in c:\python27)

Go to http://www.cygwin.com/ and install cygwin (64 bit is recommended).

You will probably need to install the following extra Cygwin packages during setup. The web site has documentation on how to do this if you are not familiar with it or can't work it out from the UI.

Basic prerequisites:

  • git
  • python
  • unzip
  • curl
support/scripts/build.bash -s vs2015 -d -m --32

Intel Atom and Core processors supporting Gen9/Gen10 graphics device

We welcome contributions to the compiler and the examples, including bug fixes, optimizations, and new features.

You may create a new pull request on github for your code changes. We will review it, test it, and give you our feedback. When the change is finalized, we will push it to the project repository.

For any new example using C for Metal, as long as you have the entire application that can be built and run on either Linux or Windows, you can email it to the maintainer of this project. We can help you customize it, and publish it in our open-example folder.

(*) Other names and brands maybe claimed as property of others.