From c66a6449c266404e8326a6d8f1b69d7dbe9666ce Mon Sep 17 00:00:00 2001 From: Steffen Larsen Date: Mon, 2 Mar 2020 15:34:56 +0000 Subject: [PATCH] [SYCL] Reverse max work-group size order Due to the user defined work-group size being flipped before launching kernels, the reported max work-group size for a device must be reversed correspondingly. Signed-off-by: Steffen Larsen --- sycl/source/detail/device_info.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sycl/source/detail/device_info.hpp b/sycl/source/detail/device_info.hpp index b6b4405ed40f0..322201fe242a8 100644 --- a/sycl/source/detail/device_info.hpp +++ b/sycl/source/detail/device_info.hpp @@ -332,6 +332,19 @@ struct get_device_info { } }; +// Specialization for max_work_item_sizes. +// Due to the flipping of work group dimensions before kernel launch, the max +// sizes should also be reversed. +template <> struct get_device_info, info::device::max_work_item_sizes> { + static id<3> get(RT::PiDevice dev, const plugin &Plugin) { + size_t result[3]; + Plugin.call( + dev, pi::cast(info::device::max_work_item_sizes), + sizeof(result), &result, nullptr); + return id<3>(result[2], result[1], result[0]); + } +}; + // SYCL host device information // Default template is disabled, all possible instantiations are