Skip to content

Commit

Permalink
[SYCL] cmake changes for Intel OneMKL discvoery
Browse files Browse the repository at this point in the history
  • Loading branch information
abagusetty committed Oct 3, 2024
1 parent ea0ef8f commit 7de2978
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
17 changes: 11 additions & 6 deletions Nwpw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ if (NWPW_SYCL)
set(CMAKE_CXX_STANDARD 17)

add_definitions(-DNWPW_SYCL=1)
SET(SYCL_CXX_COMPILE_FLAGS "-fsycl -fsycl-device-code-split=per_kernel -sycl-std=2020 -Wsycl-strict -fsycl-targets=spir64_gen -Xsycl-target-backend \'-device 12.60.7'")
SET(SYCL_CXX_COMPILE_FLAGS "-fsycl -fsycl-device-code-split=per_kernel -fsycl-targets=intel_gpu_pvc -sycl-std=2020")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SYCL_CXX_COMPILE_FLAGS}")

include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindMKL.cmake)
#include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindMKL.cmake)

if( NWPW_SYCL_ENABLE_PROFILE )
add_definitions(-DNWPW_SYCL_ENABLE_PROFILE=1)
Expand Down Expand Up @@ -130,10 +130,12 @@ if(${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel" OR ${CMAKE_Fortran_COMPILER_ID}
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS} -O3 -xhost" CACHE STRING "" FORCE)

#list(APPEND CMAKE_MODULE_PATH "$ENV{MKLROOT}/lib/cmake/mkl")
set(MKL_DIR "$ENV{MKLROOT}/lib/cmake/mkl")
find_package(MKL REQUIRED)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindMKL.cmake)
#set(MKL_DIR "$ENV{MKLROOT}/lib/cmake/mkl")
find_package(MKL REQUIRED $ENV{MKLROOT}/lib/cmake/mkl)
#include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindMKL.cmake)
include_directories(${MKL_INCLUDE_DIRS})
add_definitions(-DNWPW_INTEL_MKL)
message("MKL_include: " ${MKL_INCLUDE_DIRS})
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU")
message("-- Using ${CMAKE_Fortran_COMPILER_ID} Fortran Compiler ")
# adding "-m64 -fdefault-integer-8" below won't work
Expand Down Expand Up @@ -220,8 +222,11 @@ elseif(NWPW_CUDA)
target_include_directories(pwdft PUBLIC ${CUDAToolkit_INCLUDE_DIRS})
target_link_libraries(pwdft band pspw file nwpwlib ${MPI_LIBRARIES} CUDA::cudart CUDA::cublas CUDA::cusolver CUDA::cufft)
elseif(NWPW_HIP)
target_include_directories(pwdft PUBLIC ${ROCBLAS_INCLUDE_DIRS} ${ROCFFT_INCLUDE_DIRS} ${ROCSOLVER_INCLUDE_DIRS})
target_include_directories(pwdft PUBLIC ${ROCBLAS_INCLUDE_DIRS} ${ROCFFT_INCLUDE_DIRS} ${ROCSOLVER_INCLUDE_DIRS})
target_link_libraries(pwdft band pspw file nwpwlib ${MPI_LIBRARIES} hip::device)
elseif(NWPW_SYCL)
target_include_directories(pwdft PUBLIC ${MKL_INCLUDE_DIRS})
target_link_libraries(pwdft band pspw file nwpwlib ${MPI_LIBRARIES} MKL::MKL_SYCL)
else()
target_link_libraries(pwdft band pspw file nwpwlib ${MPI_LIBRARIES})
endif()
Expand Down
3 changes: 2 additions & 1 deletion Nwpw/nwpwlib/device/gdevices_sycl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

#include "fft.h"
#include "blas.h"
#include <oneapi/mkl.hpp>
#include <oneapi/mkl/blas.hpp>
#include <oneapi/mkl/dfti.hpp>

typedef oneapi::mkl::dft::descriptor<oneapi::mkl::dft::precision::DOUBLE,
oneapi::mkl::dft::domain::REAL>
Expand Down

0 comments on commit 7de2978

Please sign in to comment.