Skip to content

Commit

Permalink
Made async alloc work with default memory space
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoo committed May 24, 2024
1 parent 8db8d73 commit cc00fb4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions benchmarks/async_alloc/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#KOKKOS_DEVICES=OpenMP
#KOKKOS_ARCH="ZEN2"
KOKKOS_DEVICES=Cuda
KOKKOS_CUDA_OPTIONS=enable_lambda
KOKKOS_ARCH = "ZEN2,Ada89"
Expand Down
6 changes: 4 additions & 2 deletions benchmarks/async_alloc/async_alloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Kokkos Headers
#include "Kokkos_Core.hpp"

using MemorySpace = Kokkos::DefaultExecutionSpace::memory_space;

// Store the individual timings
std::vector<std::pair<size_t, double>> inner_loop_times;

Expand All @@ -24,7 +26,7 @@ std::pair<double, double> test(bool up) {

Kokkos::Timer first_alloc_timer;
{ // Prime the pump - first long alloc -- Time it.
Kokkos::View<float *, Kokkos::CudaSpace> dummy("unlabeled", 64);
Kokkos::View<float *, MemorySpace> dummy("unlabeled", 64);
}
double first_alloc_time = first_alloc_timer.seconds();

Expand All @@ -36,7 +38,7 @@ std::pair<double, double> test(bool up) {
for (size_t num : sizes) {
inner_loop_timer.reset();
for (int i = 0; i < iters; i++) {
Kokkos::View<float *, Kokkos::CudaSpace> a("unlabeled", num);
Kokkos::View<float *, MemorySpace> a("unlabeled", num);
}
double inner_loop_time = inner_loop_timer.seconds();

Expand Down

0 comments on commit cc00fb4

Please sign in to comment.