diff --git a/Nwpw/CMakeLists.txt b/Nwpw/CMakeLists.txt index 6bf9bcda..00b55638 100644 --- a/Nwpw/CMakeLists.txt +++ b/Nwpw/CMakeLists.txt @@ -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) @@ -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 @@ -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() diff --git a/Nwpw/nwpwlib/device/gdevices_sycl.hpp b/Nwpw/nwpwlib/device/gdevices_sycl.hpp index a1a2a1b1..97df557c 100644 --- a/Nwpw/nwpwlib/device/gdevices_sycl.hpp +++ b/Nwpw/nwpwlib/device/gdevices_sycl.hpp @@ -19,7 +19,8 @@ #include "fft.h" #include "blas.h" -#include +#include +#include typedef oneapi::mkl::dft::descriptor