Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiling with SYCL and IntelLLVM #66

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions examples/01-axpy-ndarray/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ target_link_libraries(example-axpy-ndarray ${PROJECT_LIBS} flcl::flcl)
if (CMAKE_Fortran_COMPILER_ID STREQUAL "XL")
target_link_options(example-axpy-ndarray PRIVATE LINKER:-lxlf90_r)
endif()
if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
set_target_properties(example-axpy-ndarray PROPERTIES LINKER_LANGUAGE Fortran)
if (CMAKE_Fortran_COMPILER_ID MATCHES "Intel" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
set_target_properties(example-axpy-ndarray PROPERTIES LINKER_LANGUAGE Fortran)
endif()
if (CMAKE_Fortran_COMPILER_ID STREQUAL "IntelLLVM")
target_link_options(example-axpy-ndarray PRIVATE -fsycl)
endif()
set(RPATHS "$ENV{LD_LIBRARY_PATH}")
set_target_properties(example-axpy-ndarray PROPERTIES
Expand Down
7 changes: 5 additions & 2 deletions examples/02-axpy-dualview/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ target_link_libraries(example-axpy-dualview ${PROJECT_LIBS} flcl::flcl)
if (CMAKE_Fortran_COMPILER_ID STREQUAL "XL")
target_link_options(example-axpy-dualview PRIVATE LINKER:-lxlf90_r)
endif()
if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
set_target_properties(example-axpy-dualview PROPERTIES LINKER_LANGUAGE Fortran)
if (CMAKE_Fortran_COMPILER_ID MATCHES "Intel" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
set_target_properties(example-axpy-dualview PROPERTIES LINKER_LANGUAGE Fortran)
endif()
if (CMAKE_Fortran_COMPILER_ID STREQUAL "IntelLLVM")
target_link_options(example-axpy-dualview PRIVATE -fsycl)
endif()
set(RPATHS "$ENV{LD_LIBRARY_PATH}")
set_target_properties(example-axpy-dualview PROPERTIES
Expand Down
7 changes: 5 additions & 2 deletions examples/03-axpy-view/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ target_link_libraries(example-axpy-view ${PROJECT_LIBS} flcl::flcl)
if (CMAKE_Fortran_COMPILER_ID STREQUAL "XL")
target_link_options(example-axpy-view PRIVATE LINKER:-lxlf90_r)
endif()
if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
set_target_properties(example-axpy-view PROPERTIES LINKER_LANGUAGE Fortran)
if (CMAKE_Fortran_COMPILER_ID MATCHES "Intel" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
set_target_properties(example-axpy-view PROPERTIES LINKER_LANGUAGE Fortran)
endif()
if (CMAKE_Fortran_COMPILER_ID STREQUAL "IntelLLVM")
target_link_options(example-axpy-view PRIVATE -fsycl)
endif()
set(RPATHS "$ENV{LD_LIBRARY_PATH}")
set_target_properties(example-axpy-view PROPERTIES
Expand Down
7 changes: 5 additions & 2 deletions examples/04-complex-ndarray/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ target_link_libraries(example-complex-ndarray ${PROJECT_LIBS} flcl::flcl)
if (CMAKE_Fortran_COMPILER_ID STREQUAL "XL")
target_link_options(example-complex-ndarray PRIVATE LINKER:-lxlf90_r)
endif()
if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
set_target_properties(example-complex-ndarray PROPERTIES LINKER_LANGUAGE Fortran)
if (CMAKE_Fortran_COMPILER_ID MATCHES "Intel" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
set_target_properties(example-complex-ndarray PROPERTIES LINKER_LANGUAGE Fortran)
endif()
if (CMAKE_Fortran_COMPILER_ID STREQUAL "IntelLLVM")
target_link_options(example-complex-ndarray PRIVATE -fsycl)
endif()
set(RPATHS "$ENV{LD_LIBRARY_PATH}")
set_target_properties(example-complex-ndarray PROPERTIES
Expand Down
4 changes: 4 additions & 0 deletions src/flcl-cxx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ namespace flcl {
using HostMemorySpace = Kokkos::CudaUVMSpace;
#elif defined(KOKKOS_ENABLE_HIP)
using HostMemorySpace = Kokkos::HIPManagedSpace;
#elif defined(KOKKOS_ENABLE_SYCL)
using HostMemorySpace = Kokkos::Experimental::SYCLSharedUSMSpace;
#else
using HostMemorySpace = Kokkos::HostSpace;
#endif
Expand All @@ -79,6 +81,8 @@ namespace flcl {
using HostMemorySpace = Kokkos::CudaUVMSpace;
#elif defined(KOKKOS_ENABLE_HIP)
using HostMemorySpace = Kokkos::HIPManagedSpace;
#elif defined(KOKKOS_ENABLE_SYCL)
using HostMemorySpace = Kokkos::Experimental::SYCLSharedUSMSpace;
#else
using HostMemorySpace = Kokkos::HostSpace;
#endif
Expand Down
5 changes: 4 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ foreach(file ${files})
if (CMAKE_Fortran_COMPILER_ID STREQUAL "XL")
target_link_options(${file_without_ext} PRIVATE LINKER:-lxlf90_r)
endif()
if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
if (CMAKE_Fortran_COMPILER_ID MATCHES "Intel" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
set_target_properties(${file_without_ext} PROPERTIES LINKER_LANGUAGE Fortran)
endif()
if (CMAKE_Fortran_COMPILER_ID STREQUAL "IntelLLVM")
target_link_options(${file_without_ext} PRIVATE -fsycl)
endif()
set(RPATHS "$ENV{LD_LIBRARY_PATH}")
set_target_properties(${file_without_ext} PROPERTIES
BUILD_WITH_INSTALL_RPATH True
Expand Down