Skip to content

Commit

Permalink
Merge pull request #12294 from masterleinad/fix_sycl
Browse files Browse the repository at this point in the history
Tpetra: Fix compiling with SYCL
  • Loading branch information
lucbv committed Sep 21, 2023
2 parents 8762648 + dc57202 commit 8b7ec4d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
12 changes: 6 additions & 6 deletions packages/tpetra/core/src/Tpetra_Details_Random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void finalize_hip_pool() {
#endif // KOKKOS_ENABLE_HIP

#ifdef KOKKOS_ENABLE_SYCL
Kokkos::Random_XorShift64_Pool<typename Kokkos::SYCLDeviceUSMSpace::execution_space> * sycl_pool_=nullptr;
Kokkos::Random_XorShift64_Pool<typename Kokkos::Experimental::SYCLDeviceUSMSpace::execution_space> * sycl_pool_=nullptr;

void finalize_sycl_pool() {
if(sycl_pool_ != nullptr) {
Expand Down Expand Up @@ -183,9 +183,9 @@ getPool() {
/********************************************************************************/
#ifdef KOKKOS_ENABLE_SYCL
void
Static_Random_XorShift64_Pool<typename Kokkos::SYCLDeviceUSMSpace::execution_space>::
Static_Random_XorShift64_Pool<typename Kokkos::Experimental::SYCLDeviceUSMSpace::execution_space>::
resetPool(int mpi_rank) {
using pool_type = Kokkos::Random_XorShift64_Pool<typename Kokkos::SYCLDeviceUSMSpace::execution_space>;
using pool_type = Kokkos::Random_XorShift64_Pool<typename Kokkos::Experimental::SYCLDeviceUSMSpace::execution_space>;

if(isSet())
delete sycl_pool_;
Expand All @@ -196,13 +196,13 @@ resetPool(int mpi_rank) {
}

bool
Static_Random_XorShift64_Pool<typename Kokkos::SYCLDeviceUSMSpace::execution_space>::
Static_Random_XorShift64_Pool<typename Kokkos::Experimental::SYCLDeviceUSMSpace::execution_space>::
isSet() {
return sycl_pool_!=nullptr;
}

Kokkos::Random_XorShift64_Pool<typename Kokkos::SYCLDeviceUSMSpace::execution_space> &
Static_Random_XorShift64_Pool<typename Kokkos::SYCLDeviceUSMSpace::execution_space>::
Kokkos::Random_XorShift64_Pool<typename Kokkos::Experimental::SYCLDeviceUSMSpace::execution_space> &
Static_Random_XorShift64_Pool<typename Kokkos::Experimental::SYCLDeviceUSMSpace::execution_space>::
getPool() {
TEUCHOS_TEST_FOR_EXCEPTION(!isSet(),std::runtime_error,"Tpetra::Details::Static_Random_XorShift64_Pool: resetPool() must be called before getPool");
return *sycl_pool_;
Expand Down
4 changes: 2 additions & 2 deletions packages/tpetra/core/src/Tpetra_Details_Random.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ class Static_Random_XorShift64_Pool<typename Kokkos::HIPSpace::execution_space>

#ifdef KOKKOS_ENABLE_SYCL
template<>
class Static_Random_XorShift64_Pool<typename Kokkos::SYCLDeviceUSMSpace::execution_space> {
class Static_Random_XorShift64_Pool<typename Kokkos::Experimental::SYCLDeviceUSMSpace::execution_space> {
public:
static void resetPool(int mpi_rank);
static bool isSet();
static Kokkos::Random_XorShift64_Pool<typename Kokkos::SYCLDeviceUSMSpace::execution_space> & getPool();
static Kokkos::Random_XorShift64_Pool<typename Kokkos::Experimental::SYCLDeviceUSMSpace::execution_space> & getPool();
};
#endif // KOKKOS_ENABLE_SYCL

Expand Down
1 change: 0 additions & 1 deletion packages/tpetra/core/src/Tpetra_Import_Util2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,6 @@ lowCommunicationMakeColMapAndReindexKokkos (const Teuchos::ArrayView<const size_
const int PID = owningPIDs_view[j];
auto outcome = RemoteGIDs_view_map.insert(GID, PID);
if(outcome.success() && PID == -1) {
printf("Cannot figure out if ID is owned.\n");
Kokkos::abort("Cannot figure out if ID is owned.\n");
}
}
Expand Down

0 comments on commit 8b7ec4d

Please sign in to comment.