@@ -78,7 +78,7 @@ option (ASGARD_PROFILE_PERF "enable profiling support for using linux perf" "")
78
78
option (ASGARD_PROFILE_VALGRIND "enable profiling support for using valgrind" "" )
79
79
option (ASGARD_GRAPHVIZ_PATH "optional location of bin/ containing dot executable" "" )
80
80
option (ASGARD_IO_HIGHFIVE "Use the HighFive HDF5 header library for I/O" OFF )
81
- option (ASGARD_USE_HIP "Optional HIP support for asgard" ON )
81
+ option (ASGARD_USE_HIP "Optional HIP support for asgard" OFF )
82
82
option (ASGARD_USE_OPENMP "Optional openMP support for asgard" ON )
83
83
option (ASGARD_USE_MPI "Optional distributed computing support for asgard" OFF )
84
84
option (ASGARD_USE_SLATE "Use optional slate linear algebra library" OFF )
@@ -158,7 +158,8 @@ if(ASGARD_USE_HIP)
158
158
# note: could probably grab this path directly using hipconfig?
159
159
if (NOT DEFINED HIP_CLANG_INCLUDE_PATH )
160
160
if (NOT DEFINED ENV{HIP_CLANG_INCLUDE_PATH} )
161
- set (HIP_CLANG_INCLUDE_PATH "${HIP_CLANG_PATH} /../lib/clang/12.0.0/include" CACHE PATH "Path to HIP clang include directory" )
161
+ # probably need a better way to get the compiler version.. this will cause non-existent paths for non-clang compilers
162
+ set (HIP_CLANG_INCLUDE_PATH "${HIP_CLANG_PATH} /../lib/clang/${CMAKE_CXX_COMPILER_VERSION} /include" CACHE PATH "Path to HIP clang include directory" )
162
163
else ()
163
164
set (HIP_CLANG_INCLUDE_PATH $ENV{HIP_CLANG_INCLUDE_PATH} CACHE PATH "Path to HIP clang include directory" )
164
165
endif ()
@@ -207,6 +208,11 @@ if(ASGARD_USE_HIP)
207
208
if (ASGARD_PLATFORM_HCC )
208
209
# note: causes issues on nvidia, but might be needed on amd platforms?
209
210
list (APPEND CMAKE_PREFIX_PATH "${HIP_PATH} /lib/cmake" "${ROCM_PATH} " )
211
+
212
+ # output a warning if compiling for AMD without using amd-clang
213
+ if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
214
+ message (WARNING "Compiling HIP for AMD without using AMD clang might not work. Use -DCMAKE_CXX_COMPILER=clang++" )
215
+ endif ()
210
216
endif ()
211
217
list (APPEND CMAKE_PREFIX_PATH "${HIPBLAS_PATH} /lib/cmake" )
212
218
@@ -222,8 +228,8 @@ if(ASGARD_USE_HIP)
222
228
set (HIP_CLANG_FLAGS "${HIP_CLANG_FLAGS} ${ASGARD_AMD_FLAGS} " CACHE STRING "" )
223
229
set (HIP_NVCC_FLAGS "${HIP_NVCC_FLAGS} ${ASGARD_NVCC_FLAGS} " CACHE STRING "" )
224
230
225
- set (AMDGPU_TARGETS "gfx${ASGARD_AMD_ARCH} " )
226
- set (GPU_TARGETS "gfx${ASGARD_AMD_ARCH} " )
231
+ set (AMDGPU_TARGETS "gfx${ASGARD_AMD_ARCH} " CACHE STRING "GPU target architectures to compile for" )
232
+ set (GPU_TARGETS "gfx${ASGARD_AMD_ARCH} " CACHE STRING "GPU target architectures to compile for" )
227
233
228
234
find_package (HIP 4.0 REQUIRED )
229
235
find_package (hipblas REQUIRED )
@@ -246,8 +252,6 @@ if(ASGARD_USE_HIP)
246
252
# these compile definitions should be added automatically if using amd's clang, but
247
253
# may not necessarily be added if compiling with gcc or others
248
254
add_compile_definitions (__HIP_PLATFORM_HCC__ __HIP_PLATFORM_AMD__ )
249
- # temporarily disable warnings generated when using clang
250
- add_compile_options ("-Wno-dtor-name" "-Wno-gnu-anonymous-struct" "-Wno-nested-anon-types" )
251
255
endif ()
252
256
253
257
if (hipBLAS_FOUND )
0 commit comments