Skip to content

Commit 82c5561

Browse files
committed
update hip and sycl cmake
1 parent 483f2ef commit 82c5561

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

bitcracker/HIP/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ set(HIP_LIBRARIES "${ROCM_PATH}/lib" ${HIP_LIBRARIES})
3838
# CMAKE_CXX_FLAGS
3939
if("${CMAKE_CXX_FLAGS}" STREQUAL "")
4040
message(STATUS "Using DEFAULT compilation flags for the application")
41-
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} " -O3 -std=c++17 -ffast-math ")
41+
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} " -O3 -std=c++17 -ffast-math -D__HIP_PLATFORM_AMD__ ")
4242
else()
4343
message(STATUS "OVERRIDING compilation flags")
4444
endif()

bitcracker/SYCL/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,14 @@ elseif(USE_NVIDIA_BACKEND)
6767
message("-- Building for SM_80 compatibility (DEFAULT)")
6868
string(APPEND CMAKE_CXX_FLAGS " -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend --cuda-gpu-arch=sm_80")
6969
endif()
70+
string(APPEND CMAKE_CXX_FLAGS " -DUSE_NVIDIA_BACKEND")
7071
elseif(USE_AMDHIP_BACKEND)
7172
message(STATUS "Enabling AMD HIP backend for ${USE_AMDHIP_BACKEND} AMD architecture")
7273
if(USE_DEFAULT_FLAGS)
7374
set(CMAKE_CXX_FLAGS "${AMD_GPU_CXX_FLAGS}") # Default flags for AMD backend (gfx908 for MI100)
7475
endif()
7576
string(APPEND CMAKE_CXX_FLAGS " -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=${USE_AMDHIP_BACKEND} ")
77+
string(APPEND CMAKE_CXX_FLAGS " -DUSE_AMDHIP_BACKEND")
7678
endif()
7779

7880
set(SOURCES

0 commit comments

Comments
 (0)