Skip to content

HeFan2017/cm-compiler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Intel(R) C-for-Media Compiler

The Intel(R) C-for-Media compiler is a open source compiler that implements C-for-Media (CM) programming language. CM 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-Media 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 of getting-start is to download the following package:

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

The source code for all the components in this development package are published on github.com/intel. However, putting them together still takes some effort (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 CM 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 CM, 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 61.3%
  • LLVM 19.5%
  • C 5.7%
  • Assembly 5.1%
  • Objective-C 3.2%
  • Yacc 1.5%
  • Other 3.7%