Commit e185f88
Fix SYCL/ICX warnings in tutorial SYCL device code
Three classes of warning fixed, all from the ICX SYCL device compiler:
1. [-Wundefined-internal] sycl::detail::get_spec_constant_symbolic_ID
has internal linkage but is not defined.
'const' variables at C++ namespace scope have *internal* linkage by
default (same as 'static const'). The SYCL compiler generates a
per-variable helper function with matching linkage; when that linkage
is internal the function has no definition visible to the SYCL
runtime and the warning fires.
Fix: declare all sycl::specialization_id objects as 'inline const'.
C++17 inline variables have external linkage, so the compiler emits
one uniquely-identifiable definition. viewer_device_debug.cpp
re-declares the same spec_feature_mask as inline const; the ODR
rule merges it with viewer_device.cpp's definition at link time.
Files changed: viewer_device.cpp, viewer_device_debug.cpp,
next_hit_device.cpp, pathtracer_device.cpp
2. [-Wuninitialized-const-pointer] imgui_widgets.cpp: 'empty_string'
passed as a const-pointer before being initialised.
Fix: zero-initialise the STB_TEXTEDIT_CHARTYPE variable at the point
of declaration.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 6ed84e4 commit e185f88
5 files changed
Lines changed: 5 additions & 5 deletions
File tree
- tutorials
- common/imgui
- next_hit
- pathtracer
- viewer
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4439 | 4439 | | |
4440 | 4440 | | |
4441 | 4441 | | |
4442 | | - | |
| 4442 | + | |
4443 | 4443 | | |
4444 | 4444 | | |
4445 | 4445 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
0 commit comments