File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
test/conformance/device_code Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ option(UR_BUILD_EXAMPLE_CODEGEN "Build the codegen example." OFF)
4848option (VAL_USE_LIBBACKTRACE_BACKTRACE "enable libbacktrace validation backtrace for linux" OFF )
4949option (UR_ENABLE_ASSERTIONS "Enable assertions for all build types" OFF )
5050set (UR_DPCXX "" CACHE FILEPATH "Path of the DPC++ compiler executable" )
51+ set (UR_DPCXX_BUILD_FLAGS "" CACHE STRING "Build flags to pass to DPC++ when compiling device programs" )
5152set (UR_SYCL_LIBRARY_DIR "" CACHE PATH
5253 "Path of the SYCL runtime library directory" )
5354set (UR_CONFORMANCE_TARGET_TRIPLES "" CACHE STRING
Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ List of options provided by CMake:
140140| UR_HIP_PLATFORM | Build HIP adapter for AMD or NVIDIA platform | AMD/NVIDIA | AMD |
141141| UR_ENABLE_COMGR | Enable comgr lib usage | AMD/NVIDIA | AMD |
142142| UR_DPCXX | Path of the DPC++ compiler executable to build CTS device binaries | File path | ` "" ` |
143+ | UR_DPCXX_BUILD_FLAGS | Build flags to pass to DPC++ when compiling device programs | Space-separated options list | ` "" ` |
143144| UR_SYCL_LIBRARY_DIR | Path of the SYCL runtime library directory to build CTS device binaries | Directory path | ` "" ` |
144145| UR_HIP_ROCM_DIR | Path of the default ROCm HIP installation | Directory path | ` /opt/rocm ` |
145146| UR_HIP_INCLUDE_DIR | Path of the ROCm HIP include directory | Directory path | ` ${UR_HIP_ROCM_DIR}/include ` |
Original file line number Diff line number Diff line change @@ -52,6 +52,11 @@ macro(add_device_binary SOURCE_FILE)
5252 set (EXTRA_ENV DYLD_FALLBACK_LIBRARY_PATH=${UR_SYCL_LIBRARY_DIR} )
5353 endif ()
5454 endif ()
55+
56+ # Convert build flags to a regular CMake list, splitting by unquoted white
57+ # space as necessary.
58+ separate_arguments (DPCXX_BUILD_FLAGS_LIST NATIVE_COMMAND "${UR_DPCXX_BUILD_FLAGS} " )
59+
5560 foreach (TRIPLE ${TARGET_TRIPLES} )
5661 set (EXE_PATH "${DEVICE_BINARY_DIR} /${KERNEL_NAME} _${TRIPLE} " )
5762 if (${TRIPLE} MATCHES "amd" )
@@ -79,7 +84,7 @@ macro(add_device_binary SOURCE_FILE)
7984 add_custom_command (OUTPUT ${EXE_PATH}
8085 COMMAND ${UR_DPCXX} -fsycl -fsycl-targets=${TRIPLE} -fsycl-device-code-split=off
8186 ${AMD_TARGET_BACKEND} ${AMD_OFFLOAD_ARCH} ${AMD_NOGPULIB}
82- ${SOURCE_FILE} -o ${EXE_PATH}
87+ ${DPCXX_BUILD_FLAGS_LIST} ${ SOURCE_FILE} -o ${EXE_PATH}
8388
8489 COMMAND ${CMAKE_COMMAND} -E env ${EXTRA_ENV} SYCL_DUMP_IMAGES=true
8590 ${EXE_PATH} || exit 0
You can’t perform that action at this time.
0 commit comments