18 #include <type_traits>
24 template <
typename Param>
25 typename std::enable_if<
26 std::is_same<typename Param::return_type, std::string>::value,
30 "Invalid kernel information descriptor");
31 size_t ResultSize = 0;
35 nullptr, &ResultSize);
36 if (ResultSize == 0) {
39 std::vector<char> Result(ResultSize);
42 ResultSize, Result.data(),
nullptr);
43 return std::string(Result.data());
46 template <
typename Param>
47 typename std::enable_if<
48 std::is_same<typename Param::return_type, uint32_t>::value, uint32_t>::type
54 sizeof(uint32_t), &Result,
nullptr);
59 template <
typename Param>
60 typename std::enable_if<IsSubGroupInfo<Param>::value>::type
62 const plugin &Plugin,
void *Result,
69 template <
typename Param>
70 typename std::enable_if<!IsSubGroupInfo<Param>::value>::type
72 const plugin &Plugin,
void *Result,
78 template <
typename Param>
79 typename std::enable_if<
80 !std::is_same<typename Param::return_type, sycl::range<3>>::value,
81 typename Param::return_type>::type
85 "Unexpected kernel_device_specific information descriptor");
86 typename Param::return_type Result = {};
88 get_kernel_device_specific_info_helper<Param>(
89 Kernel, Device, Plugin, &Result,
sizeof(
typename Param::return_type));
93 template <
typename Param>
94 typename std::enable_if<
95 std::is_same<typename Param::return_type, sycl::range<3>>::value,
100 "Unexpected kernel_device_specific information descriptor");
101 size_t Result[3] = {0, 0, 0};
103 get_kernel_device_specific_info_helper<Param>(Kernel, Device, Plugin, Result,
105 return sycl::range<3>(Result[0], Result[1], Result[2]);
111 template <
typename Param>
117 "Unexpected kernel_device_specific information descriptor");
118 static_assert(std::is_same<typename Param::return_type, uint32_t>::value,
119 "Unexpected return type");
121 "Unexpected kernel_device_specific information descriptor for "
123 size_t Input[3] = {In[0], In[1], In[2]};
128 sizeof(uint32_t), &Result,
nullptr);
133 template <
typename Param>
134 inline typename Param::return_type
139 info::kernel_device_specific::global_work_size>(
const sycl::device &) {
140 throw invalid_object_error(
"This instance of kernel is a host instance",
141 PI_ERROR_INVALID_KERNEL);
147 return Dev.get_info<info::device::max_work_group_size>();
152 info::kernel_device_specific::compile_work_group_size>(
153 const sycl::device &) {
159 info::kernel_device_specific::preferred_work_group_size_multiple>(
160 const sycl::device &Dev) {
167 info::kernel_device_specific::private_mem_size>(
const sycl::device &) {
173 info::kernel_device_specific::ext_codeplay_num_regs>(
const sycl::device &) {
179 info::kernel_device_specific::max_num_sub_groups>(
const sycl::device &) {
180 throw invalid_object_error(
"This instance of kernel is a host instance",
181 PI_ERROR_INVALID_KERNEL);
186 info::kernel_device_specific::max_sub_group_size>(
const sycl::device &) {
187 throw invalid_object_error(
"This instance of kernel is a host instance",
188 PI_ERROR_INVALID_KERNEL);
193 info::kernel_device_specific::compile_num_sub_groups>(
194 const sycl::device &) {
195 throw invalid_object_error(
"This instance of kernel is a host instance",
196 PI_ERROR_INVALID_KERNEL);
201 info::kernel_device_specific::compile_sub_group_size>(
202 const sycl::device &) {
203 throw invalid_object_error(
"This instance of kernel is a host instance",
204 PI_ERROR_INVALID_KERNEL);