From b6060989492983451f3de0961db73b7c729049bb Mon Sep 17 00:00:00 2001 From: Vivek Kale Date: Thu, 7 Sep 2023 10:20:10 -0700 Subject: [PATCH] putting numeric limits for kernelSampleSkip back in --- common/kokkos-sampler/Makefile | 2 +- common/kokkos-sampler/kp_sampler_skip.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/common/kokkos-sampler/Makefile b/common/kokkos-sampler/Makefile index 862cae8fa..ce5f56ca1 100644 --- a/common/kokkos-sampler/Makefile +++ b/common/kokkos-sampler/Makefile @@ -1,4 +1,4 @@ -CXX = clang++ +CXX = g++ CXXFLAGS = -O3 -std=c++17 -g diff --git a/common/kokkos-sampler/kp_sampler_skip.cpp b/common/kokkos-sampler/kp_sampler_skip.cpp index aa2c6fa48..b5576a2ca 100644 --- a/common/kokkos-sampler/kp_sampler_skip.cpp +++ b/common/kokkos-sampler/kp_sampler_skip.cpp @@ -11,7 +11,7 @@ namespace KokkosTools { namespace Sampler { static uint64_t uniqID = 0; -static int64_t kernelSampleSkip = 0; +static int64_t kernelSampleSkip = std::numeric_limits::max(); static float tool_prob_num = -1.0; // Default probability of undefined percent of all invocations static int tool_verbosity = 0; @@ -44,7 +44,6 @@ void kokkosp_init_library(const int loadSeq, const uint64_t interfaceVer, const uint32_t devInfoCount, void* deviceInfo) { const char* tool_verbose_str = getenv("KOKKOS_TOOLS_SAMPLER_VERBOSE"); const char* tool_globFence_str = getenv("KOKKOS_TOOLS_GLOBALFENCES"); - kernelSampleSkip = 0; // use min for undefined skip rate if (NULL != tool_verbose_str) { tool_verbosity = atoi(tool_verbose_str); @@ -171,7 +170,7 @@ void kokkosp_init_library(const int loadSeq, const uint64_t interfaceVer, tool_prob_num = 0.0; } } - if ((tool_prob_num < 0.0) && (kernelSampleSkip == 0)) { + if ((tool_prob_num < 0.0) && (kernelSampleSkip == std::numeric_limits::max())) { if (tool_verbosity > 0) { printf( "KokkosP: Neither sampling utility's probability for sampling "