Skip to content

Commit

Permalink
GPU: Add GPUCA_OPENCL_CLANGBIN setting to force OpenCL spirv clang ve…
Browse files Browse the repository at this point in the history
…rsion
  • Loading branch information
davidrohr committed Oct 25, 2023
1 parent 18e892d commit 2bc8ac3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion GPU/GPUTracking/Standalone/cmake/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ set(CONFIG_GL3W 0)
set(CONFIG_O2 1)
set(BUILD_DEBUG 0)
set(GPUCA_NO_FAST_MATH 0)
#set(CUDA_GCCBIN c++-8.3.0)
#set(GPUCA_CUDA_GCCBIN c++-8.3.0)
#set(GPUCA_OPENCL_CLANGBIN clang-15)
#set(HIP_AMDGPUTARGET "gfx906;gfx908;gfx90a")
set(HIP_AMDGPUTARGET "default")
#set(CUDA_COMPUTETARGET 86 89)
Expand Down
14 changes: 10 additions & 4 deletions dependencies/FindO2GPU.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ if(ENABLE_CUDA)
set(CMAKE_CUDA_FLAGS "-allow-unsupported-compiler")
endif()
if(CMAKE_CUDA_COMPILER)
if(CUDA_GCCBIN)
message(STATUS "Using as CUDA GCC version: ${CUDA_GCCBIN}")
set(CMAKE_CUDA_HOST_COMPILER "${CUDA_GCCBIN}")
if(GPUCA_CUDA_GCCBIN)
message(STATUS "Using as CUDA GCC version: ${GPUCA_CUDA_GCCBIN}")
set(CMAKE_CUDA_HOST_COMPILER "${GPUCA_CUDA_GCCBIN}")
endif()
if(CUDA_COMPUTETARGET)
set(CMAKE_CUDA_ARCHITECTURES ${CUDA_COMPUTETARGET} CACHE STRING "" FORCE)
Expand Down Expand Up @@ -170,9 +170,15 @@ if(ENABLE_OPENCL2)
set(ROCM_ROOT "/opt/rocm")
endif()
find_program(ROCM_AGENT_ENUMERATOR rocm_agent_enumerator PATHS "${ROCM_ROOT}/bin")
find_program(LLVM_CLANG clang HINTS "${Clang_DIR}/../../../bin-safe")
set(GPUCA_OPENCL_CLANGBIN clang-15)
if (GPUCA_OPENCL_CLANGBIN)
set(LLVM_CLANG ${GPUCA_OPENCL_CLANGBIN})
else()
find_program(LLVM_CLANG clang HINTS "${Clang_DIR}/../../../bin-safe")
endif()
if(Clang_FOUND
AND LLVM_FOUND
AND NOT LLVM_CLANG STREQUAL "LLVM_CLANG-NOTFOUND"
AND LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL 13.0)
set(OPENCL2_COMPATIBLE_CLANG_FOUND ON)
endif()
Expand Down

0 comments on commit 2bc8ac3

Please sign in to comment.