Collection of samples and utilities for using ComputeCpp, Codeplay's SYCL implementation
This is the README for the ComputeCpp SDK, a collection of sample code, utilities and tools for Codeplay’s ComputeCpp, an implementation of the SYCL programming standard. You can find more information at:
samples/subdirectory and optionally adds tests.
The master branch of computecpp-sdk is regularly tested with the "Supported" hardware listed on the ComputeCpp Supported Platforms page.
On the Codeplay website there is a step-by-step guide to building and running the ComputeCpp SDK samples. There is also a guide to SYCL that serves as an introduction to SYCL development. Additionally, there is an Integration guide should you wish to add ComputeCpp to existing projects.
CMake files are provided as a build system for this software. CMake version 3.4.3 is required at minimum, though later versions of CMake should continue to be compatible.
At minimum, one CMake variable is required to get the sample code building -
ComputeCpp_DIR. This variable should point to the root directory of the ComputeCpp install (i.e. the directory with the the folders bin, include, lib and so on). You can also specify
COMPUTECPP_SDK_BUILD_TESTSto add the tests/ subdirectory to the build, which will build Gtest-based programs testing the legacy pointer and virtual pointer classes. Some samples have optional OpenMP support. You can enable it by setting
COMPUTECPP_SDK_USE_OPENMPto ON in CMake.
You can additionally specify
CMAKE_INSTALL_PREFIXto choose a Debug or Release build and the location you’d like to be used when the "install" target is built. The install target currently will copy all the sample binaries to the directory of your choosing.
Lastly, the SDK will build targeting
spir64IR by default. This will work on most devices, but won’t work on NVIDIA (for example). To that end, you can specify
-DCOMPUTECPP_BITCODE=target, which can be any of
If you would like to crosscompile the SDK targeting some other platform, there are toolchain files available in the cmake/toolchains directory. They require certain variables pointing to the root of the toolchain you are using to be set in the environment. They cannot be specificed in the CMake cache. The toolchains will identify which variables have not been set when used.
The sample code should compile without error on our supported platforms. If you run into trouble, or think you have found a bug, we have a support forum available through the ComputeCpp website.
This repository contains code written by Sean Barrett (
stb_imagecode in the Gaussian blur sample) and Charles Salvia (the stack allocator used in the smart pointer sample). Please see the files for their respective licences.
This SDK is licensed under the Apache 2.0 license. Patches are very welcome! If you have an idea for a new sample, different build system integration or even a fix for something that is broken, please get in contact.