Skip to content

Commit

Permalink
Support configuration string in Kokkos integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikołaj Zuzek committed Nov 30, 2021
1 parent c7d3486 commit 4f26028
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/services/kokkos/KokkosProfilingSymbols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ void kokkosp_parse_args(int argc, char *argv_raw[]) {
std::cerr << "Kokkos Caliper connector error: " << ::kokkos::mgr.error_msg()
<< std::endl;
}
}
if (::kokkos::mgr.get_all_channels().size() > 0) {
::kokkos::mgr.start();
}
}
Expand Down Expand Up @@ -195,7 +197,22 @@ __attribute__((weak)) void kokkosp_end_deep_copy() {
}
}
namespace cali {
extern Kokkos::Tools::Experimental::EventSet get_event_set() {
void set_cali_config(const char* config_str) {
if (config_str == nullptr or strlen(config_str) <= 0)
return;
if (::kokkos::mgr.add(config_str))
return;
if (::kokkos::mgr.error()) {
std::cerr << "Kokkos Caliper connector error: " << ::kokkos::mgr.error_msg()
<< std::endl;
} else {
std::cerr << "Failed to configure Caliper with: " << config_str
<< std::endl;
}
}

extern Kokkos::Tools::Experimental::EventSet get_event_set(const char* config_str = nullptr) {
set_cali_config(config_str);
Kokkos::Tools::Experimental::EventSet my_event_set;
memset(&my_event_set, 0, sizeof(my_event_set)); // zero any pointers not set here
my_event_set.init = cali::kokkosp_init_library;
Expand Down

0 comments on commit 4f26028

Please sign in to comment.