Skip to content

Commit

Permalink
Merge pull request #5958 from dalg24/fixup_openmptarget_concurrency
Browse files Browse the repository at this point in the history
Fix `OpenMPTarget::concurrency()`
  • Loading branch information
dalg24 authored Mar 7, 2023
2 parents a75aa23 + fb0b94c commit 543e971
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions core/src/OpenMPTarget/Kokkos_OpenMPTarget_Instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ void OpenMPTargetInternal::fence(const std::string& name,
[&]() {});
}
}
#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
int OpenMPTargetInternal::concurrency() {
#else
int OpenMPTargetInternal::concurrency() const {
#endif
return 128000; // FIXME_OPENMPTARGET
}
const char* OpenMPTargetInternal::name() { return "OpenMPTarget"; }
Expand Down Expand Up @@ -131,9 +127,15 @@ uint32_t OpenMPTarget::impl_instance_id() const noexcept {
return m_space_instance->impl_get_instance_id();
}

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
int OpenMPTarget::concurrency() {
return Impl::OpenMPTargetInternal::impl_singleton()->concurrency();
}
#else
int OpenMPTarget::concurrency() const {
return m_space_instance->concurrency();
}
#endif

void OpenMPTarget::fence(const std::string& name) {
Impl::OpenMPTargetInternal::impl_singleton()->fence(name);
Expand Down
2 changes: 1 addition & 1 deletion core/src/OpenMPTarget/Kokkos_OpenMPTarget_Instance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class OpenMPTargetInternal {
openmp_fence_is_static is_static = openmp_fence_is_static::no);

/** \brief Return the maximum amount of concurrency. */
int concurrency();
int concurrency() const;

//! Print configuration information to the given output stream.
void print_configuration(std::ostream& os, bool verbose) const;
Expand Down

0 comments on commit 543e971

Please sign in to comment.