diff --git a/DirectProgramming/DPC++/CombinationalLogic/mandelbrot/src/mandel.hpp b/DirectProgramming/DPC++/CombinationalLogic/mandelbrot/src/mandel.hpp index 7c261a5e56..aa983b833c 100644 --- a/DirectProgramming/DPC++/CombinationalLogic/mandelbrot/src/mandel.hpp +++ b/DirectProgramming/DPC++/CombinationalLogic/mandelbrot/src/mandel.hpp @@ -234,10 +234,10 @@ class MandelParallel : public Mandel { // We submit a command group to the queue. q.submit([&](handler &h) { // Get access to the buffer. - auto b = data_buf.get_access(h); + auto b = data_buf.get_access(h,write_only); // Iterate over image and compute mandel for each point. - h.parallel_for(range(rows, cols), [=](id<2> index) { + h.parallel_for(range<2>(rows, cols), [=](auto index) { int i = int(index[0]); int j = int(index[1]); auto c = MandelParameters::ComplexF(p.ScaleRow(i), p.ScaleCol(j)); diff --git a/DirectProgramming/DPC++/MapReduce/MonteCarloPi/src/monte_carlo_pi.cpp b/DirectProgramming/DPC++/MapReduce/MonteCarloPi/src/monte_carlo_pi.cpp index 8dc8449c1d..4de655769b 100644 --- a/DirectProgramming/DPC++/MapReduce/MonteCarloPi/src/monte_carlo_pi.cpp +++ b/DirectProgramming/DPC++/MapReduce/MonteCarloPi/src/monte_carlo_pi.cpp @@ -81,13 +81,13 @@ double MonteCarloPi(rgb image_plot[]) { // Perform Monte Carlo simulation and reduce results q.submit([&](handler& h) { // Set up accessors - auto imgplot_acc = imgplot_buf.get_access(h); - auto coords_acc = coords_buf.get_access(h); - auto total_acc = total_buf.get_access(h); + auto imgplot_acc = imgplot_buf.get_access(h); + auto coords_acc = coords_buf.get_access(h); + auto total_acc = total_buf.get_access(h); // Monte Carlo Procedure + Reduction h.parallel_for(nd_range<1>(num_wg * size_wg, size_wg), - sycl::intel::reduction(total_acc, 0, std::plus()), + sycl::ONEAPI::reduction(total_acc, 0, std::plus()), [=](nd_item<1> it, auto& total_acc) { // Index for accessing buffers int i = it.get_global_id(); diff --git a/DirectProgramming/DPC++/SpectralMethods/DiscreteCosineTransform/src/DCT.cpp b/DirectProgramming/DPC++/SpectralMethods/DiscreteCosineTransform/src/DCT.cpp index 3af01a8a4a..da7ff630a1 100644 --- a/DirectProgramming/DPC++/SpectralMethods/DiscreteCosineTransform/src/DCT.cpp +++ b/DirectProgramming/DPC++/SpectralMethods/DiscreteCosineTransform/src/DCT.cpp @@ -230,20 +230,20 @@ void ProcessImage(rgb* indataset, rgb* outdataset, int width, int height) { // Creating a transpose of DCT matrix MatrixTranspose(dct, dctinv); - buffer indata_buf((rgb*)indataset, range<1>(image_size)); - buffer outdata_buf((rgb*)outdataset, range<1>(image_size)); - buffer dct_buf((float*)dct, range<1>(block_size)); - buffer dctinv_buf((float*)dctinv, range<1>(block_size)); + buffer indata_buf(indataset, range<1>(image_size)); + buffer outdata_buf(outdataset, range<1>(image_size)); + buffer dct_buf(dct, range<1>(block_size)); + buffer dctinv_buf(dctinv, range<1>(block_size)); q.submit([&](handler& h) { - auto i_acc = indata_buf.get_access(h); - auto o_acc = outdata_buf.get_access(h); - auto d_acc = dct_buf.get_access(h); - auto di_acc = dctinv_buf.get_access(h); + auto i_acc = indata_buf.get_access(h,read_only); + auto o_acc = outdata_buf.get_access(h); + auto d_acc = dct_buf.get_access(h,read_only); + auto di_acc = dctinv_buf.get_access(h,read_only); // Processes individual 8x8 chunks in parallel h.parallel_for( - range<2>(width / block_dims, height / block_dims), [=](id<2> idx) { + range<2>(width / block_dims, height / block_dims), [=](auto idx) { int start_index = idx[0] * block_dims + idx[1] * block_dims * width; ProcessBlock(i_acc.get_pointer(), o_acc.get_pointer(), d_acc.get_pointer(), di_acc.get_pointer(), start_index,