From c93160a203f9ff50ccb93f90ecd0d0a8e3a921c7 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Tue, 22 Oct 2024 20:20:54 -0700 Subject: [PATCH 1/8] [SYCL] Repurpose SYCL_CACHE_TRACE to enable fine-grained tracing of caches. --- sycl/doc/EnvironmentVariables.md | 17 +++- sycl/source/detail/config.def | 2 +- sycl/source/detail/config.hpp | 51 ++++++++++ .../detail/persistent_device_code_cache.hpp | 8 +- .../KernelAndProgram/test_cache_jit_aot.cpp | 4 +- sycl/unittests/config/ConfigTests.cpp | 93 +++++++++++++++++++ 6 files changed, 168 insertions(+), 7 deletions(-) diff --git a/sycl/doc/EnvironmentVariables.md b/sycl/doc/EnvironmentVariables.md index 8e10295ffa15b..4a311447790fd 100644 --- a/sycl/doc/EnvironmentVariables.md +++ b/sycl/doc/EnvironmentVariables.md @@ -210,7 +210,7 @@ variables in production code. | `SYCL_USE_KERNEL_SPV` | Path to the SPIR-V binary | Load device image from the specified file. If runtime is unable to read the file, `sycl::runtime_error` exception is thrown. The image is assumed to have been created using the `-fno-sycl-dead-args-optimization` option. | | `SYCL_DUMP_IMAGES` | Any(\*) | Dump device image binaries to file. Control has no effect if `SYCL_USE_KERNEL_SPV` is set. | | `SYCL_HOST_UNIFIED_MEMORY` | Integer | Enforce host unified memory support or lack of it for the execution graph builder. If set to 0, it is enforced as not supported by all devices. If set to 1, it is enforced as supported by all devices. | -| `SYCL_CACHE_TRACE` | Any(\*) | If the variable is set, messages are sent to std::cerr when caching events or non-blocking failures happen (e.g. unable to access cache item file). | +| `SYCL_CACHE_TRACE` | Described [below](#sycl_cache_trace-options) | Enable tracing for different SYCL caches and kernel_compiler. | | `SYCL_PARALLEL_FOR_RANGE_ROUNDING_TRACE` | Any(\*) | Enables tracing of `parallel_for` invocations with rounded-up ranges. | | `SYCL_PI_SUPPRESS_ERROR_MESSAGE` | Any(\*) | Suppress printing of error message, only used for CI in order not to interrupt errors generated by underlying toolchains; note that the variable only modifies the printing of the error message (error value, name, description and location), the handling of error return code and aborting/throwing behaviour remains unchanged. | | `SYCL_JIT_COMPILER_DEBUG` | Any(\*) | Passes can specify their own debug types, `sycl-spec-const-materializer` enables debug output generation in specialization constants materialization pass. | @@ -245,6 +245,21 @@ Supported tracing levels are in the table below | 2 | Enable tracing of the UR calls | | -1 | Enable all levels of tracing | +### `SYCL_CACHE_TRACE` Options + +`SYCL_CACHE_TRACE` enables tracing of different SYCL caches and kernel_compiler. It accepts one of the values from the table below: + +| Option | Description | +| ------ | ----------- | +| 0 | Disable tracing | +| 1 | Enable tracing of persistent cache | +| 2 | Enable tracing of in-memory cache | +| 3 | Enable tracing of persistent and in-memory cache | +| 4 | Enable tracing of kernel_compiler | +| 5 | Enable tracing of persistent cache and kernel_compiler | +| 6 | Enable tracing of in-memory cache and kernel_compiler | +| 7 | Enable tracing of persistent, in-memory cache, and kernel_compiler | +| Other non-null values | Enable tracing of persistent cache (Depreciated) | ## Debugging variables for Level Zero Plugin diff --git a/sycl/source/detail/config.def b/sycl/source/detail/config.def index 5ffd52a319bdb..cc561e9c664c5 100644 --- a/sycl/source/detail/config.def +++ b/sycl/source/detail/config.def @@ -26,7 +26,7 @@ CONFIG(SYCL_PROGRAM_APPEND_COMPILE_OPTIONS, 64, __SYCL_PROGRAM_APPEND_COMPILE_OP CONFIG(SYCL_HOST_UNIFIED_MEMORY, 1, __SYCL_HOST_UNIFIED_MEMORY) // 260 (Windows limit) - 12 (filename) - 84 (cache directory structure) CONFIG(SYCL_CACHE_DIR, 164, __SYCL_CACHE_DIR) -CONFIG(SYCL_CACHE_TRACE, 1, __SYCL_CACHE_TRACE) +CONFIG(SYCL_CACHE_TRACE, 16, __SYCL_CACHE_TRACE) CONFIG(SYCL_CACHE_DISABLE_PERSISTENT, 1, __SYCL_CACHE_DISABLE_PERSISTENT) CONFIG(SYCL_CACHE_PERSISTENT, 1, __SYCL_CACHE_PERSISTENT) CONFIG(SYCL_CACHE_EVICTION_DISABLE, 1, __SYCL_CACHE_EVICTION_DISABLE) diff --git a/sycl/source/detail/config.hpp b/sycl/source/detail/config.hpp index 599f21f02e1ce..392ef8e2ae5eb 100644 --- a/sycl/source/detail/config.hpp +++ b/sycl/source/detail/config.hpp @@ -698,6 +698,57 @@ template <> class SYCLConfig { } }; +// SYCL_CACHE_TRACE accepts the following values: +// 0 - no tracing +// 1 - trace disk cache +// 2 - trace in-memory cache +// 3 - trace disk and in-memory cache +// 4 - trace kernel_compiler +// 5 - trace disk and kernel_compiler +// 6 - trace in-memory and kernel_compiler +// 7 - trace disk, in-memory and kernel_compiler +// - trace disk cache (Legacy behavior) +template <> class SYCLConfig { + using BaseT = SYCLConfigBase; + +public: + static unsigned int get() { return getCachedValue(); } + static void reset() { (void)getCachedValue(true); } + static bool isTraceDiskCache() { return getCachedValue() & 1; } + static bool isTraceInMemCache() { return getCachedValue() & 2; } + static bool isTraceKernelCompiler() { return getCachedValue() & 4; } + +private: + static unsigned int getCachedValue(bool ResetCache = false) { + const auto Parser = []() { + const char *ValStr = BaseT::getRawValue(); + int intVal = 0; + + if (ValStr) { + try { + intVal = std::stoi(ValStr); + } catch (...) { + // If the value is not null and not a number, it is considered + // to enable disk cache tracing. This is the legacy behavior. + intVal = 1; + } + } + + // Legacy behavior. + if (intVal > 7) + intVal = 1; + + return intVal; + }; + + static unsigned int Level = Parser(); + if (ResetCache) + Level = Parser(); + + return Level; + } +}; + #undef INVALID_CONFIG_EXCEPTION } // namespace detail diff --git a/sycl/source/detail/persistent_device_code_cache.hpp b/sycl/source/detail/persistent_device_code_cache.hpp index e2b3c8f72c4da..dadff09e2b9ce 100644 --- a/sycl/source/detail/persistent_device_code_cache.hpp +++ b/sycl/source/detail/persistent_device_code_cache.hpp @@ -16,6 +16,8 @@ #include #include #include + +#include #include #include #include @@ -190,9 +192,9 @@ class PersistentDeviceCodeCache { /* Sends message to std:cerr stream when SYCL_CACHE_TRACE environemnt is set*/ static void trace(const std::string &msg) { - static const char *TraceEnabled = SYCLConfig::get(); - if (TraceEnabled) - std::cerr << "*** Code caching: " << msg << std::endl; + static const bool traceEnabled = SYCLConfig::isTraceDiskCache(); + if (traceEnabled) + std::cerr << "[Persistent Cache]: " << msg << std::endl; } }; } // namespace detail diff --git a/sycl/test-e2e/KernelAndProgram/test_cache_jit_aot.cpp b/sycl/test-e2e/KernelAndProgram/test_cache_jit_aot.cpp index 9f0941e50987b..bea437200bdba 100644 --- a/sycl/test-e2e/KernelAndProgram/test_cache_jit_aot.cpp +++ b/sycl/test-e2e/KernelAndProgram/test_cache_jit_aot.cpp @@ -66,8 +66,8 @@ // RUN: %{cache_vars} %{run-unfiltered-devices} %t.out 2>&1 | FileCheck %s --check-prefixes RESULT1 // ****************************** -// CHECK-CACHE-WRITE: Code caching: device binary has been cached -// CHECK-CACHE-READ: Code caching: using cached device binary +// CHECK-CACHE-WRITE: [Persistent Cache]: device binary has been cached +// CHECK-CACHE-READ: [Persistent Cache]: using cached device binary // RESULT1: Result (0): 1 // RESULT1: Result (1): 1 diff --git a/sycl/unittests/config/ConfigTests.cpp b/sycl/unittests/config/ConfigTests.cpp index 50eaf2f8816e2..f365ffe7ca72d 100644 --- a/sycl/unittests/config/ConfigTests.cpp +++ b/sycl/unittests/config/ConfigTests.cpp @@ -232,3 +232,96 @@ TEST(ConfigTests, CheckConfigProcessing) { sycl::detail::SYCLConfig< sycl::detail::SYCL_PRINT_EXECUTION_GRAPH>::get()); } + +// Unit test for SYCL_CACHE_TRACE environment variable. +// SYCL_CACHE_TRACE accepts the following values: +// 0 - no tracing +// 1 - trace disk cache +// 2 - trace in-memory cache +// 3 - trace disk and in-memory cache +// 4 - trace kernel_compiler +// 5 - trace disk and kernel_compiler +// 6 - trace in-memory and kernel_compiler +// 7 - trace disk, in-memory and kernel_compiler +// - trace disk cache (Legacy behavior) +using namespace sycl::detail; +TEST(ConfigTests, CheckSyclCacheTraceTest) { + + // Lambda to test parsing of SYCL_CACHE_TRACE + auto TestConfig = [](int expectedValue, int expectedDiskCache, + int expectedInMemCache, int expectedKernelCompiler) { + EXPECT_EQ(static_cast(expectedValue), + SYCLConfig::get()); + + EXPECT_EQ( + expectedDiskCache, + static_cast( + sycl::detail::SYCLConfig::isTraceDiskCache())); + EXPECT_EQ( + expectedInMemCache, + static_cast( + sycl::detail::SYCLConfig::isTraceInMemCache())); + EXPECT_EQ(expectedKernelCompiler, + static_cast(sycl::detail::SYCLConfig< + SYCL_CACHE_TRACE>::isTraceKernelCompiler())); + }; + + // Lambda to set SYCL_CACHE_TRACE + auto SetSyclCacheTraceEnv = [](const char *value) { +#ifdef _WIN32 + _putenv_s("SYCL_CACHE_TRACE", value); +#else + setenv("SYCL_CACHE_TRACE", value, 1); +#endif + }; + + SetSyclCacheTraceEnv("0"); + sycl::detail::readConfig(true); + TestConfig(0, 0, 0, 0); + + SetSyclCacheTraceEnv("1"); + sycl::detail::SYCLConfig::reset(); + TestConfig(1, 1, 0, 0); + + SetSyclCacheTraceEnv("2"); + sycl::detail::SYCLConfig::reset(); + TestConfig(2, 0, 1, 0); + + SetSyclCacheTraceEnv("3"); + sycl::detail::SYCLConfig::reset(); + TestConfig(3, 1, 1, 0); + + SetSyclCacheTraceEnv("4"); + sycl::detail::SYCLConfig::reset(); + TestConfig(4, 0, 0, 1); + + SetSyclCacheTraceEnv("5"); + sycl::detail::SYCLConfig::reset(); + TestConfig(5, 1, 0, 1); + + SetSyclCacheTraceEnv("6"); + sycl::detail::SYCLConfig::reset(); + TestConfig(6, 0, 1, 1); + + SetSyclCacheTraceEnv("7"); + sycl::detail::SYCLConfig::reset(); + TestConfig(7, 1, 1, 1); + + SetSyclCacheTraceEnv("8"); + sycl::detail::SYCLConfig::reset(); + TestConfig(1, 1, 0, 0); + + // Set random non-null value. It should default to 1. + SetSyclCacheTraceEnv("random"); + sycl::detail::SYCLConfig::reset(); + TestConfig(1, 1, 0, 0); + + // When SYCL_CACHE_TRACE is not set, it should default to 0. +#ifdef _WIN32 + _putenv_s("SYCL_CACHE_TRACE", ""); +#else + unsetenv("SYCL_CACHE_TRACE"); +#endif + sycl::detail::SYCLConfig::reset(); + TestConfig(0, 0, 0, 0); +} \ No newline at end of file From 7f20c6f42ac0b60ddef493bc5321fc6de41a5cb9 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Tue, 22 Oct 2024 20:26:07 -0700 Subject: [PATCH 2/8] Add line at EOF --- sycl/unittests/config/ConfigTests.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sycl/unittests/config/ConfigTests.cpp b/sycl/unittests/config/ConfigTests.cpp index f365ffe7ca72d..1bb2f7a2be990 100644 --- a/sycl/unittests/config/ConfigTests.cpp +++ b/sycl/unittests/config/ConfigTests.cpp @@ -324,4 +324,5 @@ TEST(ConfigTests, CheckSyclCacheTraceTest) { #endif sycl::detail::SYCLConfig::reset(); TestConfig(0, 0, 0, 0); -} \ No newline at end of file +} + From 9dbdeac26419c64666340ba7e022977912bf71b0 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Tue, 22 Oct 2024 21:07:46 -0700 Subject: [PATCH 3/8] Remove redundant include --- sycl/source/detail/persistent_device_code_cache.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/sycl/source/detail/persistent_device_code_cache.hpp b/sycl/source/detail/persistent_device_code_cache.hpp index dadff09e2b9ce..1f798f14d6a6b 100644 --- a/sycl/source/detail/persistent_device_code_cache.hpp +++ b/sycl/source/detail/persistent_device_code_cache.hpp @@ -17,7 +17,6 @@ #include #include -#include #include #include #include From 76919e28a2e2019e4a2d22b12387b4864871b229 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Tue, 22 Oct 2024 21:09:29 -0700 Subject: [PATCH 4/8] More cleanup --- sycl/source/detail/persistent_device_code_cache.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/sycl/source/detail/persistent_device_code_cache.hpp b/sycl/source/detail/persistent_device_code_cache.hpp index 1f798f14d6a6b..3815e5a1d0bf0 100644 --- a/sycl/source/detail/persistent_device_code_cache.hpp +++ b/sycl/source/detail/persistent_device_code_cache.hpp @@ -16,7 +16,6 @@ #include #include #include - #include #include #include From ba15609b039c6872be631be421eeaa39f0eb8b41 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Wed, 23 Oct 2024 13:43:13 -0700 Subject: [PATCH 5/8] Address feedback --- sycl/doc/EnvironmentVariables.md | 22 ++++++++---------- sycl/source/detail/config.hpp | 33 ++++++++++++++++----------- sycl/unittests/config/ConfigTests.cpp | 21 ++++++++--------- 3 files changed, 39 insertions(+), 37 deletions(-) diff --git a/sycl/doc/EnvironmentVariables.md b/sycl/doc/EnvironmentVariables.md index 4a311447790fd..57cb56da7da9d 100644 --- a/sycl/doc/EnvironmentVariables.md +++ b/sycl/doc/EnvironmentVariables.md @@ -210,7 +210,7 @@ variables in production code. | `SYCL_USE_KERNEL_SPV` | Path to the SPIR-V binary | Load device image from the specified file. If runtime is unable to read the file, `sycl::runtime_error` exception is thrown. The image is assumed to have been created using the `-fno-sycl-dead-args-optimization` option. | | `SYCL_DUMP_IMAGES` | Any(\*) | Dump device image binaries to file. Control has no effect if `SYCL_USE_KERNEL_SPV` is set. | | `SYCL_HOST_UNIFIED_MEMORY` | Integer | Enforce host unified memory support or lack of it for the execution graph builder. If set to 0, it is enforced as not supported by all devices. If set to 1, it is enforced as supported by all devices. | -| `SYCL_CACHE_TRACE` | Described [below](#sycl_cache_trace-options) | Enable tracing for different SYCL caches and kernel_compiler. | +| `SYCL_CACHE_TRACE` | Described [below](#sycl_cache_trace-options) | Enable tracing for different SYCL and `kernel_compiler` caches. | | `SYCL_PARALLEL_FOR_RANGE_ROUNDING_TRACE` | Any(\*) | Enables tracing of `parallel_for` invocations with rounded-up ranges. | | `SYCL_PI_SUPPRESS_ERROR_MESSAGE` | Any(\*) | Suppress printing of error message, only used for CI in order not to interrupt errors generated by underlying toolchains; note that the variable only modifies the printing of the error message (error value, name, description and location), the handling of error return code and aborting/throwing behaviour remains unchanged. | | `SYCL_JIT_COMPILER_DEBUG` | Any(\*) | Passes can specify their own debug types, `sycl-spec-const-materializer` enables debug output generation in specialization constants materialization pass. | @@ -247,19 +247,15 @@ Supported tracing levels are in the table below ### `SYCL_CACHE_TRACE` Options -`SYCL_CACHE_TRACE` enables tracing of different SYCL caches and kernel_compiler. It accepts one of the values from the table below: - -| Option | Description | +`SYCL_CACHE_TRACE` accepts a bit-mask to control the tracing of different SYCL caches. The input value is parsed as an integer and the following bit-masks are used to determine the tracing behavior: +| Bit-mask | Corresponding cache tracing | | ------ | ----------- | -| 0 | Disable tracing | -| 1 | Enable tracing of persistent cache | -| 2 | Enable tracing of in-memory cache | -| 3 | Enable tracing of persistent and in-memory cache | -| 4 | Enable tracing of kernel_compiler | -| 5 | Enable tracing of persistent cache and kernel_compiler | -| 6 | Enable tracing of in-memory cache and kernel_compiler | -| 7 | Enable tracing of persistent, in-memory cache, and kernel_compiler | -| Other non-null values | Enable tracing of persistent cache (Depreciated) | +| 0x01 | Enable tracing of persistent cache | +| 0x02 | Enable tracing of in-memory cache | +| 0x04 | Enable tracing of `kernel_compiler` cache | + +Any valid combination of the above bit-masks can be used to enable/disable tracing of the corresponding caches. If the input value is not null and not a valid number, the disk cache tracing will be enabled (depreciated behavior). +The default value is 0 and no tracing is enabled. ## Debugging variables for Level Zero Plugin diff --git a/sycl/source/detail/config.hpp b/sycl/source/detail/config.hpp index 392ef8e2ae5eb..49bef4fbb6cf1 100644 --- a/sycl/source/detail/config.hpp +++ b/sycl/source/detail/config.hpp @@ -698,25 +698,32 @@ template <> class SYCLConfig { } }; -// SYCL_CACHE_TRACE accepts the following values: -// 0 - no tracing -// 1 - trace disk cache -// 2 - trace in-memory cache -// 3 - trace disk and in-memory cache -// 4 - trace kernel_compiler -// 5 - trace disk and kernel_compiler -// 6 - trace in-memory and kernel_compiler -// 7 - trace disk, in-memory and kernel_compiler -// - trace disk cache (Legacy behavior) +// SYCL_CACHE_TRACE accepts a bit-mask to control the tracing of +// different SYCL caches. The input value is parsed as an integer and +// the following bit-masks is used to determine the tracing behavior: +// 0x01 - trace disk cache +// 0x02 - trace in-memory cache +// 0x04 - trace kernel_compiler cache +// Any valid combination of the above bit-masks can be used to enable/disable +// tracing of the corresponding caches. If the input value is not null and +// not a valid number, the disk cache tracing will be enabled (depreciated +// behavior). The default value is 0 and no tracing is enabled. template <> class SYCLConfig { using BaseT = SYCLConfigBase; + enum TraceBitmask { DiskCache = 1, InMemCache = 2, KernelCompiler = 4 }; public: static unsigned int get() { return getCachedValue(); } static void reset() { (void)getCachedValue(true); } - static bool isTraceDiskCache() { return getCachedValue() & 1; } - static bool isTraceInMemCache() { return getCachedValue() & 2; } - static bool isTraceKernelCompiler() { return getCachedValue() & 4; } + static bool isTraceDiskCache() { + return getCachedValue() & TraceBitmask::DiskCache; + } + static bool isTraceInMemCache() { + return getCachedValue() & TraceBitmask::InMemCache; + } + static bool isTraceKernelCompiler() { + return getCachedValue() & TraceBitmask::KernelCompiler; + } private: static unsigned int getCachedValue(bool ResetCache = false) { diff --git a/sycl/unittests/config/ConfigTests.cpp b/sycl/unittests/config/ConfigTests.cpp index 1bb2f7a2be990..b5dc1a12cb478 100644 --- a/sycl/unittests/config/ConfigTests.cpp +++ b/sycl/unittests/config/ConfigTests.cpp @@ -233,17 +233,16 @@ TEST(ConfigTests, CheckConfigProcessing) { sycl::detail::SYCL_PRINT_EXECUTION_GRAPH>::get()); } -// Unit test for SYCL_CACHE_TRACE environment variable. -// SYCL_CACHE_TRACE accepts the following values: -// 0 - no tracing -// 1 - trace disk cache -// 2 - trace in-memory cache -// 3 - trace disk and in-memory cache -// 4 - trace kernel_compiler -// 5 - trace disk and kernel_compiler -// 6 - trace in-memory and kernel_compiler -// 7 - trace disk, in-memory and kernel_compiler -// - trace disk cache (Legacy behavior) +// SYCL_CACHE_TRACE accepts a bit-mask to control the tracing of +// different SYCL caches. The input value is parsed as an integer and +// the following bit-masks is used to determine the tracing behavior: +// 0x01 - trace disk cache +// 0x02 - trace in-memory cache +// 0x04 - trace kernel_compiler cache +// Any valid combination of the above bit-masks can be used to enable/disable +// tracing of the corresponding caches. If the input value is not null and +// not a valid number, the disk cache tracing will be enabled (depreciated +// behavior). The default value is 0 and no tracing is enabled. using namespace sycl::detail; TEST(ConfigTests, CheckSyclCacheTraceTest) { From a406c296d31471d72c4ae16299c5c12735c7e975 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Wed, 23 Oct 2024 17:06:28 -0700 Subject: [PATCH 6/8] Reduce size of SYCL_CACHE_TRACE's input to 4 bytes --- sycl/source/detail/config.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/source/detail/config.def b/sycl/source/detail/config.def index cc561e9c664c5..9172df2a1497b 100644 --- a/sycl/source/detail/config.def +++ b/sycl/source/detail/config.def @@ -26,7 +26,7 @@ CONFIG(SYCL_PROGRAM_APPEND_COMPILE_OPTIONS, 64, __SYCL_PROGRAM_APPEND_COMPILE_OP CONFIG(SYCL_HOST_UNIFIED_MEMORY, 1, __SYCL_HOST_UNIFIED_MEMORY) // 260 (Windows limit) - 12 (filename) - 84 (cache directory structure) CONFIG(SYCL_CACHE_DIR, 164, __SYCL_CACHE_DIR) -CONFIG(SYCL_CACHE_TRACE, 16, __SYCL_CACHE_TRACE) +CONFIG(SYCL_CACHE_TRACE, 4, __SYCL_CACHE_TRACE) CONFIG(SYCL_CACHE_DISABLE_PERSISTENT, 1, __SYCL_CACHE_DISABLE_PERSISTENT) CONFIG(SYCL_CACHE_PERSISTENT, 1, __SYCL_CACHE_PERSISTENT) CONFIG(SYCL_CACHE_EVICTION_DISABLE, 1, __SYCL_CACHE_EVICTION_DISABLE) From 2f2369a09c397f0cc4196bd25a89f6dfb04c9cbe Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Wed, 23 Oct 2024 17:23:18 -0700 Subject: [PATCH 7/8] Fix formatting --- sycl/source/detail/persistent_device_code_cache.hpp | 3 ++- sycl/unittests/config/ConfigTests.cpp | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/source/detail/persistent_device_code_cache.hpp b/sycl/source/detail/persistent_device_code_cache.hpp index 3815e5a1d0bf0..868c247f28903 100644 --- a/sycl/source/detail/persistent_device_code_cache.hpp +++ b/sycl/source/detail/persistent_device_code_cache.hpp @@ -190,7 +190,8 @@ class PersistentDeviceCodeCache { /* Sends message to std:cerr stream when SYCL_CACHE_TRACE environemnt is set*/ static void trace(const std::string &msg) { - static const bool traceEnabled = SYCLConfig::isTraceDiskCache(); + static const bool traceEnabled = + SYCLConfig::isTraceDiskCache(); if (traceEnabled) std::cerr << "[Persistent Cache]: " << msg << std::endl; } diff --git a/sycl/unittests/config/ConfigTests.cpp b/sycl/unittests/config/ConfigTests.cpp index b5dc1a12cb478..3022ccbd52e65 100644 --- a/sycl/unittests/config/ConfigTests.cpp +++ b/sycl/unittests/config/ConfigTests.cpp @@ -324,4 +324,3 @@ TEST(ConfigTests, CheckSyclCacheTraceTest) { sycl::detail::SYCLConfig::reset(); TestConfig(0, 0, 0, 0); } - From 8846e244622520f30eb35c402e8a88be3ffccbe3 Mon Sep 17 00:00:00 2001 From: Udit Agarwal Date: Thu, 24 Oct 2024 06:11:59 -0700 Subject: [PATCH 8/8] Address reviews Co-authored-by: Steffen Larsen --- sycl/doc/EnvironmentVariables.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/doc/EnvironmentVariables.md b/sycl/doc/EnvironmentVariables.md index 57cb56da7da9d..ed504228b1f8e 100644 --- a/sycl/doc/EnvironmentVariables.md +++ b/sycl/doc/EnvironmentVariables.md @@ -210,7 +210,7 @@ variables in production code. | `SYCL_USE_KERNEL_SPV` | Path to the SPIR-V binary | Load device image from the specified file. If runtime is unable to read the file, `sycl::runtime_error` exception is thrown. The image is assumed to have been created using the `-fno-sycl-dead-args-optimization` option. | | `SYCL_DUMP_IMAGES` | Any(\*) | Dump device image binaries to file. Control has no effect if `SYCL_USE_KERNEL_SPV` is set. | | `SYCL_HOST_UNIFIED_MEMORY` | Integer | Enforce host unified memory support or lack of it for the execution graph builder. If set to 0, it is enforced as not supported by all devices. If set to 1, it is enforced as supported by all devices. | -| `SYCL_CACHE_TRACE` | Described [below](#sycl_cache_trace-options) | Enable tracing for different SYCL and `kernel_compiler` caches. | +| `SYCL_CACHE_TRACE` | Described [below](#sycl_cache_trace-options). | Enable tracing for different SYCL and `kernel_compiler` caches. | | `SYCL_PARALLEL_FOR_RANGE_ROUNDING_TRACE` | Any(\*) | Enables tracing of `parallel_for` invocations with rounded-up ranges. | | `SYCL_PI_SUPPRESS_ERROR_MESSAGE` | Any(\*) | Suppress printing of error message, only used for CI in order not to interrupt errors generated by underlying toolchains; note that the variable only modifies the printing of the error message (error value, name, description and location), the handling of error return code and aborting/throwing behaviour remains unchanged. | | `SYCL_JIT_COMPILER_DEBUG` | Any(\*) | Passes can specify their own debug types, `sycl-spec-const-materializer` enables debug output generation in specialization constants materialization pass. | @@ -254,7 +254,7 @@ Supported tracing levels are in the table below | 0x02 | Enable tracing of in-memory cache | | 0x04 | Enable tracing of `kernel_compiler` cache | -Any valid combination of the above bit-masks can be used to enable/disable tracing of the corresponding caches. If the input value is not null and not a valid number, the disk cache tracing will be enabled (depreciated behavior). +Any valid combination of the above bit-masks can be used to enable/disable tracing of the corresponding caches. If the input value is not 0 and not a valid number, the disk cache tracing will be enabled (deprecated behavior). The default value is 0 and no tracing is enabled. ## Debugging variables for Level Zero Plugin