From cf105ff5f7afc968aebbea01f8d92b2bbcb451ff Mon Sep 17 00:00:00 2001 From: Vivek Kale <11766050+vlkale@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:44:36 -0700 Subject: [PATCH] Fix tool glob fence to bool --- common/kokkos-sampler/kp_sampler_skip.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/common/kokkos-sampler/kp_sampler_skip.cpp b/common/kokkos-sampler/kp_sampler_skip.cpp index 3c6e40564..ff543dbd4 100644 --- a/common/kokkos-sampler/kp_sampler_skip.cpp +++ b/common/kokkos-sampler/kp_sampler_skip.cpp @@ -15,7 +15,7 @@ static uint64_t kernelSampleSkip = static float tool_prob_num = 1.0; // Default probability of 1 percent of all invocations static int tool_verbosity = 0; -static int tool_globFence = 0; +static bool tool_globFence = 0; typedef void (*initFunction)(const int, const uint64_t, const uint32_t, void*); typedef void (*finalizeFunction)(); @@ -33,10 +33,11 @@ static endFunction endReduceCallee = NULL; void kokkosp_request_tool_settings(const uint32_t, Kokkos_Tools_ToolSettings* settings) { - if (0 == tool_globFence) { - settings->requires_global_fencing = false; - } else { + settings->requires_global_fencing = true; + if (tool_globFence) { settings->requires_global_fencing = true; + } else { + settings->requires_global_fencing = false; } } @@ -51,9 +52,9 @@ void kokkosp_init_library(const int loadSeq, const uint64_t interfaceVer, tool_verbosity = 0; } if (NULL != tool_globFence_str) { - tool_globFence = atoi(tool_globFence_str); + tool_globFence = (atoi(tool_global_fences) != 0); } else { - tool_globFence = 0; + tool_globFence = false; } char* profileLibrary = getenv("KOKKOS_TOOLS_LIBS");