Skip to content

Commit 2741010

Browse files
authored
[ESIMD] Disable non-critical messages from VC backend (disable-finalizer-msg) (#4918)
1. Add doc for the existing environment variable SYCL_RT_WARNING_LEVEL. 2. Add -disable-finalizer-msg to vc-codegen to disable warnings/hints from vc-codegen about spilling some registers to memory, which are performance hints and often not wanted in std output by default. Signed-off-by: Vyacheslav N Klochkov <[email protected]>
1 parent ec74a5c commit 2741010

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

sycl/doc/EnvironmentVariables.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ compiler and runtime.
2121
| `SYCL_CACHE_MIN_DEVICE_IMAGE_SIZE` | Positive integer | Minimum size of device code image in bytes which is reasonable to cache on disk because disk access operation may take more time than do JIT compilation for it. Default value is 0 to cache all images. |
2222
| `SYCL_CACHE_MAX_DEVICE_IMAGE_SIZE` | Positive integer | Maximum size of device image in bytes which is cached. Too big kernels may overload disk too fast. Default value is 1 GB. |
2323
| `SYCL_ENABLE_DEFAULT_CONTEXTS` | '1' or '0' | Enable ('1') or disable ('0') creation of default platform contexts in SYCL runtime. The default context for each platform contains all devices in the platform. Refer to [Platform Default Contexts](extensions/supported/sycl_ext_oneapi_default_context.asciidoc) extension to learn more. Enabled by default on Linux and disabled on Windows. |
24+
| `SYCL_RT_WARNING_LEVEL` | Positive integer | The higher warning level is used the more warnings and performance hints the runtime library may print. Default value is '0', which means no warning/hint messages from the runtime library are allowed. The value '1' enables performance warnings from device runtime/codegen. The values greater than 1 are reserved for future use. |
2425
| `SYCL_USM_HOSTPTR_IMPORT` | Integer | Enable by specifying non-zero value. Buffers created with a host pointer will result in host data promotion to USM, improving data transfer performance. To use this feature, also set SYCL_HOST_UNIFIED_MEMORY=1. |
2526

2627
`(*) Note: Any means this environment variable is effective when set to any non-null value.`

sycl/source/detail/program_manager/program_manager.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,10 @@ static void appendCompileOptionsFromImage(std::string &CompileOpts,
403403
if (!CompileOpts.empty())
404404
CompileOpts += " ";
405405
CompileOpts += "-vc-codegen";
406+
// Allow warning and performance hints from vc/finalizer if the RT warning
407+
// level is at least 1.
408+
if (detail::SYCLConfig<detail::SYCL_RT_WARNING_LEVEL>::get() == 0)
409+
CompileOpts += " -disable-finalizer-msg";
406410
}
407411
}
408412

sycl/unittests/misc/KernelBuildOptions.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -243,15 +243,14 @@ TEST(KernelBuildOptions, KernelBundleBasic) {
243243
sycl::kernel_bundle KernelBundle =
244244
sycl::get_kernel_bundle<sycl::bundle_state::input>(Ctx, {Dev});
245245
auto ExecBundle = sycl::build(KernelBundle);
246-
EXPECT_EQ(BuildOpts, "-compile-img -vc-codegen -link-img");
246+
EXPECT_EQ(BuildOpts,
247+
"-compile-img -vc-codegen -disable-finalizer-msg -link-img");
247248

248249
auto ObjBundle = sycl::compile(KernelBundle, KernelBundle.get_devices());
249-
// TODO: uncomment when image options are passed to BE
250-
// EXPECT_EQ(BuildOpts, "-compile-img -vc-codegen");
250+
EXPECT_EQ(BuildOpts, "-compile-img -vc-codegen -disable-finalizer-msg");
251251

252252
auto LinkBundle = sycl::link(ObjBundle, ObjBundle.get_devices());
253-
// TODO: uncomment when image options are passed to BE
254-
// EXPECT_EQ(BuildOpts, "-link-img -vc-codegen");
253+
EXPECT_EQ(BuildOpts, "-link-img");
255254
}
256255

257256
TEST(KernelBuildOptions, Program) {

0 commit comments

Comments
 (0)