Skip to content

Commit

Permalink
Desul atomics: Trade SYCL-specific compile definition for a macro def…
Browse files Browse the repository at this point in the history
…intion in the configuration header
  • Loading branch information
dalg24 committed Nov 8, 2023
1 parent 26464df commit c8b4fe8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmake/kokkos_arch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -595,9 +595,8 @@ IF(KOKKOS_ENABLE_SYCL)
INCLUDE(CheckCXXSymbolExists)
CHECK_CXX_SYMBOL_EXISTS(SYCL_EXT_ONEAPI_DEVICE_GLOBAL "sycl/sycl.hpp" KOKKOS_IMPL_HAVE_SYCL_EXT_ONEAPI_DEVICE_GLOBAL)
IF (KOKKOS_IMPL_HAVE_SYCL_EXT_ONEAPI_DEVICE_GLOBAL)
SET(KOKKOS_IMPL_SYCL_DEVICE_GLOBAL_SUPPORTED ON)
# Use the non-separable compilation implementation to support shared libraries as well.
COMPILER_SPECIFIC_FLAGS(DEFAULT -DDESUL_SYCL_DEVICE_GLOBAL_SUPPORTED)
SET(KOKKOS_IMPL_SYCL_DEVICE_GLOBAL_SUPPORTED ON)
ELSEIF(NOT BUILD_SHARED_LIBS)
INCLUDE(CheckCXXSourceCompiles)
CHECK_CXX_SOURCE_COMPILES("
Expand All @@ -620,7 +619,7 @@ IF(KOKKOS_ENABLE_SYCL)
IF(KOKKOS_IMPL_SYCL_DEVICE_GLOBAL_SUPPORTED)
# Only the separable compilation implementation is supported.
COMPILER_SPECIFIC_FLAGS(
DEFAULT -fsycl-device-code-split=off -DDESUL_SYCL_DEVICE_GLOBAL_SUPPORTED
DEFAULT -fsycl-device-code-split=off
)
ENDIF()
ENDIF()
Expand Down
4 changes: 4 additions & 0 deletions core/src/Kokkos_Atomics_Desul_Config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ static_assert(false,
#define DESUL_CUDA_ARCH_IS_PRE_VOLTA
#endif

#if defined(KOKKOS_IMPL_SYCL_DEVICE_GLOBAL_SUPPORTED)
#define DESUL_SYCL_DEVICE_GLOBAL_SUPPORTED
#endif

#endif // KOKKOS_ATOMICS_DESUL_CONFIG_HPP

0 comments on commit c8b4fe8

Please sign in to comment.