From d8adfa4511705bbf2307178fcd718783858bb0b8 Mon Sep 17 00:00:00 2001 From: Maxime France-Pillois Date: Wed, 27 Sep 2023 12:02:50 +0100 Subject: [PATCH] [SYCL][Graph] Changes parentheses for braces in e2e tests for Sycl objects (#327) Makes all Sycl objects use braces instead of parentheses when calling constructor. This is safer for multi-platform software since braces prevent for type narrowing. --- .../Graph/Inputs/add_nodes_after_finalize.cpp | 4 +-- sycl/test-e2e/Graph/Inputs/buffer_copy.cpp | 6 ++-- sycl/test-e2e/Graph/Inputs/buffer_copy_2d.cpp | 12 +++---- .../Graph/Inputs/buffer_copy_host2target.cpp | 2 +- .../Inputs/buffer_copy_host2target_2d.cpp | 2 +- .../Inputs/buffer_copy_host2target_offset.cpp | 6 ++-- .../Graph/Inputs/buffer_copy_offsets.cpp | 4 +-- .../Graph/Inputs/buffer_copy_target2host.cpp | 2 +- .../Inputs/buffer_copy_target2host_2d.cpp | 2 +- .../Inputs/buffer_copy_target2host_offset.cpp | 4 +-- sycl/test-e2e/Graph/Inputs/buffer_fill.cpp | 10 +++--- .../Graph/Inputs/dotp_buffer_reduction.cpp | 8 ++--- .../Graph/Inputs/event_status_querying.cpp | 6 ++-- sycl/test-e2e/Graph/Inputs/host_task.cpp | 4 +-- sycl/test-e2e/Graph/Inputs/stream.cpp | 2 +- sycl/test-e2e/Graph/Inputs/sub_graph.cpp | 8 ++--- sycl/test-e2e/Graph/Inputs/usm_copy.cpp | 6 ++-- sycl/test-e2e/Graph/Inputs/usm_fill.cpp | 2 +- sycl/test-e2e/Graph/Inputs/usm_fill_host.cpp | 2 +- .../test-e2e/Graph/Inputs/usm_fill_shared.cpp | 2 +- sycl/test-e2e/Graph/graph_common.hpp | 32 +++++++++---------- 21 files changed, 63 insertions(+), 63 deletions(-) diff --git a/sycl/test-e2e/Graph/Inputs/add_nodes_after_finalize.cpp b/sycl/test-e2e/Graph/Inputs/add_nodes_after_finalize.cpp index 68e1712409281..bd8d039ab2623 100644 --- a/sycl/test-e2e/Graph/Inputs/add_nodes_after_finalize.cpp +++ b/sycl/test-e2e/Graph/Inputs/add_nodes_after_finalize.cpp @@ -40,7 +40,7 @@ int main() { Queue.wait_and_throw(); auto NodeA = add_node(Graph, Queue, [&](handler &CGH) { - CGH.parallel_for(range<1>(Size), + CGH.parallel_for(range<1>{Size}, [=](item<1> id) { PtrC[id] += PtrA[id] + PtrB[id]; }); }); @@ -50,7 +50,7 @@ int main() { Graph, Queue, [&](handler &CGH) { depends_on_helper(CGH, NodeA); - CGH.parallel_for(range<1>(Size), + CGH.parallel_for(range<1>{Size}, [=](item<1> id) { PtrOut[id] += PtrC[id] + 1; }); }, NodeA); diff --git a/sycl/test-e2e/Graph/Inputs/buffer_copy.cpp b/sycl/test-e2e/Graph/Inputs/buffer_copy.cpp index 3430cc8cf9124..443787d651e18 100644 --- a/sycl/test-e2e/Graph/Inputs/buffer_copy.cpp +++ b/sycl/test-e2e/Graph/Inputs/buffer_copy.cpp @@ -51,7 +51,7 @@ int main() { Graph, Queue, [&](handler &CGH) { auto AccA = BufferA.get_access(CGH); - CGH.parallel_for(range<1>(Size), [=](item<1> id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> id) { auto LinID = id.get_linear_id(); AccA[LinID] += ModValue; }); @@ -63,7 +63,7 @@ int main() { Graph, Queue, [&](handler &CGH) { auto AccB = BufferB.get_access(CGH); - CGH.parallel_for(range<1>(Size), [=](item<1> id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> id) { auto LinID = id.get_linear_id(); AccB[LinID] += ModValue; }); @@ -85,7 +85,7 @@ int main() { Graph, Queue, [&](handler &CGH) { auto AccB = BufferB.get_access(CGH); - CGH.parallel_for(range<1>(Size), [=](item<1> id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> id) { auto LinID = id.get_linear_id(); AccB[LinID] += ModValue; }); diff --git a/sycl/test-e2e/Graph/Inputs/buffer_copy_2d.cpp b/sycl/test-e2e/Graph/Inputs/buffer_copy_2d.cpp index 2b2020d68faf9..591b556d23ca6 100644 --- a/sycl/test-e2e/Graph/Inputs/buffer_copy_2d.cpp +++ b/sycl/test-e2e/Graph/Inputs/buffer_copy_2d.cpp @@ -28,11 +28,11 @@ int main() { } // Make the buffers 2D so we can test the rect copy path - buffer BufferA{DataA.data(), range<2>(Size, Size)}; + buffer BufferA{DataA.data(), range<2>{Size, Size}}; BufferA.set_write_back(false); - buffer BufferB{DataB.data(), range<2>(Size, Size)}; + buffer BufferB{DataB.data(), range<2>{Size, Size}}; BufferB.set_write_back(false); - buffer BufferC{DataC.data(), range<2>(Size, Size)}; + buffer BufferC{DataC.data(), range<2>{Size, Size}}; BufferC.set_write_back(false); { exp_ext::command_graph Graph{ @@ -52,7 +52,7 @@ int main() { Graph, Queue, [&](handler &CGH) { auto AccA = BufferA.get_access(CGH); - CGH.parallel_for(range<2>(Size, Size), + CGH.parallel_for(range<2>{Size, Size}, [=](item<2> id) { AccA[id] += ModValue; }); }, NodeA); @@ -62,7 +62,7 @@ int main() { Graph, Queue, [&](handler &CGH) { auto AccB = BufferB.get_access(CGH); - CGH.parallel_for(range<2>(Size, Size), + CGH.parallel_for(range<2>{Size, Size}, [=](item<2> id) { AccB[id] += ModValue; }); }, NodeA); @@ -82,7 +82,7 @@ int main() { Graph, Queue, [&](handler &CGH) { auto AccB = BufferB.get_access(CGH); - CGH.parallel_for(range<2>(Size, Size), + CGH.parallel_for(range<2>{Size, Size}, [=](item<2> id) { AccB[id] += ModValue; }); }, NodeC); diff --git a/sycl/test-e2e/Graph/Inputs/buffer_copy_host2target.cpp b/sycl/test-e2e/Graph/Inputs/buffer_copy_host2target.cpp index 5bbf0cd472f93..d024a8d58d631 100644 --- a/sycl/test-e2e/Graph/Inputs/buffer_copy_host2target.cpp +++ b/sycl/test-e2e/Graph/Inputs/buffer_copy_host2target.cpp @@ -17,7 +17,7 @@ int main() { ReferenceA[i] = DataB[i]; } - buffer BufferA(DataA.data(), range<1>(Size)); + buffer BufferA{DataA.data(), range<1>{Size}}; BufferA.set_write_back(false); { diff --git a/sycl/test-e2e/Graph/Inputs/buffer_copy_host2target_2d.cpp b/sycl/test-e2e/Graph/Inputs/buffer_copy_host2target_2d.cpp index 63127ed672f3c..e2b45af524319 100644 --- a/sycl/test-e2e/Graph/Inputs/buffer_copy_host2target_2d.cpp +++ b/sycl/test-e2e/Graph/Inputs/buffer_copy_host2target_2d.cpp @@ -18,7 +18,7 @@ int main() { } // Make the buffers 2D so we can test the rect write path - buffer BufferA{DataA.data(), range<2>(Size, Size)}; + buffer BufferA{DataA.data(), range<2>{Size, Size}}; BufferA.set_write_back(false); { diff --git a/sycl/test-e2e/Graph/Inputs/buffer_copy_host2target_offset.cpp b/sycl/test-e2e/Graph/Inputs/buffer_copy_host2target_offset.cpp index cb3c96da84ea9..7154fd71b2d39 100644 --- a/sycl/test-e2e/Graph/Inputs/buffer_copy_host2target_offset.cpp +++ b/sycl/test-e2e/Graph/Inputs/buffer_copy_host2target_offset.cpp @@ -20,7 +20,7 @@ int main() { ReferenceA[i] = DataB[i - Offset]; } - buffer BufferA(DataA.data(), range<1>(Size + Offset)); + buffer BufferA{DataA.data(), range<1>{Size + Offset}}; BufferA.set_write_back(false); { @@ -30,8 +30,8 @@ int main() { {exp_ext::property::graph::assume_buffer_outlives_graph{}}}; auto NodeA = add_node(Graph, Queue, [&](handler &CGH) { - auto AccA = BufferA.get_access(CGH, range<1>(Size), - id<1>(Offset)); + auto AccA = BufferA.get_access(CGH, range<1>{Size}, + id<1>{Offset}); CGH.copy(DataB.data(), AccA); }); diff --git a/sycl/test-e2e/Graph/Inputs/buffer_copy_offsets.cpp b/sycl/test-e2e/Graph/Inputs/buffer_copy_offsets.cpp index 6cd96097830ec..5c67798acdf3d 100644 --- a/sycl/test-e2e/Graph/Inputs/buffer_copy_offsets.cpp +++ b/sycl/test-e2e/Graph/Inputs/buffer_copy_offsets.cpp @@ -39,9 +39,9 @@ int main() { // Copy from A to B auto NodeA = add_node(Graph, Queue, [&](handler &CGH) { auto AccA = BufferA.get_access( - CGH, range<1>(Size - OffsetSrc), id<1>(OffsetSrc)); + CGH, range<1>{Size - OffsetSrc}, id<1>{OffsetSrc}); auto AccB = BufferB.get_access( - CGH, range<1>(Size - OffsetDst), id<1>(OffsetDst)); + CGH, range<1>{Size - OffsetDst}, id<1>{OffsetDst}); CGH.copy(AccA, AccB); }); diff --git a/sycl/test-e2e/Graph/Inputs/buffer_copy_target2host.cpp b/sycl/test-e2e/Graph/Inputs/buffer_copy_target2host.cpp index 5d906ad7d0ae3..aaf5a233c5d0b 100644 --- a/sycl/test-e2e/Graph/Inputs/buffer_copy_target2host.cpp +++ b/sycl/test-e2e/Graph/Inputs/buffer_copy_target2host.cpp @@ -18,7 +18,7 @@ int main() { ReferenceB[i] = DataA[i]; } - buffer BufferA(DataA.data(), range<1>(Size)); + buffer BufferA{DataA.data(), range<1>{Size}}; BufferA.set_write_back(false); { diff --git a/sycl/test-e2e/Graph/Inputs/buffer_copy_target2host_2d.cpp b/sycl/test-e2e/Graph/Inputs/buffer_copy_target2host_2d.cpp index 6a36fac81711b..6781c201404cd 100644 --- a/sycl/test-e2e/Graph/Inputs/buffer_copy_target2host_2d.cpp +++ b/sycl/test-e2e/Graph/Inputs/buffer_copy_target2host_2d.cpp @@ -19,7 +19,7 @@ int main() { } // Make the buffers 2D so we can test the rect read path - buffer BufferA{DataA.data(), range<2>(Size, Size)}; + buffer BufferA{DataA.data(), range<2>{Size, Size}}; BufferA.set_write_back(false); { diff --git a/sycl/test-e2e/Graph/Inputs/buffer_copy_target2host_offset.cpp b/sycl/test-e2e/Graph/Inputs/buffer_copy_target2host_offset.cpp index 3f0880a318cf5..ca779a5c82079 100644 --- a/sycl/test-e2e/Graph/Inputs/buffer_copy_target2host_offset.cpp +++ b/sycl/test-e2e/Graph/Inputs/buffer_copy_target2host_offset.cpp @@ -21,7 +21,7 @@ int main() { ReferenceB[i] = DataB[i]; } - buffer BufferA(DataA.data(), range<1>(Size)); + buffer BufferA{DataA.data(), range<1>{Size}}; BufferA.set_write_back(false); { @@ -32,7 +32,7 @@ int main() { auto NodeA = add_node(Graph, Queue, [&](handler &CGH) { auto AccA = BufferA.get_access( - CGH, range<1>(Size - Offset), id<1>(Offset)); + CGH, range<1>{Size - Offset}, id<1>{Offset}); CGH.copy(AccA, DataB.data()); }); diff --git a/sycl/test-e2e/Graph/Inputs/buffer_fill.cpp b/sycl/test-e2e/Graph/Inputs/buffer_fill.cpp index 002afb003fe30..fb0254b29fc64 100644 --- a/sycl/test-e2e/Graph/Inputs/buffer_fill.cpp +++ b/sycl/test-e2e/Graph/Inputs/buffer_fill.cpp @@ -8,23 +8,23 @@ int main() { const size_t N = 10; const float Pattern = 3.14f; std::vector Data(N); - buffer Buffer(Data); + buffer Buffer{Data}; const uint64_t PatternI64 = 0x3333333355555555; std::vector DataI64(N); - buffer BufferI64(DataI64); + buffer BufferI64{DataI64}; const uint32_t PatternI32 = 888; std::vector DataI32(N); - buffer BufferI32(DataI32); + buffer BufferI32{DataI32}; const uint16_t PatternI16 = 777; std::vector DataI16(N); - buffer BufferI16(DataI16); + buffer BufferI16{DataI16}; const uint8_t PatternI8 = 33; std::vector DataI8(N); - buffer BufferI8(DataI8); + buffer BufferI8{DataI8}; Buffer.set_write_back(false); BufferI64.set_write_back(false); diff --git a/sycl/test-e2e/Graph/Inputs/dotp_buffer_reduction.cpp b/sycl/test-e2e/Graph/Inputs/dotp_buffer_reduction.cpp index a3a3f7a57ad22..02762d798c8ca 100644 --- a/sycl/test-e2e/Graph/Inputs/dotp_buffer_reduction.cpp +++ b/sycl/test-e2e/Graph/Inputs/dotp_buffer_reduction.cpp @@ -13,14 +13,14 @@ int main() { std::vector YData(N); std::vector ZData(N); - buffer DotpBuf(&DotpData, range<1>(1)); + buffer DotpBuf(&DotpData, range<1>{1}); DotpBuf.set_write_back(false); - buffer XBuf(XData); + buffer XBuf{XData}; XBuf.set_write_back(false); - buffer YBuf(YData); + buffer YBuf{YData}; YBuf.set_write_back(false); - buffer ZBuf(ZData); + buffer ZBuf{ZData}; ZBuf.set_write_back(false); { exp_ext::command_graph Graph{ diff --git a/sycl/test-e2e/Graph/Inputs/event_status_querying.cpp b/sycl/test-e2e/Graph/Inputs/event_status_querying.cpp index 1e2bb02577955..daf960c453065 100644 --- a/sycl/test-e2e/Graph/Inputs/event_status_querying.cpp +++ b/sycl/test-e2e/Graph/Inputs/event_status_querying.cpp @@ -78,7 +78,7 @@ int main() { // Read & write A auto Node1 = add_node(Graph, Queue, [&](handler &CGH) { auto AccA = BufferA.get_access(CGH); - CGH.parallel_for(range<1>(Size), [=](item<1> id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> id) { auto LinID = id.get_linear_id(); AccA[LinID] += ModValue; }); @@ -87,7 +87,7 @@ int main() { // Read & write B auto Node2 = add_node(Graph, Queue, [&](handler &CGH) { auto AccB = BufferB.get_access(CGH); - CGH.parallel_for(range<1>(Size), [=](item<1> id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> id) { auto LinID = id.get_linear_id(); AccB[LinID] += ModValue; }); @@ -103,7 +103,7 @@ int main() { // Read and write B auto Node4 = add_node(Graph, Queue, [&](handler &CGH) { auto AccB = BufferB.get_access(CGH); - CGH.parallel_for(range<1>(Size), [=](item<1> id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> id) { auto LinID = id.get_linear_id(); AccB[LinID] += ModValue; }); diff --git a/sycl/test-e2e/Graph/Inputs/host_task.cpp b/sycl/test-e2e/Graph/Inputs/host_task.cpp index 89cc03e1de3b0..b4bece3004838 100644 --- a/sycl/test-e2e/Graph/Inputs/host_task.cpp +++ b/sycl/test-e2e/Graph/Inputs/host_task.cpp @@ -38,7 +38,7 @@ int main() { // Vector add to output auto NodeA = add_node(Graph, Queue, [&](handler &CGH) { - CGH.parallel_for(range<1>(Size), + CGH.parallel_for(range<1>{Size}, [=](item<1> id) { PtrC[id] += PtrA[id] + PtrB[id]; }); }); @@ -60,7 +60,7 @@ int main() { Graph, Queue, [&](handler &CGH) { depends_on_helper(CGH, NodeB); - CGH.parallel_for(range<1>(Size), [=](item<1> id) { PtrC[id] += 1; }); + CGH.parallel_for(range<1>{Size}, [=](item<1> id) { PtrC[id] += 1; }); }, NodeB); diff --git a/sycl/test-e2e/Graph/Inputs/stream.cpp b/sycl/test-e2e/Graph/Inputs/stream.cpp index edf27513c2684..61f8ba1467189 100644 --- a/sycl/test-e2e/Graph/Inputs/stream.cpp +++ b/sycl/test-e2e/Graph/Inputs/stream.cpp @@ -20,7 +20,7 @@ int main() { add_node(Graph, Queue, [&](handler &CGH) { sycl::stream Out(WorkItems * 16, 16, CGH); - CGH.parallel_for(range<1>(WorkItems), [=](item<1> id) { + CGH.parallel_for(range<1>{WorkItems}, [=](item<1> id) { Out << "Val: " << PtrIn[id.get_linear_id()] << sycl::endl; }); }); diff --git a/sycl/test-e2e/Graph/Inputs/sub_graph.cpp b/sycl/test-e2e/Graph/Inputs/sub_graph.cpp index 203bb41544fa2..e4aed517155bd 100644 --- a/sycl/test-e2e/Graph/Inputs/sub_graph.cpp +++ b/sycl/test-e2e/Graph/Inputs/sub_graph.cpp @@ -50,7 +50,7 @@ int main() { // Vector add two values auto NodeSubA = add_node(SubGraph, Queue, [&](handler &CGH) { - CGH.parallel_for(range<1>(Size), + CGH.parallel_for(range<1>{Size}, [=](item<1> id) { PtrC[id] = PtrA[id] + PtrB[id]; }); }); @@ -59,7 +59,7 @@ int main() { SubGraph, Queue, [&](handler &CGH) { depends_on_helper(CGH, NodeSubA); - CGH.parallel_for(range<1>(Size), + CGH.parallel_for(range<1>{Size}, [=](item<1> id) { PtrC[id] -= ModValue; }); }, NodeSubA); @@ -70,7 +70,7 @@ int main() { // Modify the input values. auto NodeMainA = add_node(MainGraph, Queue, [&](handler &CGH) { - CGH.parallel_for(range<1>(Size), [=](item<1> id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> id) { PtrA[id] += ModValue; PtrB[id] += ModValue; }); @@ -89,7 +89,7 @@ int main() { MainGraph, Queue, [&](handler &CGH) { depends_on_helper(CGH, NodeMainB); - CGH.parallel_for(range<1>(Size), + CGH.parallel_for(range<1>{Size}, [=](item<1> id) { PtrOut[id] = PtrC[id] + ModValue; }); }, NodeMainB); diff --git a/sycl/test-e2e/Graph/Inputs/usm_copy.cpp b/sycl/test-e2e/Graph/Inputs/usm_copy.cpp index 640565364cc52..b6a20b6e8f6e9 100644 --- a/sycl/test-e2e/Graph/Inputs/usm_copy.cpp +++ b/sycl/test-e2e/Graph/Inputs/usm_copy.cpp @@ -46,7 +46,7 @@ int main() { Graph, Queue, [&](handler &CGH) { depends_on_helper(CGH, NodeA); - CGH.parallel_for(range<1>(Size), [=](item<1> id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> id) { auto LinID = id.get_linear_id(); PtrA[LinID] += ModValue; }); @@ -58,7 +58,7 @@ int main() { Graph, Queue, [&](handler &CGH) { depends_on_helper(CGH, NodeA); - CGH.parallel_for(range<1>(Size), [=](item<1> id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> id) { auto LinID = id.get_linear_id(); PtrB[LinID] += ModValue; }); @@ -79,7 +79,7 @@ int main() { Graph, Queue, [&](handler &CGH) { depends_on_helper(CGH, NodeC); - CGH.parallel_for(range<1>(Size), [=](item<1> id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> id) { auto LinID = id.get_linear_id(); PtrB[LinID] += ModValue; }); diff --git a/sycl/test-e2e/Graph/Inputs/usm_fill.cpp b/sycl/test-e2e/Graph/Inputs/usm_fill.cpp index 1cc60faf3e91f..9a7ca7d874adf 100644 --- a/sycl/test-e2e/Graph/Inputs/usm_fill.cpp +++ b/sycl/test-e2e/Graph/Inputs/usm_fill.cpp @@ -11,7 +11,7 @@ int main() { const size_t N = 10; int *Arr = malloc_device(N, Queue); - int Pattern = 3.14f; + int Pattern = 314; auto NodeA = add_node(Graph, Queue, [&](handler &CGH) { CGH.fill(Arr, Pattern, N); }); diff --git a/sycl/test-e2e/Graph/Inputs/usm_fill_host.cpp b/sycl/test-e2e/Graph/Inputs/usm_fill_host.cpp index d5c97c52e5209..764d0c6a09124 100644 --- a/sycl/test-e2e/Graph/Inputs/usm_fill_host.cpp +++ b/sycl/test-e2e/Graph/Inputs/usm_fill_host.cpp @@ -14,7 +14,7 @@ int main() { const size_t N = 10; int *Arr = malloc_host(N, Queue); - int Pattern = 3.14f; + int Pattern = 314; auto NodeA = add_node(Graph, Queue, [&](handler &CGH) { CGH.fill(Arr, Pattern, N); }); diff --git a/sycl/test-e2e/Graph/Inputs/usm_fill_shared.cpp b/sycl/test-e2e/Graph/Inputs/usm_fill_shared.cpp index fa6aaf2290110..681583c47c916 100644 --- a/sycl/test-e2e/Graph/Inputs/usm_fill_shared.cpp +++ b/sycl/test-e2e/Graph/Inputs/usm_fill_shared.cpp @@ -15,7 +15,7 @@ int main() { const size_t N = 10; int *Arr = malloc_shared(N, Queue); - int Pattern = 3.14f; + int Pattern = 314; auto NodeA = add_node(Graph, Queue, [&](handler &CGH) { CGH.fill(Arr, Pattern, N); }); diff --git a/sycl/test-e2e/Graph/graph_common.hpp b/sycl/test-e2e/Graph/graph_common.hpp index 0e96a7bf49a0e..f3a93017000bf 100644 --- a/sycl/test-e2e/Graph/graph_common.hpp +++ b/sycl/test-e2e/Graph/graph_common.hpp @@ -83,7 +83,7 @@ event run_kernels(queue Q, const size_t Size, buffer BufferA, // Read & write Buffer A. Q.submit([&](handler &CGH) { auto DataA = BufferA.template get_access(CGH); - CGH.parallel_for(range<1>(Size), [=](item<1> Id) { DataA[Id]++; }); + CGH.parallel_for(range<1>{Size}, [=](item<1> Id) { DataA[Id]++; }); }); // Reads Buffer A. @@ -91,7 +91,7 @@ event run_kernels(queue Q, const size_t Size, buffer BufferA, Q.submit([&](handler &CGH) { auto DataA = BufferA.template get_access(CGH); auto DataB = BufferB.template get_access(CGH); - CGH.parallel_for(range<1>(Size), + CGH.parallel_for(range<1>{Size}, [=](item<1> Id) { DataB[Id] += DataA[Id]; }); }); @@ -100,7 +100,7 @@ event run_kernels(queue Q, const size_t Size, buffer BufferA, Q.submit([&](handler &CGH) { auto DataA = BufferA.template get_access(CGH); auto DataC = BufferC.template get_access(CGH); - CGH.parallel_for(range<1>(Size), + CGH.parallel_for(range<1>{Size}, [=](item<1> Id) { DataC[Id] -= DataA[Id]; }); }); @@ -108,7 +108,7 @@ event run_kernels(queue Q, const size_t Size, buffer BufferA, auto ExitEvent = Q.submit([&](handler &CGH) { auto DataB = BufferB.template get_access(CGH); auto DataC = BufferC.template get_access(CGH); - CGH.parallel_for(range<1>(Size), [=](item<1> Id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> Id) { DataB[Id]--; DataC[Id]--; }); @@ -134,7 +134,7 @@ add_kernels(exp_ext::command_graph Graph, // Read & write Buffer A Graph.add([&](handler &CGH) { auto DataA = BufferA.template get_access(CGH); - CGH.parallel_for(range<1>(Size), [=](item<1> Id) { DataA[Id]++; }); + CGH.parallel_for(range<1>{Size}, [=](item<1> Id) { DataA[Id]++; }); }); // Reads Buffer A @@ -142,7 +142,7 @@ add_kernels(exp_ext::command_graph Graph, Graph.add([&](handler &CGH) { auto DataA = BufferA.template get_access(CGH); auto DataB = BufferB.template get_access(CGH); - CGH.parallel_for(range<1>(Size), + CGH.parallel_for(range<1>{Size}, [=](item<1> Id) { DataB[Id] += DataA[Id]; }); }); @@ -151,7 +151,7 @@ add_kernels(exp_ext::command_graph Graph, Graph.add([&](handler &CGH) { auto DataA = BufferA.template get_access(CGH); auto DataC = BufferC.template get_access(CGH); - CGH.parallel_for(range<1>(Size), + CGH.parallel_for(range<1>{Size}, [=](item<1> Id) { DataC[Id] -= DataA[Id]; }); }); @@ -159,7 +159,7 @@ add_kernels(exp_ext::command_graph Graph, auto ExitNode = Graph.add([&](handler &CGH) { auto DataB = BufferB.template get_access(CGH); auto DataC = BufferC.template get_access(CGH); - CGH.parallel_for(range<1>(Size), [=](item<1> Id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> Id) { DataB[Id]--; DataC[Id]--; }); @@ -181,7 +181,7 @@ event run_kernels_usm(queue Q, const size_t Size, T *DataA, T *DataB, T *DataC) { // Read & write Buffer A auto EventA = Q.submit([&](handler &CGH) { - CGH.parallel_for(range<1>(Size), [=](item<1> Id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> Id) { auto LinID = Id.get_linear_id(); DataA[LinID]++; }); @@ -191,7 +191,7 @@ event run_kernels_usm(queue Q, const size_t Size, T *DataA, T *DataB, // Read & Write Buffer B auto EventB = Q.submit([&](handler &CGH) { CGH.depends_on(EventA); - CGH.parallel_for(range<1>(Size), [=](item<1> Id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> Id) { auto LinID = Id.get_linear_id(); DataB[LinID] += DataA[LinID]; }); @@ -201,7 +201,7 @@ event run_kernels_usm(queue Q, const size_t Size, T *DataA, T *DataB, // Read & writes Buffer C auto EventC = Q.submit([&](handler &CGH) { CGH.depends_on(EventA); - CGH.parallel_for(range<1>(Size), [=](item<1> Id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> Id) { auto LinID = Id.get_linear_id(); DataC[LinID] -= DataA[LinID]; }); @@ -210,7 +210,7 @@ event run_kernels_usm(queue Q, const size_t Size, T *DataA, T *DataB, // Read & write Buffers B and C auto ExitEvent = Q.submit([&](handler &CGH) { CGH.depends_on({EventB, EventC}); - CGH.parallel_for(range<1>(Size), [=](item<1> Id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> Id) { auto LinID = Id.get_linear_id(); DataB[LinID]--; DataC[LinID]--; @@ -234,7 +234,7 @@ add_kernels_usm(exp_ext::command_graph Graph, const size_t Size, T *DataA, T *DataB, T *DataC) { // Read & write Buffer A auto NodeA = Graph.add([&](handler &CGH) { - CGH.parallel_for(range<1>(Size), [=](item<1> Id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> Id) { auto LinID = Id.get_linear_id(); DataA[LinID]++; }); @@ -244,7 +244,7 @@ add_kernels_usm(exp_ext::command_graph Graph, // Read & Write Buffer B auto NodeB = Graph.add( [&](handler &CGH) { - CGH.parallel_for(range<1>(Size), [=](item<1> Id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> Id) { auto LinID = Id.get_linear_id(); DataB[LinID] += DataA[LinID]; }); @@ -255,7 +255,7 @@ add_kernels_usm(exp_ext::command_graph Graph, // Read & writes Buffer C auto NodeC = Graph.add( [&](handler &CGH) { - CGH.parallel_for(range<1>(Size), [=](item<1> Id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> Id) { auto LinID = Id.get_linear_id(); DataC[LinID] -= DataA[LinID]; }); @@ -265,7 +265,7 @@ add_kernels_usm(exp_ext::command_graph Graph, // Read & write data B and C auto ExitNode = Graph.add( [&](handler &CGH) { - CGH.parallel_for(range<1>(Size), [=](item<1> Id) { + CGH.parallel_for(range<1>{Size}, [=](item<1> Id) { auto LinID = Id.get_linear_id(); DataB[LinID]--; DataC[LinID]--;