OpenCL CMake

Options

There are a number of CMake options which are specific to the implementation and testing of the OpenCL library, these are outlined below.

CA_CL_LIBRARY_NAME

A string CMake option to override the output name of the OpenCL shared library.

Default value

"CL"

CA_CL_LIBRARY_VERSION

A string CMake option of the form <major>.<minor> to override the version of the OpenCL shared library.

Default value

"${ComputeAorta_VERSION_MAJOR}.${ComputeAorta_VERSION_MINOR}"

A list of additional libraries that the CL target should be linked against.

Default value

""

CA_CL_ENABLE_ICD_LOADER

A boolean CMake option to enable building with the OpenCL ICD Loader.

Default value

OFF

CA_CL_EXTERNAL_ICD_LOADER_SOURCE_DIR

A external path to the OpenCL-ICD-Loader repository, which will be used instead of the OpenCL-ICD-Loader repository in source/cl/external/OpenCL-ICD-Loader. This option is only used if CA_CL_ENABLE_ICD_LOADER is ON.

Default value

""

CA_CL_ENABLE_INTERCEPT_LAYER

A CMake option to enable an in-tree build of the OpenCL Intercept Layer, the default value is OFF. To enable this option set CA_CL_ENABLE_INTERCEPT_LAYER to ON during configuration. When set to ON, CA_CL_ENABLE_ICD_LOADER must also be set to ON, otherwise CMake will emit an error.

When enabled all targets created using add_ca_cl_executable() or add_ca_cl_library() will link against the OpenCL target defined by the OpenCL Intercept Layer instead of linking against the OpenCL ICD Loader. Additionally, to avoid CMake configuration errors where both projects attempt to define the OpenCL target, the OpenCL ICD Loader will be built as an ExternalProject.

CA_CL_EXTERNAL_INTERCEPT_LAYER_SOURCE_DIR

A external path to the OpenCL-Intercept-Layer repository, which will be used instead of the OpenCL-Intercept-Layer repository in source/cl/external/OpenCL-Intercept-Layer. This option is only used if CA_CL_ENABLE_INTERCEPT_LAYER is ON.

Default value

""

CA_CL_ENABLE_VECZ_VP_CHECK

A boolean CMake option to enable vector-predication checks, including the check-ock-UnitCL-prevec-vecz-vp-partial-scalarization target.

Default value

OFF

CA_CL_ENABLE_OFFLINE_KERNEL_TESTS

A boolean CMake option to enable UnitCL offline compiler kernel tests.

Default value

ON

CA_CL_ENABLE_EXTENDED_CHECKS

A boolean CMake option to enable extended UnitCL testing.

Default value

ON

CA_CL_TEST_STATIC_LIB

A boolean CMake option to enable testing with the static CL target. This forces all CL executables to link the static library, meaning lit tests with clc/oclc are included in this.

Default value

OFF

Modules

OpenCL specific CMake utilities are provided by: