Skip to content

Commit 6660ece

Browse files
committed
Fix 2025.0 build errors and warnings
1 parent 50a579b commit 6660ece

File tree

16 files changed

+63
-70
lines changed

16 files changed

+63
-70
lines changed

Publications/GPU-Opt-Guide/OpenMP/22_mkl_dispatch/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
include_directories(common)
22

3-
add_example_with_mkl(dgemm_target_variant_dispatch_c)
43
add_example_with_mkl(dgemm_dispatch_c)
54
add_example_with_mkl(dgemm_example_01)
65
add_example_with_mkl(dgemm_example_02)

Publications/GPU-Opt-Guide/sub-group/sg-max-size.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <random>
1111
#include <vector>
1212

13-
#include <CL/sycl.hpp>
13+
#include <sycl/sycl.hpp>
1414

1515
constexpr int N = 7;
1616

Publications/GPU-Opt-Guide/sub-group/sub-group-0.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
//
44
// SPDX-License-Identifier: MIT
55
// =============================================================
6-
#include <CL/sycl.hpp>
76
#include <iostream>
7+
#include <sycl/sycl.hpp>
88

99
int main() {
1010
sycl::queue q{sycl::gpu_selector_v};

Publications/GPU-Opt-Guide/sub-group/sub-group-1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
//
44
// SPDX-License-Identifier: MIT
55
// =============================================================
6-
#include <CL/sycl.hpp>
76
#include <iostream>
7+
#include <sycl/sycl.hpp>
88

99
int main() {
1010
sycl::queue q{sycl::gpu_selector_v};

Publications/GPU-Opt-Guide/sub-group/sub-group-2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
//
44
// SPDX-License-Identifier: MIT
55
// =============================================================
6-
#include <CL/sycl.hpp>
76
#include <iostream>
7+
#include <sycl/sycl.hpp>
88

99
int main() {
1010
sycl::queue q{sycl::gpu_selector_v,

Publications/GPU-Opt-Guide/sub-group/sub-group-3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
//
44
// SPDX-License-Identifier: MIT
55
// =============================================================
6-
#include <CL/sycl.hpp>
76
#include <iostream>
7+
#include <sycl/sycl.hpp>
88

99
int main() {
1010
sycl::queue q{sycl::gpu_selector_v,

Publications/GPU-Opt-Guide/sub-group/sub-group-4.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
//
44
// SPDX-License-Identifier: MIT
55
// =============================================================
6-
#include <CL/sycl.hpp>
76
#include <iostream>
7+
#include <sycl/sycl.hpp>
88

99
int main() {
1010
sycl::queue q{sycl::gpu_selector_v,

Publications/GPU-Opt-Guide/sub-group/sub-group-5.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
//
44
// SPDX-License-Identifier: MIT
55
// =============================================================
6-
#include <CL/sycl.hpp>
76
#include <iostream>
7+
#include <sycl/sycl.hpp>
88

99
int main() {
1010
sycl::queue q{sycl::gpu_selector_v,

Publications/GPU-Opt-Guide/sub-group/sub-group-6.cpp

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,17 @@
33
//
44
// SPDX-License-Identifier: MIT
55
// =============================================================
6-
#include <CL/sycl.hpp>
76
#include <iostream>
7+
#include <sycl/sycl.hpp>
88

9-
template <typename T>
10-
auto get_multi_ptr(T *raw_ptr) {
9+
template <typename T> auto get_multi_ptr(T *raw_ptr) {
1110
auto multi_ptr =
12-
sycl::address_space_cast<
13-
sycl::access::address_space::global_space,
14-
sycl::access::decorated::yes>(raw_ptr);
11+
sycl::address_space_cast<sycl::access::address_space::global_space,
12+
sycl::access::decorated::yes>(raw_ptr);
1513

1614
return multi_ptr;
1715
}
1816

19-
2017
int main() {
2118
sycl::queue q{sycl::gpu_selector_v,
2219
sycl::property::queue::enable_profiling{}};
@@ -30,21 +27,21 @@ int main() {
3027
memset(data2, 0xFF, sizeof(int) * N);
3128

3229
auto e = q.submit([&](auto &h) {
33-
h.parallel_for(
34-
sycl::nd_range(sycl::range{N / 16}, sycl::range{32}),
35-
[=](sycl::nd_item<1> it) [[intel::reqd_sub_group_size(16)]] {
36-
auto sg = it.get_sub_group();
37-
sycl::vec<int, 8> x;
38-
39-
int base = (it.get_group(0) * 32 +
40-
sg.get_group_id()[0] * sg.get_local_range()[0]) *
41-
16;
42-
43-
x = sg.load<8>(get_multi_ptr(&(data2[base + 0])));
44-
sg.store<8>(get_multi_ptr(&(data[base + 0])), x);
45-
x = sg.load<8>(get_multi_ptr(&(data2[base + 128])));
46-
sg.store<8>(get_multi_ptr(&(data[base + 128])), x);
47-
});
30+
h.parallel_for(sycl::nd_range(sycl::range{N / 16}, sycl::range{32}),
31+
[=](sycl::nd_item<1> it) [[intel::reqd_sub_group_size(16)]] {
32+
auto sg = it.get_sub_group();
33+
sycl::vec<int, 8> x;
34+
35+
int base =
36+
(it.get_group(0) * 32 +
37+
sg.get_group_id()[0] * sg.get_local_range()[0]) *
38+
16;
39+
40+
x = sg.load<8>(get_multi_ptr(&(data2[base + 0])));
41+
sg.store<8>(get_multi_ptr(&(data[base + 0])), x);
42+
x = sg.load<8>(get_multi_ptr(&(data2[base + 128])));
43+
sg.store<8>(get_multi_ptr(&(data[base + 128])), x);
44+
});
4845
});
4946
// Snippet end
5047
q.wait();

Publications/GPU-Opt-Guide/sub-group/sub-group-7.cpp

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
//
44
// SPDX-License-Identifier: MIT
55
// =============================================================
6-
#include <CL/sycl.hpp>
76
#include <iostream>
7+
#include <sycl/sycl.hpp>
88

9-
template <typename T>
10-
auto get_multi_ptr(T *raw_ptr) {
9+
template <typename T> auto get_multi_ptr(T *raw_ptr) {
1110
auto multi_ptr =
12-
sycl::address_space_cast<
13-
sycl::access::address_space::global_space,
14-
sycl::access::decorated::yes>(raw_ptr);
11+
sycl::address_space_cast<sycl::access::address_space::global_space,
12+
sycl::access::decorated::yes>(raw_ptr);
1513
return multi_ptr;
1614
}
1715

@@ -28,41 +26,40 @@ int main() {
2826
memset(data2, 0, sizeof(int) * N);
2927

3028
auto e = q.submit([&](auto &h) {
31-
h.parallel_for(
32-
sycl::nd_range(sycl::range{N / 16}, sycl::range{32}),
33-
[=](sycl::nd_item<1> it) [[intel::reqd_sub_group_size(16)]] {
34-
auto sg = it.get_sub_group();
35-
sycl::vec<int, 4> x;
29+
h.parallel_for(sycl::nd_range(sycl::range{N / 16}, sycl::range{32}),
30+
[=](sycl::nd_item<1> it) [[intel::reqd_sub_group_size(16)]] {
31+
auto sg = it.get_sub_group();
32+
sycl::vec<int, 4> x;
3633

37-
int base = (it.get_group(0) * 32 +
38-
sg.get_group_id()[0] * sg.get_local_range()[0]) *
39-
16;
34+
int base =
35+
(it.get_group(0) * 32 +
36+
sg.get_group_id()[0] * sg.get_local_range()[0]) *
37+
16;
4038

41-
auto load_ptr0 = get_multi_ptr(&(data2[base + 0*64]));
42-
x = sg.load<4>(load_ptr0);
39+
auto load_ptr0 = get_multi_ptr(&(data2[base + 0 * 64]));
40+
x = sg.load<4>(load_ptr0);
4341

44-
auto store_ptr0 = get_multi_ptr(&(data[base + 0*64]));
45-
sg.store<4>(store_ptr0, x);
42+
auto store_ptr0 = get_multi_ptr(&(data[base + 0 * 64]));
43+
sg.store<4>(store_ptr0, x);
4644

47-
auto load_ptr1 = get_multi_ptr(&(data2[base + 1*64]));
48-
x = sg.load<4>(load_ptr1);
45+
auto load_ptr1 = get_multi_ptr(&(data2[base + 1 * 64]));
46+
x = sg.load<4>(load_ptr1);
4947

50-
auto store_ptr1 = get_multi_ptr(&(data[base + 1*64]));
51-
sg.store<4>(store_ptr1, x);
48+
auto store_ptr1 = get_multi_ptr(&(data[base + 1 * 64]));
49+
sg.store<4>(store_ptr1, x);
5250

53-
auto load_ptr2 = get_multi_ptr(&(data2[base + 2*64]));
54-
x = sg.load<4>(load_ptr2);
51+
auto load_ptr2 = get_multi_ptr(&(data2[base + 2 * 64]));
52+
x = sg.load<4>(load_ptr2);
5553

56-
auto store_ptr2 = get_multi_ptr(&(data[base + 2*64]));
57-
sg.store<4>(store_ptr2, x);
54+
auto store_ptr2 = get_multi_ptr(&(data[base + 2 * 64]));
55+
sg.store<4>(store_ptr2, x);
5856

59-
auto load_ptr3 = get_multi_ptr(&(data2[base + 3*64]));
60-
x = sg.load<4>(load_ptr3);
57+
auto load_ptr3 = get_multi_ptr(&(data2[base + 3 * 64]));
58+
x = sg.load<4>(load_ptr3);
6159

62-
auto store_ptr3 = get_multi_ptr(&(data[base + 3*64]));
63-
sg.store<4>(store_ptr3, x);
64-
65-
});
60+
auto store_ptr3 = get_multi_ptr(&(data[base + 3 * 64]));
61+
sg.store<4>(store_ptr3, x);
62+
});
6663
});
6764
// Snippet end
6865
q.wait();

0 commit comments

Comments
 (0)