Skip to content

Commit 28c6dee

Browse files
authored
Update CMake for Windows DLL and rocRAND (#200)
* define compile/link line for windows DLL and update cmake for new rocRAND backend * add UNIX check for all rng backend
1 parent 6976378 commit 28c6dee

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ if(WIN32 AND ONEMKL_SYCL_IMPLEMENTATION STREQUAL "dpc++")
145145
set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> -fsycl /nologo <DEFINES> <INCLUDES> /EHsc <FLAGS> /Fo<OBJECT> -c <SOURCE>")
146146
set(CMAKE_CXX_CREATE_STATIC_LIBRARY "lib /nologo <OBJECTS> /out:<TARGET>")
147147
set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> -fsycl /nologo <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
148+
find_library(MKL_SYCL_LIB NAMES mkl_sycl
149+
HINTS $ENV{MKLROOT} ${MKL_ROOT}
150+
PATH_SUFFIXES lib/intel64)
151+
set(CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_CXX_COMPILER> -fsycl /nologo <OBJECTS> ${MKL_SYCL_LIB} /link /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES>")
148152
endif()
149153

150154
# Temporary disable sycl 2020 deprecations warnings for cuBLAS and cuSOLVER

examples/rng/run_time_dispatching/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,16 @@ set(DEVICE_FILTERS "")
2929
if(ENABLE_MKLCPU_BACKEND)
3030
list(APPEND DEVICE_FILTERS "cpu")
3131
endif()
32-
if(ENABLE_MKLGPU_BACKEND)
32+
# RNG only supports mklcpu backend on Windows
33+
if(UNIX AND ENABLE_MKLGPU_BACKEND)
3334
list(APPEND DEVICE_FILTERS "gpu")
3435
endif()
35-
if(ENABLE_CURAND_BACKEND)
36+
if(UNIX AND ENABLE_CURAND_BACKEND)
3637
list(APPEND DEVICE_FILTERS "cuda:gpu")
3738
endif()
39+
if(UNIX AND ENABLE_ROCRAND_BACKEND)
40+
list(APPEND DEVICE_FILTERS "hip:gpu")
41+
endif()
3842

3943
message(STATUS "SYCL_DEVICE_FILTER will be set to the following value(s): [${DEVICE_FILTERS}] for run-time dispatching examples")
4044

0 commit comments

Comments
 (0)