Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Commit

Permalink
Modernise FindComputeCpp.cmake (#118)
Browse files Browse the repository at this point in the history
This is a very large update to FindComputeCpp.cmake that brings with
it (regrettably) some API changes. See the samples for details, but
the short story is that the add_sycl_to_target function now takes
named parameters, which has helped a lot. Additionally, there have
been bugfixes in the internals of the module, meaning that the include-
after property is more well-behaved.

The other change that is most likely to affect users is the way in which
different bitcode outputs are selected. Previously different options
like "USE_PTX" or similar could be specified, but now an actual value
must be set, and defaults to spir64. This requires a little more work
on the part of the user when a different kind of IR is needed but is
more robust.
  • Loading branch information
DuncanMcBain committed Jun 22, 2018
1 parent 3613606 commit 240f675
Show file tree
Hide file tree
Showing 28 changed files with 309 additions and 287 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ script:
###########################
- mkdir build
- cd build
- cmake ../ -DCOMPUTECPP_PACKAGE_ROOT_DIR=/tmp/computecpp -DCOMPUTECPP_SDK_BUILD_TESTS=1 -DCOMPUTECPP_DISABLE_GCC_DUAL_ABI=1
- cmake ../ -DComputeCpp_DIR=/tmp/computecpp -DCOMPUTECPP_SDK_BUILD_TESTS=1 -DCOMPUTECPP_DISABLE_GCC_DUAL_ABI=1
- make -j2
- COMPUTECPP_TARGET="host" ctest -V -E opencl
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.2.2)
project(ComputeCpp-SDK)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
include(FindComputeCpp)
find_package(ComputeCpp REQUIRED)

option(COMPUTECPP_SDK_USE_OPENMP "Enable OpenMP support in samples" OFF)

Expand Down
23 changes: 14 additions & 9 deletions README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,25 @@ CMake files are provided as a build system for this software. CMake version
3.2.2 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_PACKAGE_ROOT_DIR. This variable should be 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_TESTS
to add the tests/ subdirectory to the build, which will causes Gtest-based
programs testing the legacy pointer and virtual pointer classes to be
emitted. Some samples have optional OpenMP support. You can enable it by
setting COMPUTECPP_SDK_USE_OPENMP to ON in CMake.
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_TESTS to 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_OPENMP to ON in CMake.

You can additionally specify CMAKE_BUILD_TYPE and CMAKE_INSTALL_PREFIX to
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 `spir64` IR 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 `spir[64]`,
`spirv[64]` or `ptx64`.

On the Codeplay website there is a
link:https://developer.codeplay.com/computecppce/latest/getting-started-guide[
getting started guide] that serves as an introduction to SYCL and ComputeCpp.
Expand All @@ -77,7 +82,7 @@ Integration guide] should you wish to add ComputeCpp to existing projects.
Requirements
------------
* The samples should work with any SYCL 1.2 implementation, though have
* The samples should work with any SYCL 1.2.1 implementation, though have
only been tested with the ComputeCpp CE Public Beta
* OpenCL 1.2-capable hardware and drivers with SPIR 1.2/SPIR-V support
Expand Down
Loading

0 comments on commit 240f675

Please sign in to comment.