Giter Site home page Giter Site logo

syclomatic's Introduction

SYCLomatic

Introduction

SYCLomatic is a project to assist developers in migrating their existing code written in different programming languages to the SYCL* C++ heterogeneous programming model. Final code editing and verification is a manual process done by the developer.

Use c2s command to make it as easy as possible to migrate existing CUDA codebases to SYCL, which is an industry standard. Once code is migrated to SYCL, it can be compiled and executed by any compiler that implements the SYCL specification as shown here: https://www.khronos.org/sycl/

The SYCLomatic development branch is the SYCLomatic branch.

Releases

Daily builds of the SYCLomatic branch on Linux and Windows* are available at releases. A few times a year, we publish Release Notes to highlight all important changes made in the project: features implemented and issues addressed. The corresponding builds can be found using search in daily releases. None of the branches in the project are stable or rigorously tested for production quality control, so the quality of these releases is expected to be similar to the daily releases.

Build from source code

Prerequisites

Create SYCLomatic workspace

Throughout this document SYCLOMATIC_HOME denotes the path to the local directory created as SYCLomatic workspace. It might be useful to create an environment variable with the same name.

Linux:

export SYCLOMATIC_HOME=~/workspace
export PATH_TO_C2S_INSTALL_FOLDER=~/workspace/c2s_install
mkdir $SYCLOMATIC_HOME
cd $SYCLOMATIC_HOME

git clone https://github.com/oneapi-src/SYCLomatic.git

Windows (64-bit):

Open a developer command prompt using one of two methods:

  • Click start menu and search for "x64 Native Tools Command Prompt for VS XXXX", where XXXX is a version of installed Visual Studio.
  • Ctrl-R, write "cmd", click enter, then run "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
set SYCLOMATIC_HOME=%USERPROFILE%\workspace
set PATH_TO_C2S_INSTALL_FOLDER=%USERPROFILE%\workspace\c2s_install
mkdir %SYCLOMATIC_HOME%
cd %SYCLOMATIC_HOME%

git clone https://github.com/oneapi-src/SYCLomatic.git

Build SYCLomatic

Linux:

cd $SYCLOMATIC_HOME
mkdir build
cd build
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=$PATH_TO_C2S_INSTALL_FOLDER  -DCMAKE_BUILD_TYPE=Release  -DLLVM_ENABLE_PROJECTS="clang"  -DLLVM_TARGETS_TO_BUILD="X86;NVPTX" ../SYCLomatic/llvm
ninja install-c2s

Windows (64-bit):

cd %SYCLOMATIC_HOME%
mkdir build
cd build
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=%PATH_TO_C2S_INSTALL_FOLDER%  -DCMAKE_BUILD_TYPE=Release  -DLLVM_ENABLE_PROJECTS="clang"  -DLLVM_TARGETS_TO_BUILD="X86;NVPTX" ..\SYCLomatic\llvm
ninja install-c2s

Note: For build system with 16G or less memory, to avoid out of memory issues, it is recommended to add the option -DLLVM_PARALLEL_LINK_JOBS=1 in the CMake step and use 4 or less total parallel jobs when building SYCLomatic by invoking ninja with the option -j4:

ninja -j4 install-c2s

build success message:

After a successful build, you should be able to see following message in the terminal output.

-- Install configuration: "Release"
-- Installing: ... bin/dpct
-- Creating c2s

Environment Setup

Linux:

export PATH=$PATH_TO_C2S_INSTALL_FOLDER/bin:$PATH
export CPATH=$PATH_TO_C2S_INSTALL_FOLDER/include:$CPATH

Windows (64-bit):

SET PATH=%PATH_TO_C2S_INSTALL_FOLDER%\bin;%PATH%
SET INCLUDE=%PATH_TO_C2S_INSTALL_FOLDER%\include;%INCLUDE%
SET CPATH=%PATH_TO_C2S_INSTALL_FOLDER%\include;%CPATH%

Verify the Installation

Before running SYCLomatic, it is important to verify that dpct/c2s(SYCLomatic binary) is installed correctly and PATH is set properly.

To do this, try running the following command and checking if dpct is available after the installation.

c2s --version

Note: If c2s cannot be found, please check the setup of PATH.

Run SYCLomatic

Run c2s command

Get c2s help information by running "c2s --help". dpct is an alias command for c2s.

Test SYCLomatic

Run in-tree LIT tests

Note: Certain CUDA header files may need to be accessible to the tool. After build the SYCLomatic, you can run the list test by:

ninja check-clang-c2s

Run E2E test suite (Recommend for contributors)

Follow instructions from the link below to build and run tests: README

Known Issues and Limitations

  • SYCL* 2020 support work is in progress.
  • 32-bit host/target is not supported.

Useful Links

License

See LICENSE for details.

Contributing

See CONTRIBUTING.md for details.

Trademarks information

Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries.
*Other names and brands may be claimed as the property of others. SYCL is a trademark of the Khronos Group Inc.

syclomatic's People

Contributors

lattner avatar topperc avatar rksimon avatar espindola avatar rotateright avatar tkremenek avatar arsenm avatar ddunbar avatar douggregor avatar d0k avatar zygoloid avatar rui314 avatar maskray avatar chandlerc avatar isanbard avatar nico avatar echristo avatar nikic avatar dwblaikie avatar rnk avatar chapuni avatar lebedevri avatar labath avatar fhahn avatar jdevlieghere avatar klausler avatar lhames avatar akyrtzi avatar stoklund avatar eefriedman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.