Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit 7ec01e6

Browse files
RbiessyRuyman
authored andcommitted
Try make it compile for triSYCL
1 parent f4da71f commit 7ec01e6

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

benchmarks/sycl_reduce.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ benchmark<>::time_units_t benchmark_reduce(const unsigned numReps,
5555

5656
cl::sycl::queue q(cds);
5757
auto device = q.get_device();
58-
const auto maxWorkGroupItemSizes =
58+
const cl::sycl::id<3> maxWorkItemSizes =
5959
device.get_info<cl::sycl::info::device::max_work_item_sizes>();
6060
const auto local = std::min(
6161
device.get_info<cl::sycl::info::device::max_work_group_size>(),
62-
maxWorkGroupItemSizes[0]);
62+
maxWorkItemSizes[0]);
6363
sycl::sycl_execution_policy<class ReduceAlgorithmBench> snp(q);
6464
auto bufI = sycl::helpers::make_const_buffer(v.begin(), v.end());
6565
size_t length = N;

include/sycl/algorithm/buffer_algorithms.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ sycl_algorithm_descriptor compute_mapreduce_descriptor(cl::sycl::device device,
8787
size_t max_work_group =
8888
device.get_info<cl::sycl::info::device::max_compute_units>();
8989

90-
const auto max_work_item_sizes =
90+
const cl::sycl::id<3>max_work_item_sizes =
9191
device.get_info<cl::sycl::info::device::max_work_item_sizes>();
9292
const auto max_work_item = min(
9393
device.get_info<cl::sycl::info::device::max_work_group_size>(),
@@ -343,7 +343,7 @@ sycl_algorithm_descriptor compute_mapscan_descriptor(cl::sycl::device device,
343343

344344
size_t nb_work_group = up_rounded_division(size, size_per_work_group);
345345

346-
const auto max_work_item_sizes =
346+
const cl::sycl::id<3> max_work_item_sizes =
347347
device.get_info<cl::sycl::info::device::max_work_item_sizes>();
348348
const auto max_work_item = min(
349349
device.get_info<cl::sycl::info::device::max_work_group_size>(),

include/sycl/execution_policy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,12 @@ class sycl_execution_policy {
104104
*/
105105
cl::sycl::nd_range<1> calculateNdRange(size_t problemSize) {
106106
const auto& d = m_q.get_device();
107-
size_t localSize = std::min(problemSize,
107+
const cl::sycl::id<3> maxWorkItemSizes =
108+
d.template get_info<cl::sycl::info::device::max_work_item_sizes>();
109+
const auto localSize = std::min(problemSize,
108110
std::min(
109111
d.template get_info<cl::sycl::info::device::max_work_group_size>(),
110-
d.template get_info<cl::sycl::info::device::max_work_item_sizes>()[0]
112+
maxWorkItemSizes[0]
111113
));
112114

113115
size_t globalSize;

0 commit comments

Comments
 (0)