Skip to content

Commit c66a644

Browse files
author
Steffen Larsen
committed
[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 <[email protected]>
1 parent c220eb8 commit c66a644

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

sycl/source/detail/device_info.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,19 @@ struct get_device_info<bool, info::device::kernel_kernel_pipe_support> {
332332
}
333333
};
334334

335+
// Specialization for max_work_item_sizes.
336+
// Due to the flipping of work group dimensions before kernel launch, the max
337+
// sizes should also be reversed.
338+
template <> struct get_device_info<id<3>, info::device::max_work_item_sizes> {
339+
static id<3> get(RT::PiDevice dev, const plugin &Plugin) {
340+
size_t result[3];
341+
Plugin.call<PiApiKind::piDeviceGetInfo>(
342+
dev, pi::cast<RT::PiDeviceInfo>(info::device::max_work_item_sizes),
343+
sizeof(result), &result, nullptr);
344+
return id<3>(result[2], result[1], result[0]);
345+
}
346+
};
347+
335348
// SYCL host device information
336349

337350
// Default template is disabled, all possible instantiations are

0 commit comments

Comments
 (0)