File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ set(HIP_LIBRARIES "${ROCM_PATH}/lib" ${HIP_LIBRARIES})
38
38
# CMAKE_CXX_FLAGS
39
39
if ("${CMAKE_CXX_FLAGS} " STREQUAL "" )
40
40
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__ " )
42
42
else ()
43
43
message (STATUS "OVERRIDING compilation flags" )
44
44
endif ()
Original file line number Diff line number Diff line change @@ -67,12 +67,14 @@ elseif(USE_NVIDIA_BACKEND)
67
67
message ("-- Building for SM_80 compatibility (DEFAULT)" )
68
68
string (APPEND CMAKE_CXX_FLAGS " -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend --cuda-gpu-arch=sm_80" )
69
69
endif ()
70
+ string (APPEND CMAKE_CXX_FLAGS " -DUSE_NVIDIA_BACKEND" )
70
71
elseif (USE_AMDHIP_BACKEND )
71
72
message (STATUS "Enabling AMD HIP backend for ${USE_AMDHIP_BACKEND} AMD architecture" )
72
73
if (USE_DEFAULT_FLAGS )
73
74
set (CMAKE_CXX_FLAGS "${AMD_GPU_CXX_FLAGS} " ) # Default flags for AMD backend (gfx908 for MI100)
74
75
endif ()
75
76
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" )
76
78
endif ()
77
79
78
80
set (SOURCES
You can’t perform that action at this time.
0 commit comments