Skip to content

Commit

Permalink
Merge pull request #1354 from AdaptiveCpp/feature/kernel-cache-restri…
Browse files Browse the repository at this point in the history
…ct-warning

kernel_cache: Only emit JIT warning once even if get_or_construct_jit_code_object is instantiated multiple times
  • Loading branch information
illuhad committed Feb 13, 2024
2 parents c8d5224 + 9c7a80b commit a06a3ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/hipSYCL/runtime/kernel_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,8 @@ class kernel_cache {
if(!jit_compile(compiled_binary))
return nullptr;

// Don't need atomic because the function already uses a mutex.
static bool first_jit_compilation = true;
if(first_jit_compilation) {
first_jit_compilation = false;
if(_is_first_jit_compilation) {
_is_first_jit_compilation = false;
HIPSYCL_DEBUG_WARNING
<< "kernel_cache: This application run has resulted in new "
"binaries being JIT-compiled. This indicates that the runtime "
Expand Down Expand Up @@ -341,6 +339,8 @@ class kernel_cache {

std::unordered_map<code_object_id, code_object_ptr, glue::kernel_id_hash>
_code_objects;

bool _is_first_jit_compilation = true;
};

namespace detail {
Expand Down

0 comments on commit a06a3ce

Please sign in to comment.