Skip to content

Commit

Permalink
clean ddc.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
blegouix committed Oct 12, 2023
1 parent 8e94a0d commit ff0a892
Showing 1 changed file with 0 additions and 112 deletions.
112 changes: 0 additions & 112 deletions include/ddc/ddc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,105 +61,6 @@ static std::shared_ptr<gko::Executor> create_default_host_executor()
#endif
} // Comes from "Basic Kokkos Extension" Ginkgo MR

#if 0
template <typename ExecSpace,
typename MemorySpace = typename ExecSpace::memory_space>
static std::shared_ptr<gko::Executor> create_executor(ExecSpace, MemorySpace = {})
{
static_assert(
Kokkos::SpaceAccessibility<ExecSpace, MemorySpace>::accessible);
#ifdef KOKKOS_ENABLE_SERIAL
if constexpr (std::is_same_v<ExecSpace, Kokkos::Serial>) {
return gko::ReferenceExecutor::create();
}
#endif
#ifdef KOKKOS_ENABLE_OPENMP
if constexpr (std::is_same_v<ExecSpace, Kokkos::OpenMP>) {
return gko::OmpExecutor::create();
}
#endif
#ifdef KOKKOS_ENABLE_CUDA
if constexpr (std::is_same_v<ExecSpace, Kokkos::Cuda>) {
if constexpr (std::is_same_v<MemorySpace, Kokkos::CudaSpace>) {
return gko::CudaExecutor::create(Kokkos::device_id(),
create_default_host_executor(),
std::make_shared<gko::CudaAllocator>());

}
if constexpr (std::is_same_v<MemorySpace, Kokkos::CudaUVMSpace>) {
return gko::CudaExecutor::create(
Kokkos::device_id(), create_default_host_executor(),
std::make_shared<gko::CudaUnifiedAllocator>(
Kokkos::device_id()));
}
if constexpr (std::is_same_v<MemorySpace,
Kokkos::CudaHostPinnedSpace>) {
return gko::CudaExecutor::create(
Kokkos::device_id(), create_default_host_executor(),
std::make_shared<gko::CudaHostAllocator>(Kokkos::device_id()));
}
}
#endif
#ifdef KOKKOS_ENABLE_HIP
if constexpr (std::is_same_v<ExecSpace, Kokkos::HIP>) {
if constexpr (std::is_same_v<MemorySpace, Kokkos::HIPSpace>) {
return gko::HipExecutor::create(Kokkos::device_id(),
create_default_host_executor(),
std::make_shared<gko::HipAllocator>());
}
if constexpr (std::is_same_v<MemorySpace, Kokkos::HIPManagedSpace>) {
return gko::HipExecutor::create(
Kokkos::device_id(), create_default_host_executor(),
std::make_shared<gko::HipUnifiedAllocator>(
Kokkos::device_id()));
}
if constexpr (std::is_same_v<MemorySpace, Kokkos::HIPHostPinnedSpace>) {
return gko::HipExecutor::create(
Kokkos::device_id(), create_default_host_executor(),
std::make_shared<gko::HipHostAllocator>(Kokkos::device_id()));
}
}
#endif
#ifdef KOKKOS_ENABLE_SYCL
if constexpr (std::is_same_v<ExecSpace, Kokkos::Experimental::SYCL>) {
// for now Ginkgo doesn't support different allocators for SYCL
return gko::DpcppExecutor::create(Kokkos::device_id(),
create_default_host_executor());
}
#endif
} // Comes from "Basic Kokkos Extension" Ginkgo MR

static std::shared_ptr<gko::Executor> create_default_executor()
{
return create_executor(Kokkos::DefaultExecutionSpace{});
} // Comes from "Basic Kokkos Extension" Ginkgo MR
#endif // Not working for some reason

#if 0
static std::shared_ptr<gko::Executor> create_default_executor() {
#ifdef KOKKOS_ENABLE_SERIAL
if (std::is_same_v<Kokkos::DefaultExecutionSpace,
Kokkos::Serial>) {
return gko::ReferenceExecutor::create();
}
#endif
#ifdef KOKKOS_ENABLE_OPENMP
if (std::is_same_v<Kokkos::DefaultExecutionSpace,
Kokkos::OpenMP>) {
return gko::OmpExecutor::create();
}
#endif
#ifdef KOKKOS_ENABLE_CUDA
if (std::is_same_v<Kokkos::DefaultExecutionSpace, Kokkos::Cuda>) {
return gko::CudaExecutor::create(0,
create_default_host_executor());
}
#endif
} // Comes from kokkos_assembly example in Ginkgo develop branch
static std::shared_ptr<gko::Executor> gko_default_host_exec = create_default_host_executor();
static std::shared_ptr<gko::Executor> gko_default_exec = create_default_executor();
#endif

template <typename ExecSpace>
static std::shared_ptr<gko::Executor> create_gko_exec()
{
Expand All @@ -185,19 +86,6 @@ class DDCInitializer
public:
DDCInitializer()
{
#if 0
// gko_omp_exec = gko::OmpExecutor::create();
gko_default_host_exec = gko::OmpExecutor::create();
// gko_cuda_exec = gko::CudaExecutor::create(0, gko_default_host_exec);

if constexpr (std::is_same_v<Kokkos::DefaultExecutionSpace, Kokkos::OpenMP>) {
gko_default_exec->create();
}
else if constexpr (std::is_same_v<Kokkos::DefaultExecutionSpace, Kokkos::Cuda>) {
gko_default_exec->create(0, gko_default_host_exec);
}

#endif
}
};

Expand Down

0 comments on commit ff0a892

Please sign in to comment.