Skip to content

Commit

Permalink
read KOKKOS_TOOLS_LIBS env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
vlkale committed Aug 24, 2023
1 parent 7db6d6e commit f86d34c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions common/kernel-filter/kp_kernel_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,18 @@ extern "C" void kokkosp_init_library(const int loadSeq,
(filterKernels ? "enabled" : "disabled"));

if (filterKernels) {
char* profileLibrary = getenv("KOKKOS_PROFILE_LIBRARY");
char* profileLibrary = getenv("KOKKOS_TOOLS_LIBS");
if (NULL == profileLibrary) { // check for backward compatibility with old environment variable
printf(
"Checking KOKKOS_PROFILE_LIBRARY. WARNING: This is a deprecated "
"variable. Please use KOKKOS_TOOLS_LIBS.\n");
profileLibrary = getenv("KOKKOS_PROFILE_LIBRARY");
if (NULL == profileLibrary) {
printf("KokkosP: No library to call in %s\n", profileLibrary);
exit(-1);
}
} // end check for backward compatability

char* envBuffer =
(char*)malloc(sizeof(char) * (strlen(profileLibrary) + 1));
strcpy(envBuffer, profileLibrary);
Expand Down Expand Up @@ -182,7 +193,7 @@ extern "C" void kokkosp_init_library(const int loadSeq,

printf("============================================================\n");
}
}
} // end kokkosp_init_library

extern "C" void kokkosp_finalize_library() {
if (NULL != finalizeProfileLibrary) {
Expand Down

0 comments on commit f86d34c

Please sign in to comment.