Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,9 @@ option(SYCL_ENABLE_MAJOR_RELEASE_PREVIEW_LIB "Enable build of the SYCL major rel
# Needed for feature_test.hpp
if ("cuda" IN_LIST SYCL_ENABLE_PLUGINS)
set(SYCL_BUILD_BACKEND_CUDA ON)
set(SYCL_EXT_ONEAPI_BACKEND_CUDA ON)
endif()
if ("hip" IN_LIST SYCL_ENABLE_PLUGINS)
set(SYCL_BUILD_BACKEND_HIP ON)
set(SYCL_EXT_ONEAPI_BACKEND_HIP ON)
endif()
if ("opencl" IN_LIST SYCL_ENABLE_PLUGINS)
set(SYCL_BUILD_BACKEND_OPENCL ON)
Expand All @@ -185,6 +183,11 @@ if ("native_cpu" IN_LIST SYCL_ENABLE_PLUGINS)
set(SYCL_BUILD_BACKEND_NATIVE_CPU ON)
endif()

# Set backend macros based on whether we can compile kernels for the target
# rather than if we're building the runtime adapter.
set(SYCL_EXT_ONEAPI_BACKEND_CUDA ${LLVM_HAS_NVPTX_TARGET})
set(SYCL_EXT_ONEAPI_BACKEND_HIP ${LLVM_HAS_AMDGPU_TARGET})

# Configure SYCL version macro
set(sycl_inc_dir ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(sycl_src_dir ${CMAKE_CURRENT_SOURCE_DIR}/source)
Expand Down