Skip to content

Commit

Permalink
add gather benchmark to CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricchevalier19 committed Mar 4, 2024
1 parent 5c9a4aa commit 932466f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
KOKKOS_ADD_BENCHMARK_DIRECTORIES(bytes_and_flops)
KOKKOS_ADD_BENCHMARK_DIRECTORIES(gather)
KOKKOS_ADD_BENCHMARK_DIRECTORIES(gups)
KOKKOS_ADD_BENCHMARK_DIRECTORIES(launch_latency)
KOKKOS_ADD_BENCHMARK_DIRECTORIES(stream)
4 changes: 4 additions & 0 deletions benchmarks/gather/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
KOKKOS_ADD_EXECUTABLE(
gather
SOURCES main.cpp
)
16 changes: 8 additions & 8 deletions benchmarks/gather/gather.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,28 @@ struct RunGather {
};

#define UNROLL 1
#include <gather_unroll.hpp>
#include "gather_unroll.hpp"
#undef UNROLL
#define UNROLL 2
#include <gather_unroll.hpp>
#include "gather_unroll.hpp"
#undef UNROLL
#define UNROLL 3
#include <gather_unroll.hpp>
#include "gather_unroll.hpp"
#undef UNROLL
#define UNROLL 4
#include <gather_unroll.hpp>
#include "gather_unroll.hpp"
#undef UNROLL
#define UNROLL 5
#include <gather_unroll.hpp>
#include "gather_unroll.hpp"
#undef UNROLL
#define UNROLL 6
#include <gather_unroll.hpp>
#include "gather_unroll.hpp"
#undef UNROLL
#define UNROLL 7
#include <gather_unroll.hpp>
#include "gather_unroll.hpp"
#undef UNROLL
#define UNROLL 8
#include <gather_unroll.hpp>
#include "gather_unroll.hpp"
#undef UNROLL

template <class Scalar>
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/gather/gather_unroll.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ struct RunGather<Scalar, UNROLL> {
printf(
"SNKDRUF: %i %i %i %i %i %i %i Time: %lfs Bandwidth: %lfGiB/s GFlop/s: "
"%lf GGather/s: %lf\n",
sizeof(Scalar) / 4, N, K, D, R, UNROLL, F, seconds,
static_cast<int>(sizeof(Scalar) / 4), N, K, D, R, UNROLL, F, seconds,
1.0 * bytes / seconds / 1024 / 1024 / 1024, 1.e-9 * flops / seconds,
1.e-9 * gather_ops / seconds);
}
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/gather/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include <Kokkos_Core.hpp>
#include <Kokkos_Timer.hpp>
#include <gather.hpp>
#include "gather.hpp"
#include <cstdlib>

int main(int argc, char* argv[]) {
Expand Down

0 comments on commit 932466f

Please sign in to comment.