Skip to content

Commit

Permalink
Match Core profiling interface
Browse files Browse the repository at this point in the history
  • Loading branch information
cwpearson committed Feb 28, 2024
1 parent ece668f commit 37ce052
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
12 changes: 3 additions & 9 deletions profiling/all/impl/Kokkos_Profiling_C_Interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,11 @@ struct Kokkos_Profiling_SpaceHandle {
char name[64];
};

const static int Kokkos_Profiling_Kernel_Static_Info_Size = 512;

// uses a union to ensure the struct is as large as the target size
#define KOKKOS_PROFILING_KERNEL_STATIC_INFO_SIZE 512
struct Kokkos_Profiling_Kernel_Static_Info {
union {
struct {
uint64_t functor_size; // sizeof the functor
};
uint64_t functor_size; // sizeof the functor

char padding[Kokkos_Profiling_Kernel_Static_Info_Size];
};
char padding[KOKKOS_PROFILING_KERNEL_STATIC_INFO_SIZE - sizeof(uint64_t)];
};

// NOLINTNEXTLINE(modernize-use-using): C compatibility
Expand Down
3 changes: 2 additions & 1 deletion profiling/all/impl/Kokkos_Profiling_Interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ namespace Tools {

using KernelStaticInfo = Kokkos_Profiling_Kernel_Static_Info;

static_assert(sizeof(KernelStaticInfo) == 512,
static_assert(sizeof(KernelStaticInfo) ==
KOKKOS_PROFILING_KERNEL_STATIC_INFO_SIZE,
"Internal kokkos developer error. Please report this error, and "
"provide information about your compiler and target platform.");

Expand Down

0 comments on commit 37ce052

Please sign in to comment.