Skip to content

Commit

Permalink
Use KOKKOS_ARCH_NVIDIA_GPU macro in SYCL, OpenACC, and OpenMPTarget b…
Browse files Browse the repository at this point in the history
…ackends where appropriate
  • Loading branch information
dalg24 committed Mar 3, 2023
1 parent 5d3bcb1 commit 4dcb294
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 19 deletions.
3 changes: 1 addition & 2 deletions core/src/OpenACC/Kokkos_OpenACC_Traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
namespace Kokkos::Experimental::Impl {

struct OpenACC_Traits {
#if defined(KOKKOS_ARCH_PASCAL) || defined(KOKKOS_ARCH_VOLTA) || \
defined(KOKKOS_ARCH_AMPERE) || defined(KOKKOS_ARCH_HOPPER)
#if defined(KOKKOS_ARCH_NVIDIA_GPU)
static constexpr acc_device_t dev_type = acc_device_nvidia;
static constexpr bool may_fallback_to_host = false;
#else
Expand Down
7 changes: 2 additions & 5 deletions core/src/OpenMPTarget/Kokkos_OpenMPTarget_Instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,10 @@ void OpenMPTargetInternal::impl_initialize() {

// FIXME_OPENMPTARGET: Only fix the number of teams for NVIDIA architectures
// from Pascal and upwards.
#if defined(KOKKOS_ARCH_PASCAL) || defined(KOKKOS_ARCH_VOLTA) || \
defined(KOKKOS_ARCH_TURING75) || defined(KOKKOS_ARCH_AMPERE) || \
defined(KOKKOS_ARCH_HOPPER)
#if defined(KOKKOS_COMPILER_CLANG) && (KOKKOS_COMPILER_CLANG >= 1300)
#if defined(KOKKOS_ARCH_NVIDIA_GPU) && defined(KOKKOS_COMPILER_CLANG) && \
(KOKKOS_COMPILER_CLANG >= 1300)
omp_set_num_teams(512);
#endif
#endif
}
int OpenMPTargetInternal::impl_is_initialized() {
return m_is_initialized ? 1 : 0;
Expand Down
5 changes: 1 addition & 4 deletions core/src/SYCL/Kokkos_SYCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,7 @@ void SYCL::impl_initialize(InitializationSettings const& settings) {
// If the device id is not specified and there are no GPUs, sidestep Kokkos
// device selection and use whatever is available (if no GPU architecture is
// specified).
#if !defined(KOKKOS_ARCH_INTEL_GPU) && !defined(KOKKOS_ARCH_KEPLER) && \
!defined(KOKKOS_ARCH_MAXWELL) && !defined(KOKKOS_ARCH_PASCAL) && \
!defined(KOKKOS_ARCH_VOLTA) && !defined(KOKKOS_ARCH_TURING75) && \
!defined(KOKKOS_ARCH_AMPERE) && !defined(KOKKOS_ARCH_HOPPER)
#if !defined(KOKKOS_ARCH_INTEL_GPU) && !defined(KOKKOS_ARCH_NVIDIA_GPU)
if (!settings.has_device_id() && gpu_devices.empty()) {
Impl::SYCLInternal::singleton().initialize(sycl::device());
Impl::SYCLInternal::m_syclDev = 0;
Expand Down
10 changes: 2 additions & 8 deletions core/src/SYCL/Kokkos_SYCL_Parallel_Team.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,7 @@ class TeamPolicyInternal<Kokkos::Experimental::SYCL, Properties...>
return std::min({
int(m_space.impl_internal_space_instance()->m_maxWorkgroupSize),
// FIXME_SYCL Avoid requesting to many registers on NVIDIA GPUs.
#if defined(KOKKOS_ARCH_KEPLER) || defined(KOKKOS_ARCH_MAXWELL) || \
defined(KOKKOS_ARCH_PASCAL) || defined(KOKKOS_ARCH_VOLTA) || \
defined(KOKKOS_ARCH_TURING75) || defined(KOKKOS_ARCH_AMPERE) || \
defined(KOKKOS_ARCH_HOPPER)
#if defined(KOKKOS_ARCH_NVIDIA_GPU)
256,
#endif
max_threads_for_memory
Expand Down Expand Up @@ -337,10 +334,7 @@ class TeamPolicyInternal<Kokkos::Experimental::SYCL, Properties...>
return std::min<int>({
int(m_space.impl_internal_space_instance()->m_maxWorkgroupSize),
// FIXME_SYCL Avoid requesting to many registers on NVIDIA GPUs.
#if defined(KOKKOS_ARCH_KEPLER) || defined(KOKKOS_ARCH_MAXWELL) || \
defined(KOKKOS_ARCH_PASCAL) || defined(KOKKOS_ARCH_VOLTA) || \
defined(KOKKOS_ARCH_TURING75) || defined(KOKKOS_ARCH_AMPERE) || \
defined(KOKKOS_ARCH_HOPPER)
#if defined(KOKKOS_ARCH_NVIDIA_GPU)
256,
#endif
max_threads_for_memory
Expand Down

0 comments on commit 4dcb294

Please sign in to comment.