DPC++ Runtime
Runtime libraries for oneAPI DPC++
device_info.hpp
Go to the documentation of this file.
1 //==-------- device_info.hpp - SYCL device info methods --------------------==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #pragma once
10 #include <detail/device_impl.hpp>
11 #include <detail/platform_impl.hpp>
12 #include <detail/platform_util.hpp>
13 #include <detail/plugin.hpp>
16 #include <sycl/detail/defines.hpp>
17 #include <sycl/detail/os_util.hpp>
18 #include <sycl/detail/pi.hpp>
19 #include <sycl/device.hpp>
20 #include <sycl/feature_test.hpp>
21 #include <sycl/info/info_desc.hpp>
22 #include <sycl/memory_enums.hpp>
23 #include <sycl/platform.hpp>
24 
25 #include <chrono>
26 #include <thread>
27 
28 namespace sycl {
30 namespace detail {
31 
32 inline std::vector<info::fp_config> read_fp_bitfield(pi_device_fp_config bits) {
33  std::vector<info::fp_config> result;
34  if (bits & PI_FP_DENORM)
35  result.push_back(info::fp_config::denorm);
36  if (bits & PI_FP_INF_NAN)
37  result.push_back(info::fp_config::inf_nan);
38  if (bits & PI_FP_ROUND_TO_NEAREST)
39  result.push_back(info::fp_config::round_to_nearest);
40  if (bits & PI_FP_ROUND_TO_ZERO)
41  result.push_back(info::fp_config::round_to_zero);
42  if (bits & PI_FP_ROUND_TO_INF)
43  result.push_back(info::fp_config::round_to_inf);
44  if (bits & PI_FP_FMA)
45  result.push_back(info::fp_config::fma);
46  if (bits & PI_FP_SOFT_FLOAT)
47  result.push_back(info::fp_config::soft_float);
49  result.push_back(info::fp_config::correctly_rounded_divide_sqrt);
50  return result;
51 }
52 
53 inline std::vector<info::partition_affinity_domain>
55  std::vector<info::partition_affinity_domain> result;
57  result.push_back(info::partition_affinity_domain::numa);
59  result.push_back(info::partition_affinity_domain::L4_cache);
61  result.push_back(info::partition_affinity_domain::L3_cache);
63  result.push_back(info::partition_affinity_domain::L2_cache);
65  result.push_back(info::partition_affinity_domain::L1_cache);
67  result.push_back(info::partition_affinity_domain::next_partitionable);
68  return result;
69 }
70 
71 inline std::vector<info::execution_capability>
73  std::vector<info::execution_capability> result;
74  if (bits & PI_EXEC_KERNEL)
75  result.push_back(info::execution_capability::exec_kernel);
76  if (bits & PI_EXEC_NATIVE_KERNEL)
77  result.push_back(info::execution_capability::exec_native_kernel);
78  return result;
79 }
80 
81 inline std::string
83  switch (AffinityDomain) {
84 #define __SYCL_AFFINITY_DOMAIN_STRING_CASE(DOMAIN) \
85  case DOMAIN: \
86  return #DOMAIN;
87 
89  sycl::info::partition_affinity_domain::numa)
91  sycl::info::partition_affinity_domain::L4_cache)
93  sycl::info::partition_affinity_domain::L3_cache)
95  sycl::info::partition_affinity_domain::L2_cache)
97  sycl::info::partition_affinity_domain::L1_cache)
99  sycl::info::partition_affinity_domain::next_partitionable)
100 #undef __SYCL_AFFINITY_DOMAIN_STRING_CASE
101  default:
102  assert(false && "Missing case for affinity domain.");
103  return "unknown";
104  }
105 }
106 
107 // Mapping expected SYCL return types to those returned by PI calls
108 template <typename T> struct sycl_to_pi {
109  using type = T;
110 };
111 template <> struct sycl_to_pi<bool> {
112  using type = pi_bool;
113 };
114 template <> struct sycl_to_pi<device> {
116 };
117 template <> struct sycl_to_pi<platform> {
119 };
120 
121 // Mapping fp_config device info types to the values used to check fp support
122 template <typename Param> struct check_fp_support {};
123 
124 template <> struct check_fp_support<info::device::half_fp_config> {
125  using type = info::device::native_vector_width_half;
126 };
127 
128 template <> struct check_fp_support<info::device::double_fp_config> {
129  using type = info::device::native_vector_width_double;
130 };
131 
132 // Structs for emulating function template partial specialization
133 // Default template for the general case
134 // TODO: get rid of remaining uses of OpenCL directly
135 //
136 template <typename ReturnT, typename Param> struct get_device_info_impl {
137  static ReturnT get(RT::PiDevice dev, const plugin &Plugin) {
138  typename sycl_to_pi<ReturnT>::type result;
140  sizeof(result), &result, nullptr);
141  return ReturnT(result);
142  }
143 };
144 
145 // Specialization for platform
146 template <typename Param> struct get_device_info_impl<platform, Param> {
147  static platform get(RT::PiDevice dev, const plugin &Plugin) {
148  typename sycl_to_pi<platform>::type result;
150  sizeof(result), &result, nullptr);
151  // TODO: Change PiDevice to device_impl.
152  // Use the Plugin from the device_impl class after plugin details
153  // are added to the class.
154  return createSyclObjFromImpl<platform>(
155  platform_impl::getOrMakePlatformImpl(result, Plugin));
156  }
157 };
158 
159 // Helper function to allow using the specialization of get_device_info_impl
160 // for string return type in other specializations.
161 inline std::string get_device_info_string(RT::PiDevice dev,
162  RT::PiDeviceInfo InfoCode,
163  const plugin &Plugin) {
164  size_t resultSize = 0;
165  Plugin.call<PiApiKind::piDeviceGetInfo>(dev, InfoCode, 0, nullptr,
166  &resultSize);
167  if (resultSize == 0) {
168  return std::string();
169  }
170  std::unique_ptr<char[]> result(new char[resultSize]);
171  Plugin.call<PiApiKind::piDeviceGetInfo>(dev, InfoCode, resultSize,
172  result.get(), nullptr);
173 
174  return std::string(result.get());
175 }
176 
177 // Specialization for string return type, variable return size
178 template <typename Param> struct get_device_info_impl<std::string, Param> {
179  static std::string get(RT::PiDevice dev, const plugin &Plugin) {
181  }
182 };
183 
184 // Specialization for parent device
185 template <typename ReturnT>
186 struct get_device_info_impl<ReturnT, info::device::parent_device> {
187  static ReturnT get(RT::PiDevice dev, const plugin &Plugin);
188 };
189 
190 // Specialization for fp_config types, checks the corresponding fp type support
191 template <typename Param>
192 struct get_device_info_impl<std::vector<info::fp_config>, Param> {
193  static std::vector<info::fp_config> get(RT::PiDevice dev,
194  const plugin &Plugin) {
195  // Check if fp type is supported
198  typename check_fp_support<Param>::type>::get(dev, Plugin)) {
199  return {};
200  }
201  cl_device_fp_config result;
203  sizeof(result), &result, nullptr);
204  return read_fp_bitfield(result);
205  }
206 };
207 
208 // Specialization for OpenCL version, splits the string returned by OpenCL
209 template <> struct get_device_info_impl<std::string, info::device::version> {
210  static std::string get(RT::PiDevice dev, const plugin &Plugin) {
211  std::string result = get_device_info_string(
213 
214  // Extract OpenCL version from the returned string.
215  // For example, for the string "OpenCL 2.1 (Build 0)"
216  // return '2.1'.
217  auto dotPos = result.find('.');
218  if (dotPos == std::string::npos)
219  return result;
220 
221  auto leftPos = result.rfind(' ', dotPos);
222  if (leftPos == std::string::npos)
223  leftPos = 0;
224  else
225  leftPos++;
226 
227  auto rightPos = result.find(' ', dotPos);
228  return result.substr(leftPos, rightPos - leftPos);
229  }
230 };
231 
232 // Specialization for single_fp_config, no type support check required
233 template <>
234 struct get_device_info_impl<std::vector<info::fp_config>,
235  info::device::single_fp_config> {
236  static std::vector<info::fp_config> get(RT::PiDevice dev,
237  const plugin &Plugin) {
238  pi_device_fp_config result;
241  &result, nullptr);
242  return read_fp_bitfield(result);
243  }
244 };
245 
246 // Specialization for queue_profiling. In addition to pi_queue level profiling,
247 // piGetDeviceAndHostTimer support is needed for command_submit query support.
248 template <> struct get_device_info_impl<bool, info::device::queue_profiling> {
249  static bool get(RT::PiDevice Dev, const plugin &Plugin) {
250  pi_queue_properties Properties;
253  sizeof(Properties), &Properties, nullptr);
254  if (!(Properties & PI_QUEUE_FLAG_PROFILING_ENABLE))
255  return false;
256  RT::PiResult Result =
258  Dev, nullptr, nullptr);
259  if (Result == PI_ERROR_INVALID_OPERATION)
260  return false;
261  Plugin.checkPiResult(Result);
262  return true;
263  }
264 };
265 
266 // Specialization for atomic_memory_order_capabilities, PI returns a bitfield
267 template <>
268 struct get_device_info_impl<std::vector<memory_order>,
269  info::device::atomic_memory_order_capabilities> {
270  static std::vector<memory_order> get(RT::PiDevice dev, const plugin &Plugin) {
274  sizeof(pi_memory_order_capabilities), &result, nullptr);
275  return readMemoryOrderBitfield(result);
276  }
277 };
278 
279 // Specialization for atomic_fence_order_capabilities, PI returns a bitfield
280 template <>
281 struct get_device_info_impl<std::vector<memory_order>,
282  info::device::atomic_fence_order_capabilities> {
283  static std::vector<memory_order> get(RT::PiDevice dev, const plugin &Plugin) {
287  sizeof(pi_memory_order_capabilities), &result, nullptr);
288  return readMemoryOrderBitfield(result);
289  }
290 };
291 
292 // Specialization for atomic_memory_scope_capabilities, PI returns a bitfield
293 template <>
294 struct get_device_info_impl<std::vector<memory_scope>,
295  info::device::atomic_memory_scope_capabilities> {
296  static std::vector<memory_scope> get(RT::PiDevice dev, const plugin &Plugin) {
300  sizeof(pi_memory_scope_capabilities), &result, nullptr);
301  return readMemoryScopeBitfield(result);
302  }
303 };
304 
305 // Specialization for atomic_fence_scope_capabilities, PI returns a bitfield
306 template <>
307 struct get_device_info_impl<std::vector<memory_scope>,
308  info::device::atomic_fence_scope_capabilities> {
309  static std::vector<memory_scope> get(RT::PiDevice dev, const plugin &Plugin) {
313  sizeof(pi_memory_scope_capabilities), &result, nullptr);
314  return readMemoryScopeBitfield(result);
315  }
316 };
317 
318 // Specialization for bf16 math functions
319 template <>
321  info::device::ext_oneapi_bfloat16_math_functions> {
322  static bool get(RT::PiDevice dev, const plugin &Plugin) {
323  bool result = false;
324 
326  dev,
328  sizeof(result), &result, nullptr);
329  if (Err != PI_SUCCESS) {
330  return false;
331  }
332  return result;
333  }
334 };
335 
336 // Specialization for exec_capabilities, OpenCL returns a bitfield
337 template <>
338 struct get_device_info_impl<std::vector<info::execution_capability>,
339  info::device::execution_capabilities> {
340  static std::vector<info::execution_capability> get(RT::PiDevice dev,
341  const plugin &Plugin) {
345  sizeof(result), &result, nullptr);
346  return read_execution_bitfield(result);
347  }
348 };
349 
350 // Specialization for built in kernel identifiers
351 template <>
352 struct get_device_info_impl<std::vector<kernel_id>,
353  info::device::built_in_kernel_ids> {
354  static std::vector<kernel_id> get(RT::PiDevice dev, const plugin &Plugin) {
355  std::string result = get_device_info_string(
357  auto names = split_string(result, ';');
358 
359  std::vector<kernel_id> ids;
360  ids.reserve(names.size());
361  for (const auto &name : names) {
362  ids.push_back(ProgramManager::getInstance().getBuiltInKernelID(name));
363  }
364  return ids;
365  }
366 };
367 
368 // Specialization for built in kernels, splits the string returned by OpenCL
369 template <>
370 struct get_device_info_impl<std::vector<std::string>,
371  info::device::built_in_kernels> {
372  static std::vector<std::string> get(RT::PiDevice dev, const plugin &Plugin) {
373  std::string result = get_device_info_string(
375  return split_string(result, ';');
376  }
377 };
378 
379 // Specialization for extensions, splits the string returned by OpenCL
380 template <>
381 struct get_device_info_impl<std::vector<std::string>,
382  info::device::extensions> {
383  static std::vector<std::string> get(RT::PiDevice dev, const plugin &Plugin) {
384  std::string result =
386  dev, Plugin);
387  return split_string(result, ' ');
388  }
389 };
390 
392  switch (PP) {
393  case info::partition_property::no_partition:
394  case info::partition_property::partition_equally:
395  case info::partition_property::partition_by_counts:
396  case info::partition_property::partition_by_affinity_domain:
397  case info::partition_property::ext_intel_partition_by_cslice:
398  return true;
399  }
400  return false;
401 }
402 
403 // Specialization for partition properties, variable OpenCL return size
404 template <>
405 struct get_device_info_impl<std::vector<info::partition_property>,
406  info::device::partition_properties> {
407  static std::vector<info::partition_property> get(RT::PiDevice dev,
408  const plugin &Plugin) {
410 
411  size_t resultSize;
412  Plugin.call<PiApiKind::piDeviceGetInfo>(dev, info_partition, 0, nullptr,
413  &resultSize);
414 
415  size_t arrayLength = resultSize / sizeof(cl_device_partition_property);
416  if (arrayLength == 0) {
417  return {};
418  }
419  std::unique_ptr<cl_device_partition_property[]> arrayResult(
420  new cl_device_partition_property[arrayLength]);
421  Plugin.call<PiApiKind::piDeviceGetInfo>(dev, info_partition, resultSize,
422  arrayResult.get(), nullptr);
423 
424  std::vector<info::partition_property> result;
425  for (size_t i = 0; i < arrayLength; ++i) {
426  // OpenCL extensions may have partition_properties that
427  // are not yet defined for SYCL (eg. CL_DEVICE_PARTITION_BY_NAMES_INTEL)
429  static_cast<info::partition_property>(arrayResult[i]));
431  result.push_back(pp);
432  }
433  return result;
434  }
435 };
436 
437 // Specialization for partition affinity domains, OpenCL returns a bitfield
438 template <>
439 struct get_device_info_impl<std::vector<info::partition_affinity_domain>,
440  info::device::partition_affinity_domains> {
441  static std::vector<info::partition_affinity_domain>
442  get(RT::PiDevice dev, const plugin &Plugin) {
446  sizeof(result), &result, nullptr);
447  return read_domain_bitfield(result);
448  }
449 };
450 
451 // Specialization for partition type affinity domain, OpenCL can return other
452 // partition properties instead
453 template <>
455  info::device::partition_type_affinity_domain> {
457  const plugin &Plugin) {
458  size_t resultSize;
461  nullptr, &resultSize);
462  if (resultSize != 1) {
463  return info::partition_affinity_domain::not_applicable;
464  }
465  cl_device_partition_property result;
468  sizeof(result), &result, nullptr);
469  if (result == PI_DEVICE_AFFINITY_DOMAIN_NUMA ||
474  return info::partition_affinity_domain(result);
475  }
476 
477  return info::partition_affinity_domain::not_applicable;
478  }
479 };
480 
481 // Specialization for partition type
482 template <>
484  info::device::partition_type_property> {
485  static info::partition_property get(RT::PiDevice dev, const plugin &Plugin) {
486  size_t resultSize;
488  0, nullptr, &resultSize);
489  if (!resultSize)
490  return info::partition_property::no_partition;
491 
492  size_t arrayLength = resultSize / sizeof(cl_device_partition_property);
493 
494  std::unique_ptr<cl_device_partition_property[]> arrayResult(
495  new cl_device_partition_property[arrayLength]);
497  resultSize, arrayResult.get(),
498  nullptr);
499  if (!arrayResult[0])
500  return info::partition_property::no_partition;
501  return info::partition_property(arrayResult[0]);
502  }
503 };
504 // Specialization for supported subgroup sizes
505 template <>
506 struct get_device_info_impl<std::vector<size_t>,
507  info::device::sub_group_sizes> {
508  static std::vector<size_t> get(RT::PiDevice dev, const plugin &Plugin) {
509  size_t resultSize = 0;
512  &resultSize);
513 
514  std::vector<size_t> result(resultSize / sizeof(size_t));
517  result.data(), nullptr);
518  return result;
519  }
520 };
521 
522 // Specialization for kernel to kernel pipes.
523 // Here we step away from OpenCL, since there is no appropriate cl_device_info
524 // enum for global pipes feature.
525 template <>
526 struct get_device_info_impl<bool, info::device::kernel_kernel_pipe_support> {
527  static bool get(RT::PiDevice dev, const plugin &Plugin) {
528  // We claim, that all Intel FPGA devices support kernel to kernel pipe
529  // feature (at least at the scope of SYCL_INTEL_data_flow_pipes extension).
531  dev, Plugin);
532  std::string platform_name = plt.get_info<info::platform::name>();
533  if (platform_name == "Intel(R) FPGA Emulation Platform for OpenCL(TM)" ||
534  platform_name == "Intel(R) FPGA SDK for OpenCL(TM)")
535  return true;
536 
537  // TODO: a better way is to query for supported SPIR-V capabilities when
538  // it's started to be possible. Also, if a device's backend supports
539  // SPIR-V 1.1 (where Pipe Storage feature was defined), than it supports
540  // the feature as well.
541  return false;
542  }
543 };
544 
545 template <int Dimensions> id<Dimensions> construct_id(size_t *values) = delete;
546 // Due to the flipping of work group dimensions before kernel launch, the values
547 // should also be reversed.
548 template <> inline id<1> construct_id<1>(size_t *values) { return {values[0]}; }
549 template <> inline id<2> construct_id<2>(size_t *values) {
550  return {values[1], values[0]};
551 }
552 template <> inline id<3> construct_id<3>(size_t *values) {
553  return {values[2], values[1], values[0]};
554 }
555 
556 // Specialization for max_work_item_sizes.
557 template <int Dimensions>
559  info::device::max_work_item_sizes<Dimensions>> {
560  static id<Dimensions> get(RT::PiDevice dev, const plugin &Plugin) {
561  size_t result[3];
564  sizeof(result), &result, nullptr);
565  return construct_id<Dimensions>(result);
566  }
567 };
568 
569 template <>
571  size_t, ext::oneapi::experimental::info::device::max_global_work_groups> {
572  static size_t get(RT::PiDevice dev, const plugin &Plugin) {
573  (void)dev; // Silence unused warning
574  (void)Plugin;
575  return static_cast<size_t>((std::numeric_limits<int>::max)());
576  }
577 };
578 template <>
580  id<1>, ext::oneapi::experimental::info::device::max_work_groups<1>> {
581  static id<1> get(RT::PiDevice dev, const plugin &Plugin) {
582  size_t result[3];
583  size_t Limit =
584  get_device_info_impl<size_t, ext::oneapi::experimental::info::device::
585  max_global_work_groups>::get(dev,
586  Plugin);
588  dev,
589  PiInfoCode<
591  sizeof(result), &result, nullptr);
592  return id<1>(std::min(Limit, result[0]));
593  }
594 };
595 
596 template <>
598  id<2>, ext::oneapi::experimental::info::device::max_work_groups<2>> {
599  static id<2> get(RT::PiDevice dev, const plugin &Plugin) {
600  size_t result[3];
601  size_t Limit =
602  get_device_info_impl<size_t, ext::oneapi::experimental::info::device::
603  max_global_work_groups>::get(dev,
604  Plugin);
606  dev,
607  PiInfoCode<
609  sizeof(result), &result, nullptr);
610  return id<2>(std::min(Limit, result[1]), std::min(Limit, result[0]));
611  }
612 };
613 
614 template <>
616  id<3>, ext::oneapi::experimental::info::device::max_work_groups<3>> {
617  static id<3> get(RT::PiDevice dev, const plugin &Plugin) {
618  size_t result[3];
619  size_t Limit =
620  get_device_info_impl<size_t, ext::oneapi::experimental::info::device::
621  max_global_work_groups>::get(dev,
622  Plugin);
624  dev,
625  PiInfoCode<
627  sizeof(result), &result, nullptr);
628  return id<3>(std::min(Limit, result[2]), std::min(Limit, result[1]),
629  std::min(Limit, result[0]));
630  }
631 };
632 
633 // TODO:Remove with deprecated feature
634 // device::get_info<info::device::ext_oneapi_max_global_work_groups>
635 template <>
636 struct get_device_info_impl<size_t,
637  info::device::ext_oneapi_max_global_work_groups> {
638  static size_t get(RT::PiDevice dev, const plugin &Plugin) {
639  return get_device_info_impl<size_t,
640  ext::oneapi::experimental::info::device::
641  max_global_work_groups>::get(dev, Plugin);
642  }
643 };
644 
645 // TODO:Remove with deprecated feature
646 // device::get_info<info::device::ext_oneapi_max_work_groups_1d>
647 template <>
649  info::device::ext_oneapi_max_work_groups_1d> {
650  static id<1> get(RT::PiDevice dev, const plugin &Plugin) {
651  return get_device_info_impl<id<1>, ext::oneapi::experimental::info::device::
652  max_work_groups<1>>::get(dev,
653  Plugin);
654  }
655 };
656 
657 // TODO:Remove with deprecated feature
658 // device::get_info<info::device::ext_oneapi_max_work_groups_2d>
659 template <>
661  info::device::ext_oneapi_max_work_groups_2d> {
662  static id<2> get(RT::PiDevice dev, const plugin &Plugin) {
663  return get_device_info_impl<id<2>, ext::oneapi::experimental::info::device::
664  max_work_groups<2>>::get(dev,
665  Plugin);
666  }
667 };
668 
669 // TODO:Remove with deprecated feature
670 // device::get_info<info::device::ext_oneapi_max_work_groups_3d>
671 template <>
673  info::device::ext_oneapi_max_work_groups_3d> {
674  static id<3> get(RT::PiDevice dev, const plugin &Plugin) {
675  return get_device_info_impl<id<3>, ext::oneapi::experimental::info::device::
676  max_work_groups<3>>::get(dev,
677  Plugin);
678  }
679 };
680 
681 // Specialization for parent device
682 template <> struct get_device_info_impl<device, info::device::parent_device> {
683  static device get(RT::PiDevice dev, const plugin &Plugin) {
684  typename sycl_to_pi<device>::type result;
687  &result, nullptr);
688  if (result == nullptr)
689  throw invalid_object_error(
690  "No parent for device because it is not a subdevice",
691  PI_ERROR_INVALID_DEVICE);
692 
693  // Get the platform of this device
694  std::shared_ptr<detail::platform_impl> Platform =
695  platform_impl::getPlatformFromPiDevice(dev, Plugin);
696  return createSyclObjFromImpl<device>(
697  Platform->getOrMakeDeviceImpl(result, Platform));
698  }
699 };
700 
701 // USM
702 
703 // Specialization for device usm query.
704 template <>
705 struct get_device_info_impl<bool, info::device::usm_device_allocations> {
706  static bool get(RT::PiDevice dev, const plugin &Plugin) {
707  pi_usm_capabilities caps;
710  sizeof(pi_usm_capabilities), &caps, nullptr);
711 
712  return (Err != PI_SUCCESS) ? false : (caps & PI_USM_ACCESS);
713  }
714 };
715 
716 // Specialization for host usm query.
717 template <>
718 struct get_device_info_impl<bool, info::device::usm_host_allocations> {
719  static bool get(RT::PiDevice dev, const plugin &Plugin) {
720  pi_usm_capabilities caps;
723  sizeof(pi_usm_capabilities), &caps, nullptr);
724 
725  return (Err != PI_SUCCESS) ? false : (caps & PI_USM_ACCESS);
726  }
727 };
728 
729 // Specialization for shared usm query.
730 template <>
731 struct get_device_info_impl<bool, info::device::usm_shared_allocations> {
732  static bool get(RT::PiDevice dev, const plugin &Plugin) {
733  pi_usm_capabilities caps;
736  sizeof(pi_usm_capabilities), &caps, nullptr);
737  return (Err != PI_SUCCESS) ? false : (caps & PI_USM_ACCESS);
738  }
739 };
740 
741 // Specialization for restricted usm query
742 template <>
744  info::device::usm_restricted_shared_allocations> {
745  static bool get(RT::PiDevice dev, const plugin &Plugin) {
746  pi_usm_capabilities caps;
749  sizeof(pi_usm_capabilities), &caps, nullptr);
750  // Check that we don't support any cross device sharing
751  return (Err != PI_SUCCESS)
752  ? false
753  : !(caps & (PI_USM_ACCESS | PI_USM_CONCURRENT_ACCESS));
754  }
755 };
756 
757 // Specialization for system usm query
758 template <>
759 struct get_device_info_impl<bool, info::device::usm_system_allocations> {
760  static bool get(RT::PiDevice dev, const plugin &Plugin) {
761  pi_usm_capabilities caps;
764  sizeof(pi_usm_capabilities), &caps, nullptr);
765  return (Err != PI_SUCCESS) ? false : (caps & PI_USM_ACCESS);
766  }
767 };
768 
769 // Specialization for memory channel query
770 template <>
771 struct get_device_info_impl<bool, info::device::ext_intel_mem_channel> {
772  static bool get(RT::PiDevice dev, const plugin &Plugin) {
773  pi_mem_properties caps;
776  sizeof(pi_mem_properties), &caps, nullptr);
777  return (Err != PI_SUCCESS) ? false : (caps & PI_MEM_PROPERTIES_CHANNEL);
778  }
779 };
780 
781 // Specialization for kernel fusion support
782 template <>
784  bool, ext::codeplay::experimental::info::device::supports_fusion> {
785  static bool get(RT::PiDevice dev, const plugin &Plugin) {
786 #if SYCL_EXT_CODEPLAY_KERNEL_FUSION
787  // Currently fusion is only supported for SPIR-V based backends, i.e. OpenCL
788  // and LevelZero.
789  (void)dev;
790  return (Plugin.getBackend() == backend::ext_oneapi_level_zero) ||
791  (Plugin.getBackend() == backend::opencl);
792 #else // SYCL_EXT_CODEPLAY_KERNEL_FUSION
793  (void)dev;
794  (void)Plugin;
795  return false;
796 #endif // SYCL_EXT_CODEPLAY_KERNEL_FUSION
797  }
798 };
799 
800 template <typename Param>
801 typename Param::return_type get_device_info(RT::PiDevice dev,
802  const plugin &Plugin) {
803  static_assert(is_device_info_desc<Param>::value,
804  "Invalid device information descriptor");
806  Plugin);
807 }
808 
809 // SYCL host device information
810 
811 // Default template is disabled, all possible instantiations are
812 // specified explicitly.
813 template <typename Param>
814 inline typename Param::return_type get_device_info_host() = delete;
815 
816 template <>
817 inline info::device_type get_device_info_host<info::device::device_type>() {
818  return info::device_type::host;
819 }
820 
821 template <> inline uint32_t get_device_info_host<info::device::vendor_id>() {
822  return 0x8086;
823 }
824 
825 template <>
826 inline uint32_t get_device_info_host<info::device::max_compute_units>() {
827  return std::thread::hardware_concurrency();
828 }
829 
830 template <>
831 inline uint32_t get_device_info_host<info::device::max_work_item_dimensions>() {
832  return 3;
833 }
834 
835 template <>
836 inline id<1> get_device_info_host<info::device::max_work_item_sizes<1>>() {
837  // current value is the required minimum
838  return {1};
839 }
840 
841 template <>
842 inline id<2> get_device_info_host<info::device::max_work_item_sizes<2>>() {
843  // current value is the required minimum
844  return {1, 1};
845 }
846 
847 template <>
848 inline id<3> get_device_info_host<info::device::max_work_item_sizes<3>>() {
849  // current value is the required minimum
850  return {1, 1, 1};
851 }
852 
853 template <>
854 inline constexpr size_t get_device_info_host<
855  ext::oneapi::experimental::info::device::max_global_work_groups>() {
856  // See handler.hpp for the maximum value :
857  return static_cast<size_t>((std::numeric_limits<int>::max)());
858 }
859 
860 template <>
863  // See handler.hpp for the maximum value :
864  static constexpr size_t Limit = get_device_info_host<
865  ext::oneapi::experimental::info::device::max_global_work_groups>();
866  return {Limit};
867 }
868 
869 template <>
872  // See handler.hpp for the maximum value :
873  static constexpr size_t Limit = get_device_info_host<
874  ext::oneapi::experimental::info::device::max_global_work_groups>();
875  return {Limit, Limit};
876 }
877 
878 template <>
881  // See handler.hpp for the maximum value :
882  static constexpr size_t Limit = get_device_info_host<
883  ext::oneapi::experimental::info::device::max_global_work_groups>();
884  return {Limit, Limit, Limit};
885 }
886 
887 // TODO:remove with deprecated feature
888 // device::get_info<info::device::ext_oneapi_max_global_work_groups>
889 template <>
890 inline constexpr size_t
891 get_device_info_host<info::device::ext_oneapi_max_global_work_groups>() {
892  return get_device_info_host<
893  ext::oneapi::experimental::info::device::max_global_work_groups>();
894 }
895 
896 // TODO:remove with deprecated feature
897 // device::get_info<info::device::ext_oneapi_max_work_groups_1d>
898 template <>
899 inline id<1>
900 get_device_info_host<info::device::ext_oneapi_max_work_groups_1d>() {
901 
902  return get_device_info_host<
904 }
905 
906 // TODO:remove with deprecated feature
907 // device::get_info<info::device::ext_oneapi_max_work_groups_2d>
908 template <>
909 inline id<2>
910 get_device_info_host<info::device::ext_oneapi_max_work_groups_2d>() {
911  return get_device_info_host<
913 }
914 
915 // TODO:remove with deprecated feature
916 // device::get_info<info::device::ext_oneapi_max_work_groups_3d>
917 template <>
918 inline id<3>
919 get_device_info_host<info::device::ext_oneapi_max_work_groups_3d>() {
920  return get_device_info_host<
922 }
923 
924 template <>
925 inline size_t get_device_info_host<info::device::max_work_group_size>() {
926  // current value is the required minimum
927  return 1;
928 }
929 
930 template <>
931 inline uint32_t
932 get_device_info_host<info::device::preferred_vector_width_char>() {
933  // TODO update when appropriate
934  return 1;
935 }
936 
937 template <>
938 inline uint32_t
939 get_device_info_host<info::device::preferred_vector_width_short>() {
940  // TODO update when appropriate
941  return 1;
942 }
943 
944 template <>
945 inline uint32_t
946 get_device_info_host<info::device::preferred_vector_width_int>() {
947  // TODO update when appropriate
948  return 1;
949 }
950 
951 template <>
952 inline uint32_t
953 get_device_info_host<info::device::preferred_vector_width_long>() {
954  // TODO update when appropriate
955  return 1;
956 }
957 
958 template <>
959 inline uint32_t
960 get_device_info_host<info::device::preferred_vector_width_float>() {
961  // TODO update when appropriate
962  return 1;
963 }
964 
965 template <>
966 inline uint32_t
967 get_device_info_host<info::device::preferred_vector_width_double>() {
968  // TODO update when appropriate
969  return 1;
970 }
971 
972 template <>
973 inline uint32_t
974 get_device_info_host<info::device::preferred_vector_width_half>() {
975  // TODO update when appropriate
976  return 0;
977 }
978 
979 template <>
980 inline uint32_t get_device_info_host<info::device::native_vector_width_char>() {
981  return PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex::Char);
982 }
983 
984 template <>
985 inline uint32_t
986 get_device_info_host<info::device::native_vector_width_short>() {
987  return PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex::Short);
988 }
989 
990 template <>
991 inline uint32_t get_device_info_host<info::device::native_vector_width_int>() {
992  return PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex::Int);
993 }
994 
995 template <>
996 inline uint32_t get_device_info_host<info::device::native_vector_width_long>() {
997  return PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex::Long);
998 }
999 
1000 template <>
1001 inline uint32_t
1002 get_device_info_host<info::device::native_vector_width_float>() {
1003  return PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex::Float);
1004 }
1005 
1006 template <>
1007 inline uint32_t
1008 get_device_info_host<info::device::native_vector_width_double>() {
1009  return PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex::Double);
1010 }
1011 
1012 template <>
1013 inline uint32_t get_device_info_host<info::device::native_vector_width_half>() {
1014  return PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex::Half);
1015 }
1016 
1017 template <>
1018 inline uint32_t get_device_info_host<info::device::max_clock_frequency>() {
1019  return PlatformUtil::getMaxClockFrequency();
1020 }
1021 
1022 template <> inline uint32_t get_device_info_host<info::device::address_bits>() {
1023  return sizeof(void *) * 8;
1024 }
1025 
1026 template <>
1027 inline uint64_t get_device_info_host<info::device::global_mem_size>() {
1028  return static_cast<uint64_t>(OSUtil::getOSMemSize());
1029 }
1030 
1031 template <>
1032 inline uint64_t get_device_info_host<info::device::max_mem_alloc_size>() {
1033  // current value is the required minimum
1034  const uint64_t a = get_device_info_host<info::device::global_mem_size>() / 4;
1035  const uint64_t b = 128ul * 1024 * 1024;
1036  return (a > b) ? a : b;
1037 }
1038 
1039 template <> inline bool get_device_info_host<info::device::image_support>() {
1040  return true;
1041 }
1042 
1043 template <> inline bool get_device_info_host<info::device::atomic64>() {
1044  return false;
1045 }
1046 
1047 template <>
1048 inline std::vector<memory_order>
1049 get_device_info_host<info::device::atomic_memory_order_capabilities>() {
1050  return {memory_order::relaxed, memory_order::acquire, memory_order::release,
1051  memory_order::acq_rel, memory_order::seq_cst};
1052 }
1053 
1054 template <>
1055 inline std::vector<memory_order>
1056 get_device_info_host<info::device::atomic_fence_order_capabilities>() {
1057  return {memory_order::relaxed, memory_order::acquire, memory_order::release,
1058  memory_order::acq_rel};
1059 }
1060 
1061 template <>
1062 inline std::vector<memory_scope>
1063 get_device_info_host<info::device::atomic_memory_scope_capabilities>() {
1064  return {memory_scope::work_item, memory_scope::sub_group,
1065  memory_scope::work_group, memory_scope::device, memory_scope::system};
1066 }
1067 
1068 template <>
1069 inline std::vector<memory_scope>
1070 get_device_info_host<info::device::atomic_fence_scope_capabilities>() {
1071  return {memory_scope::work_item, memory_scope::sub_group,
1072  memory_scope::work_group, memory_scope::device, memory_scope::system};
1073 }
1074 
1075 template <>
1076 inline bool
1077 get_device_info_host<info::device::ext_oneapi_bfloat16_math_functions>() {
1078  return false;
1079 }
1080 
1081 template <>
1082 inline uint32_t get_device_info_host<info::device::max_read_image_args>() {
1083  // current value is the required minimum
1084  return 128;
1085 }
1086 
1087 template <>
1088 inline uint32_t get_device_info_host<info::device::max_write_image_args>() {
1089  // current value is the required minimum
1090  return 8;
1091 }
1092 
1093 template <>
1094 inline size_t get_device_info_host<info::device::image2d_max_width>() {
1095  // SYCL guarantees at least 8192. Some devices already known to provide more
1096  // than that (i.e. it is 16384 for opencl:gpu), which may create issues during
1097  // image object allocation on host.
1098  // Using any fixed number (i.e. 16384) brings the risk of having similar
1099  // issues on newer devices in future. Thus it does not make sense limiting
1100  // the returned value on host. Practially speaking the returned value on host
1101  // depends only on memory required for the image, which also depends on
1102  // the image channel_type and the image height. Both are not known in this
1103  // query, thus it becomes user's responsibility to choose proper image
1104  // parameters depending on similar query to (non-host device) and amount
1105  // of available/allocatable memory.
1107 }
1108 
1109 template <>
1110 inline size_t get_device_info_host<info::device::image2d_max_height>() {
1111  // SYCL guarantees at least 8192. Some devices already known to provide more
1112  // than that (i.e. it is 16384 for opencl:gpu), which may create issues during
1113  // image object allocation on host.
1114  // Using any fixed number (i.e. 16384) brings the risk of having similar
1115  // issues on newer devices in future. Thus it does not make sense limiting
1116  // the returned value on host. Practially speaking the returned value on host
1117  // depends only on memory required for the image, which also depends on
1118  // the image channel_type and the image width. Both are not known in this
1119  // query, thus it becomes user's responsibility to choose proper image
1120  // parameters depending on similar query to (non-host device) and amount
1121  // of available/allocatable memory.
1123 }
1124 
1125 template <>
1126 inline size_t get_device_info_host<info::device::image3d_max_width>() {
1127  // SYCL guarantees at least 8192. Some devices already known to provide more
1128  // than that (i.e. it is 16384 for opencl:gpu), which may create issues during
1129  // image object allocation on host.
1130  // Using any fixed number (i.e. 16384) brings the risk of having similar
1131  // issues on newer devices in future. Thus it does not make sense limiting
1132  // the returned value on host. Practially speaking the returned value on host
1133  // depends only on memory required for the image, which also depends on
1134  // the image channel_type and the image height/depth. Both are not known
1135  // in this query, thus it becomes user's responsibility to choose proper image
1136  // parameters depending on similar query to (non-host device) and amount
1137  // of available/allocatable memory.
1139 }
1140 
1141 template <>
1142 inline size_t get_device_info_host<info::device::image3d_max_height>() {
1143  // SYCL guarantees at least 8192. Some devices already known to provide more
1144  // than that (i.e. it is 16384 for opencl:gpu), which may create issues during
1145  // image object allocation on host.
1146  // Using any fixed number (i.e. 16384) brings the risk of having similar
1147  // issues on newer devices in future. Thus it does not make sense limiting
1148  // the returned value on host. Practially speaking the returned value on host
1149  // depends only on memory required for the image, which also depends on
1150  // the image channel_type and the image width/depth. Both are not known
1151  // in this query, thus it becomes user's responsibility to choose proper image
1152  // parameters depending on similar query to (non-host device) and amount
1153  // of available/allocatable memory.
1155 }
1156 
1157 template <>
1158 inline size_t get_device_info_host<info::device::image3d_max_depth>() {
1159  // SYCL guarantees at least 8192. Some devices already known to provide more
1160  // than that (i.e. it is 16384 for opencl:gpu), which may create issues during
1161  // image object allocation on host.
1162  // Using any fixed number (i.e. 16384) brings the risk of having similar
1163  // issues on newer devices in future. Thus it does not make sense limiting
1164  // the returned value on host. Practially speaking the returned value on host
1165  // depends only on memory required for the image, which also depends on
1166  // the image channel_type and the image height/width, which are not known
1167  // in this query, thus it becomes user's responsibility to choose proper image
1168  // parameters depending on similar query to (non-host device) and amount
1169  // of available/allocatable memory.
1171 }
1172 
1173 template <>
1174 inline size_t get_device_info_host<info::device::image_max_buffer_size>() {
1175  // Not supported in SYCL
1176  return 0;
1177 }
1178 
1179 template <>
1180 inline size_t get_device_info_host<info::device::image_max_array_size>() {
1181  // current value is the required minimum
1182  return 2048;
1183 }
1184 
1185 template <> inline uint32_t get_device_info_host<info::device::max_samplers>() {
1186  // current value is the required minimum
1187  return 16;
1188 }
1189 
1190 template <>
1191 inline size_t get_device_info_host<info::device::max_parameter_size>() {
1192  // current value is the required minimum
1193  return 1024;
1194 }
1195 
1196 template <>
1197 inline uint32_t get_device_info_host<info::device::mem_base_addr_align>() {
1198  return 1024;
1199 }
1200 
1201 template <>
1202 inline std::vector<info::fp_config>
1203 get_device_info_host<info::device::half_fp_config>() {
1204  // current value is the required minimum
1205  return {};
1206 }
1207 
1208 template <>
1209 inline std::vector<info::fp_config>
1210 get_device_info_host<info::device::single_fp_config>() {
1211  // current value is the required minimum
1212  return {info::fp_config::round_to_nearest, info::fp_config::inf_nan};
1213 }
1214 
1215 template <>
1216 inline std::vector<info::fp_config>
1217 get_device_info_host<info::device::double_fp_config>() {
1218  // current value is the required minimum
1219  return {info::fp_config::fma, info::fp_config::round_to_nearest,
1220  info::fp_config::round_to_zero, info::fp_config::round_to_inf,
1221  info::fp_config::inf_nan, info::fp_config::denorm};
1222 }
1223 
1224 template <>
1226 get_device_info_host<info::device::global_mem_cache_type>() {
1228 }
1229 
1230 template <>
1231 inline uint32_t
1232 get_device_info_host<info::device::global_mem_cache_line_size>() {
1233  return PlatformUtil::getMemCacheLineSize();
1234 }
1235 
1236 template <>
1237 inline uint64_t get_device_info_host<info::device::global_mem_cache_size>() {
1238  return PlatformUtil::getMemCacheSize();
1239 }
1240 
1241 template <>
1242 inline uint64_t get_device_info_host<info::device::max_constant_buffer_size>() {
1243  // current value is the required minimum
1244  return 64 * 1024;
1245 }
1246 
1247 template <>
1248 inline uint32_t get_device_info_host<info::device::max_constant_args>() {
1249  // current value is the required minimum
1250  return 8;
1251 }
1252 
1253 template <>
1254 inline info::local_mem_type
1255 get_device_info_host<info::device::local_mem_type>() {
1256  return info::local_mem_type::global;
1257 }
1258 
1259 template <>
1260 inline uint64_t get_device_info_host<info::device::local_mem_size>() {
1261  // current value is the required minimum
1262  return 32 * 1024;
1263 }
1264 
1265 template <>
1266 inline bool get_device_info_host<info::device::error_correction_support>() {
1267  return false;
1268 }
1269 
1270 template <>
1271 inline bool get_device_info_host<info::device::host_unified_memory>() {
1272  return true;
1273 }
1274 
1275 template <>
1276 inline size_t get_device_info_host<info::device::profiling_timer_resolution>() {
1277  typedef std::ratio_divide<std::chrono::high_resolution_clock::period,
1278  std::nano>
1279  ns_period;
1280  return ns_period::num / ns_period::den;
1281 }
1282 
1283 template <> inline bool get_device_info_host<info::device::is_endian_little>() {
1284  union {
1285  uint16_t a;
1286  uint8_t b[2];
1287  } u = {0x0100};
1288 
1289  return u.b[1];
1290 }
1291 
1292 template <> inline bool get_device_info_host<info::device::is_available>() {
1293  return true;
1294 }
1295 
1296 template <>
1297 inline bool get_device_info_host<info::device::is_compiler_available>() {
1298  return true;
1299 }
1300 
1301 template <>
1302 inline bool get_device_info_host<info::device::is_linker_available>() {
1303  return true;
1304 }
1305 
1306 template <>
1307 inline std::vector<info::execution_capability>
1308 get_device_info_host<info::device::execution_capabilities>() {
1309  return {info::execution_capability::exec_kernel};
1310 }
1311 
1312 template <> inline bool get_device_info_host<info::device::queue_profiling>() {
1313  return true;
1314 }
1315 
1316 template <>
1317 inline std::vector<kernel_id>
1318 get_device_info_host<info::device::built_in_kernel_ids>() {
1319  return {};
1320 }
1321 
1322 template <>
1323 inline std::vector<std::string>
1324 get_device_info_host<info::device::built_in_kernels>() {
1325  return {};
1326 }
1327 
1328 template <> inline platform get_device_info_host<info::device::platform>() {
1329  return createSyclObjFromImpl<platform>(platform_impl::getHostPlatformImpl());
1330 }
1331 
1332 template <> inline std::string get_device_info_host<info::device::name>() {
1333  return "SYCL host device";
1334 }
1335 
1336 template <> inline std::string get_device_info_host<info::device::vendor>() {
1337  return "";
1338 }
1339 
1340 template <>
1341 inline std::string get_device_info_host<info::device::driver_version>() {
1342  return "1.2";
1343 }
1344 
1345 template <> inline std::string get_device_info_host<info::device::profile>() {
1346  return "FULL PROFILE";
1347 }
1348 
1349 template <> inline std::string get_device_info_host<info::device::version>() {
1350  return "1.2";
1351 }
1352 
1353 template <>
1354 inline std::string get_device_info_host<info::device::opencl_c_version>() {
1355  return "not applicable";
1356 }
1357 
1358 template <>
1359 inline std::vector<std::string>
1360 get_device_info_host<info::device::extensions>() {
1361  // TODO update when appropriate
1362  return {};
1363 }
1364 
1365 template <>
1366 inline size_t get_device_info_host<info::device::printf_buffer_size>() {
1367  // current value is the required minimum
1368  return 1024 * 1024;
1369 }
1370 
1371 template <>
1372 inline bool get_device_info_host<info::device::preferred_interop_user_sync>() {
1373  return false;
1374 }
1375 
1376 template <> inline device get_device_info_host<info::device::parent_device>() {
1377  throw invalid_object_error(
1378  "Partitioning to subdevices of the host device is not implemented",
1379  PI_ERROR_INVALID_DEVICE);
1380 }
1381 
1382 template <>
1383 inline uint32_t
1384 get_device_info_host<info::device::partition_max_sub_devices>() {
1385  // TODO update once subdevice creation is enabled
1386  return 1;
1387 }
1388 
1389 template <>
1390 inline std::vector<info::partition_property>
1391 get_device_info_host<info::device::partition_properties>() {
1392  // TODO update once subdevice creation is enabled
1393  return {};
1394 }
1395 
1396 template <>
1397 inline std::vector<info::partition_affinity_domain>
1398 get_device_info_host<info::device::partition_affinity_domains>() {
1399  // TODO update once subdevice creation is enabled
1400  return {};
1401 }
1402 
1403 template <>
1405 get_device_info_host<info::device::partition_type_property>() {
1406  return info::partition_property::no_partition;
1407 }
1408 
1409 template <>
1411 get_device_info_host<info::device::partition_type_affinity_domain>() {
1412  // TODO update once subdevice creation is enabled
1413  return info::partition_affinity_domain::not_applicable;
1414 }
1415 
1416 template <>
1417 inline uint32_t get_device_info_host<info::device::reference_count>() {
1418  // TODO update once subdevice creation is enabled
1419  return 1;
1420 }
1421 
1422 template <>
1423 inline uint32_t get_device_info_host<info::device::max_num_sub_groups>() {
1424  // TODO update once subgroups are enabled
1425  throw runtime_error("Sub-group feature is not supported on HOST device.",
1426  PI_ERROR_INVALID_DEVICE);
1427 }
1428 
1429 template <>
1430 inline std::vector<size_t>
1431 get_device_info_host<info::device::sub_group_sizes>() {
1432  // TODO update once subgroups are enabled
1433  throw runtime_error("Sub-group feature is not supported on HOST device.",
1434  PI_ERROR_INVALID_DEVICE);
1435 }
1436 
1437 template <>
1438 inline bool
1439 get_device_info_host<info::device::sub_group_independent_forward_progress>() {
1440  // TODO update once subgroups are enabled
1441  throw runtime_error("Sub-group feature is not supported on HOST device.",
1442  PI_ERROR_INVALID_DEVICE);
1443 }
1444 
1445 template <>
1446 inline bool get_device_info_host<info::device::kernel_kernel_pipe_support>() {
1447  return false;
1448 }
1449 
1450 template <>
1451 inline std::string get_device_info_host<info::device::backend_version>() {
1452  throw runtime_error(
1453  "Backend version feature is not supported on HOST device.",
1454  PI_ERROR_INVALID_DEVICE);
1455 }
1456 
1457 template <>
1458 inline bool get_device_info_host<info::device::usm_device_allocations>() {
1459  return true;
1460 }
1461 
1462 template <>
1463 inline bool get_device_info_host<info::device::usm_host_allocations>() {
1464  return true;
1465 }
1466 
1467 template <>
1468 inline bool get_device_info_host<info::device::usm_shared_allocations>() {
1469  return true;
1470 }
1471 
1472 template <>
1473 inline bool
1474 get_device_info_host<info::device::usm_restricted_shared_allocations>() {
1475  return true;
1476 }
1477 
1478 template <>
1479 inline bool get_device_info_host<info::device::usm_system_allocations>() {
1480  return true;
1481 }
1482 
1483 template <>
1484 inline bool get_device_info_host<info::device::ext_intel_mem_channel>() {
1485  return false;
1486 }
1487 
1488 // Specializations for intel extensions for Level Zero low-level
1489 // detail device descriptors (not support on host).
1490 template <>
1491 inline uint32_t
1492 get_device_info_host<ext::intel::info::device::device_id>() {
1493  throw runtime_error(
1494  "Obtaining the device ID is not supported on HOST device",
1495  PI_ERROR_INVALID_DEVICE);
1496 }
1497 template <>
1498 inline std::string
1499 get_device_info_host<ext::intel::info::device::pci_address>() {
1500  throw runtime_error(
1501  "Obtaining the PCI address is not supported on HOST device",
1502  PI_ERROR_INVALID_DEVICE);
1503 }
1504 template <>
1505 inline uint32_t get_device_info_host<ext::intel::info::device::gpu_eu_count>() {
1506  throw runtime_error("Obtaining the EU count is not supported on HOST device",
1507  PI_ERROR_INVALID_DEVICE);
1508 }
1509 template <>
1510 inline uint32_t
1511 get_device_info_host<ext::intel::info::device::gpu_eu_simd_width>() {
1512  throw runtime_error(
1513  "Obtaining the EU SIMD width is not supported on HOST device",
1514  PI_ERROR_INVALID_DEVICE);
1515 }
1516 template <>
1517 inline uint32_t get_device_info_host<ext::intel::info::device::gpu_slices>() {
1518  throw runtime_error(
1519  "Obtaining the number of slices is not supported on HOST device",
1520  PI_ERROR_INVALID_DEVICE);
1521 }
1522 template <>
1523 inline uint32_t
1524 get_device_info_host<ext::intel::info::device::gpu_subslices_per_slice>() {
1525  throw runtime_error("Obtaining the number of subslices per slice is not "
1526  "supported on HOST device",
1527  PI_ERROR_INVALID_DEVICE);
1528 }
1529 template <>
1530 inline uint32_t
1531 get_device_info_host<ext::intel::info::device::gpu_eu_count_per_subslice>() {
1532  throw runtime_error(
1533  "Obtaining the EU count per subslice is not supported on HOST device",
1534  PI_ERROR_INVALID_DEVICE);
1535 }
1536 template <>
1537 inline uint32_t
1538 get_device_info_host<ext::intel::info::device::gpu_hw_threads_per_eu>() {
1539  throw runtime_error(
1540  "Obtaining the HW threads count per EU is not supported on HOST device",
1541  PI_ERROR_INVALID_DEVICE);
1542 }
1543 template <>
1544 inline uint64_t
1545 get_device_info_host<ext::intel::info::device::max_mem_bandwidth>() {
1546  throw runtime_error(
1547  "Obtaining the maximum memory bandwidth is not supported on HOST device",
1548  PI_ERROR_INVALID_DEVICE);
1549 }
1550 template <>
1551 inline detail::uuid_type
1552 get_device_info_host<ext::intel::info::device::uuid>() {
1553  throw runtime_error(
1554  "Obtaining the device uuid is not supported on HOST device",
1555  PI_ERROR_INVALID_DEVICE);
1556 }
1557 
1558 // TODO: Remove with deprecated feature
1559 // device::get_info<info::device::ext_intel_pci_address>()
1560 template <>
1561 inline std::string get_device_info_host<info::device::ext_intel_pci_address>() {
1562  throw runtime_error(
1563  "Obtaining the PCI address is not supported on HOST device",
1564  PI_ERROR_INVALID_DEVICE);
1565 }
1566 // TODO: Remove with deprecated feature
1567 // device::get_info<info::device::ext_intel_gpu_eu_count>()
1568 template <>
1569 inline uint32_t get_device_info_host<info::device::ext_intel_gpu_eu_count>() {
1570  throw runtime_error("Obtaining the EU count is not supported on HOST device",
1571  PI_ERROR_INVALID_DEVICE);
1572 }
1573 // TODO: Remove with deprecated feature
1574 // device::get_info<info::device::ext_intel_gpu_eu_simd_width>()
1575 template <>
1576 inline uint32_t
1577 get_device_info_host<info::device::ext_intel_gpu_eu_simd_width>() {
1578  throw runtime_error(
1579  "Obtaining the EU SIMD width is not supported on HOST device",
1580  PI_ERROR_INVALID_DEVICE);
1581 }
1582 // TODO: Remove with deprecated feature
1583 // device::get_info<info::device::ext_intel_gpu_slices>()
1584 template <>
1585 inline uint32_t get_device_info_host<info::device::ext_intel_gpu_slices>() {
1586  throw runtime_error(
1587  "Obtaining the number of slices is not supported on HOST device",
1588  PI_ERROR_INVALID_DEVICE);
1589 }
1590 // TODO: Remove with deprecated feature
1591 // device::get_info<info::device::ext_intel_gpu_subslices_per_slice>()
1592 template <>
1593 inline uint32_t
1594 get_device_info_host<info::device::ext_intel_gpu_subslices_per_slice>() {
1595  throw runtime_error("Obtaining the number of subslices per slice is not "
1596  "supported on HOST device",
1597  PI_ERROR_INVALID_DEVICE);
1598 }
1599 // TODO: Remove with deprecated feature
1600 // device::get_info<info::device::ext_intel_gpu_eu_count_per_subslices>()
1601 template <>
1602 inline uint32_t
1603 get_device_info_host<info::device::ext_intel_gpu_eu_count_per_subslice>() {
1604  throw runtime_error(
1605  "Obtaining the EU count per subslice is not supported on HOST device",
1606  PI_ERROR_INVALID_DEVICE);
1607 }
1608 // TODO: Remove with deprecated feature
1609 // device::get_info<info::device::ext_intel_gpu_hw_threads_per_eu>()
1610 template <>
1611 inline uint32_t
1612 get_device_info_host<info::device::ext_intel_gpu_hw_threads_per_eu>() {
1613  throw runtime_error(
1614  "Obtaining the HW threads count per EU is not supported on HOST device",
1615  PI_ERROR_INVALID_DEVICE);
1616 }
1617 // TODO: Remove with deprecated feature
1618 // device::get_info<info::device::ext_intel_max_mem_bandwidth>()
1619 template <>
1620 inline uint64_t
1621 get_device_info_host<info::device::ext_intel_max_mem_bandwidth>() {
1622  throw runtime_error(
1623  "Obtaining the maximum memory bandwidth is not supported on HOST device",
1624  PI_ERROR_INVALID_DEVICE);
1625 }
1626 // TODO:Move to namespace ext::intel::info::device
1627 template <> inline bool get_device_info_host<info::device::ext_oneapi_srgb>() {
1628  return false;
1629 }
1630 
1631 // TODO: Remove with deprecated feature
1632 // device::get_info<info::device::ext_intel_device_info_uuid>()
1633 template <>
1634 inline detail::uuid_type
1635 get_device_info_host<info::device::ext_intel_device_info_uuid>() {
1636  throw runtime_error(
1637  "Obtaining the device uuid is not supported on HOST device",
1638  PI_ERROR_INVALID_DEVICE);
1639 }
1640 
1641 template <>
1642 inline uint64_t get_device_info_host<ext::intel::info::device::free_memory>() {
1643  throw runtime_error(
1644  "Obtaining the device free memory is not supported on HOST device",
1645  PI_ERROR_INVALID_DEVICE);
1646 }
1647 
1648 template <>
1649 inline uint32_t
1650 get_device_info_host<ext::intel::info::device::memory_clock_rate>() {
1651  throw runtime_error(
1652  "Obtaining the device memory clock rate is not supported on HOST device",
1653  PI_ERROR_INVALID_DEVICE);
1654 }
1655 
1656 template <>
1657 inline uint32_t
1658 get_device_info_host<ext::intel::info::device::memory_bus_width>() {
1659  throw runtime_error(
1660  "Obtaining the device memory bus width is not supported on HOST device",
1661  PI_ERROR_INVALID_DEVICE);
1662 }
1663 
1664 template <>
1665 inline int32_t
1666 get_device_info_host<ext::intel::info::device::max_compute_queue_indices>() {
1667  throw runtime_error(
1668  "Obtaining max compute queue indices is not supported on HOST device",
1669  PI_ERROR_INVALID_DEVICE);
1670 }
1671 
1672 template <>
1673 inline bool get_device_info_host<
1674  ext::codeplay::experimental::info::device::supports_fusion>() {
1675  // No support for fusion on the host device.
1676  return false;
1677 }
1678 
1679 } // namespace detail
1680 } // __SYCL_INLINE_VER_NAMESPACE(_V1)
1681 } // namespace sycl
sycl::_V1::detail::get_device_info_impl< bool, info::device::queue_profiling >::get
static bool get(RT::PiDevice Dev, const plugin &Plugin)
Definition: device_info.hpp:249
sycl::_V1::detail::construct_id
id< Dimensions > construct_id(size_t *values)=delete
sycl::_V1::info::partition_affinity_domain
partition_affinity_domain
Definition: info_desc.hpp:63
sycl::_V1::detail::get_device_info_impl< size_t, ext::oneapi::experimental::info::device::max_global_work_groups >::get
static size_t get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:572
sycl::_V1::detail::check_fp_support< info::device::half_fp_config >::type
info::device::native_vector_width_half type
Definition: device_info.hpp:125
PI_USM_ACCESS
@ PI_USM_ACCESS
Definition: pi.h:1689
sycl::_V1::detail::get_device_info_impl< bool, info::device::kernel_kernel_pipe_support >::get
static bool get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:527
sycl::_V1::detail::pi::PiDeviceInfo
::pi_device_info PiDeviceInfo
Definition: pi.hpp:126
sycl::_V1::detail::read_execution_bitfield
std::vector< info::execution_capability > read_execution_bitfield(pi_device_exec_capabilities bits)
Definition: device_info.hpp:72
PI_DEVICE_AFFINITY_DOMAIN_L4_CACHE
static constexpr pi_device_affinity_domain PI_DEVICE_AFFINITY_DOMAIN_L4_CACHE
Definition: pi.h:690
sycl::_V1::detail::get_device_info_impl< bool, info::device::ext_oneapi_bfloat16_math_functions >::get
static bool get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:322
sycl::_V1::detail::construct_id< 2 >
id< 2 > construct_id< 2 >(size_t *values)
Definition: device_info.hpp:549
_pi_usm_capabilities
_pi_usm_capabilities
Definition: pi.h:1688
pi_bool
pi_uint32 pi_bool
Definition: pi.h:131
sycl::_V1::detail::get_device_info_impl< bool, info::device::usm_shared_allocations >::get
static bool get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:732
sycl::_V1::info::partition_property
partition_property
Definition: info_desc.hpp:55
sycl::_V1::detail::is_device_info_desc
Definition: info_desc_helpers.hpp:21
device.hpp
sycl::_V1::detail::plugin::checkPiResult
void checkPiResult(RT::PiResult pi_result) const
Checks return value from PI calls.
Definition: plugin.hpp:116
__SYCL_INLINE_VER_NAMESPACE
#define __SYCL_INLINE_VER_NAMESPACE(X)
Definition: defines_elementary.hpp:11
sycl::_V1::detail::get_device_info_impl< std::vector< memory_scope >, info::device::atomic_memory_scope_capabilities >::get
static std::vector< memory_scope > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:296
sycl::_V1::ext::oneapi::fma
std::enable_if_t< detail::is_bf16_storage_type< T >::value, T > fma(T x, T y, T z)
Definition: bf16_storage_builtins.hpp:71
pi_usm_capabilities
_pi_usm_capabilities pi_usm_capabilities
Definition: pi.h:1717
_pi_result
_pi_result
Definition: pi.h:140
sycl::_V1::detail::readMemoryOrderBitfield
std::vector< memory_order > readMemoryOrderBitfield(pi_memory_order_capabilities bits)
Definition: memory_enums.hpp:49
sycl::_V1::detail::get_device_info_impl< std::vector< memory_order >, info::device::atomic_fence_order_capabilities >::get
static std::vector< memory_order > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:283
sycl::_V1::detail::get_device_info_impl< std::vector< std::string >, info::device::extensions >::get
static std::vector< std::string > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:383
sycl::_V1::detail::sycl_to_pi::type
T type
Definition: device_info.hpp:109
sycl::_V1::detail::pi::PiDevice
::pi_device PiDevice
Definition: pi.hpp:124
sycl::_V1::detail::get_device_info_impl< std::vector< kernel_id >, info::device::built_in_kernel_ids >::get
static std::vector< kernel_id > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:354
os_util.hpp
sycl::_V1::detail::get_device_info_impl< bool, info::device::ext_intel_mem_channel >::get
static bool get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:772
sycl::_V1::detail::get_device_info_impl< bool, info::device::usm_system_allocations >::get
static bool get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:760
sycl::_V1::Dimensions
class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(local_accessor) local_accessor class __SYCL_EBO __SYCL_SPECIAL_CLASS Dimensions
Definition: accessor.hpp:2854
sycl
---— Error handling, matching OpenCL plugin semantics.
Definition: access.hpp:14
sycl::_V1::detail::get_device_info_impl< std::string, Param >::get
static std::string get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:179
sycl::_V1::detail::PiInfoCode
Definition: info_desc_helpers.hpp:18
device_impl.hpp
plugin.hpp
sycl::_V1::detail::plugin::getBackend
backend getBackend(void) const
Definition: plugin.hpp:229
max
simd< _Tp, _Abi > max(const simd< _Tp, _Abi > &, const simd< _Tp, _Abi > &) noexcept
sycl::_V1::detail::get_device_info_impl< bool, info::device::usm_restricted_shared_allocations >::get
static bool get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:745
sycl::_V1::detail::pi::PiPlatform
::pi_platform PiPlatform
Definition: pi.hpp:123
sycl::_V1::detail::get_device_info_impl< std::vector< info::fp_config >, Param >::get
static std::vector< info::fp_config > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:193
PI_FP_ROUND_TO_NEAREST
static constexpr pi_device_fp_config PI_FP_ROUND_TO_NEAREST
Definition: pi.h:705
pi.hpp
sycl::_V1::id
A unique identifier of an item in an index space.
Definition: array.hpp:17
sycl::_V1::ext::oneapi::experimental::info::device::max_work_groups
Definition: info_desc.hpp:188
sycl::_V1::detail::construct_id< 3 >
id< 3 > construct_id< 3 >(size_t *values)
Definition: device_info.hpp:552
sycl::_V1::detail::get_device_info_impl< platform, Param >::get
static platform get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:147
sycl::_V1::detail::get_device_info_impl< std::string, info::device::version >::get
static std::string get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:210
sycl::_V1::info::local_mem_type
local_mem_type
Definition: info_desc.hpp:73
PI_DEVICE_AFFINITY_DOMAIN_L3_CACHE
static constexpr pi_device_affinity_domain PI_DEVICE_AFFINITY_DOMAIN_L3_CACHE
Definition: pi.h:692
std::get
constexpr tuple_element< I, tuple< Types... > >::type & get(sycl::detail::tuple< Types... > &Arg) noexcept
Definition: tuple.hpp:199
sycl::_V1::detail::plugin
The plugin class provides a unified interface to the underlying low-level runtimes for the device-agn...
Definition: plugin.hpp:90
sycl::_V1::detail::get_device_info_impl< id< Dimensions >, info::device::max_work_item_sizes< Dimensions > >::get
static id< Dimensions > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:560
PI_EXEC_KERNEL
static constexpr pi_device_exec_capabilities PI_EXEC_KERNEL
Definition: pi.h:715
sycl::_V1::detail::get_device_info_impl< bool, info::device::usm_host_allocations >::get
static bool get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:719
sycl::_V1::detail::sycl_to_pi< bool >::type
pi_bool type
Definition: device_info.hpp:112
platform_impl.hpp
sycl::_V1::detail::pi::PiResult
::pi_result PiResult
Definition: pi.hpp:122
PI_FP_SOFT_FLOAT
static constexpr pi_device_fp_config PI_FP_SOFT_FLOAT
Definition: pi.h:709
sycl::_V1::detail::get_device_info_impl< device, info::device::parent_device >::get
static device get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:683
sycl::_V1::detail::split_string
std::vector< std::string > split_string(const std::string &str, char delimeter)
Definition: common.cpp:74
sycl::_V1::detail::get_device_info_impl< std::vector< info::execution_capability >, info::device::execution_capabilities >::get
static std::vector< info::execution_capability > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:340
sycl::_V1::detail::get_device_info_impl< size_t, info::device::ext_oneapi_max_global_work_groups >::get
static size_t get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:638
PI_FP_DENORM
static constexpr pi_device_fp_config PI_FP_DENORM
Definition: pi.h:703
PI_USM_CONCURRENT_ACCESS
@ PI_USM_CONCURRENT_ACCESS
Definition: pi.h:1691
sycl::_V1::detail::get_device_info_impl< std::vector< info::fp_config >, info::device::single_fp_config >::get
static std::vector< info::fp_config > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:236
sycl::_V1::detail::get_device_info_impl< id< 1 >, ext::oneapi::experimental::info::device::max_work_groups< 1 > >::get
static id< 1 > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:581
sycl::_V1::detail::get_device_info_impl< std::vector< info::partition_property >, info::device::partition_properties >::get
static std::vector< info::partition_property > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:407
sycl::_V1::detail::uuid_type
std::array< unsigned char, 16 > uuid_type
Definition: type_traits.hpp:83
sycl::_V1::detail::readMemoryScopeBitfield
std::vector< memory_scope > readMemoryScopeBitfield(pi_memory_scope_capabilities bits)
Definition: memory_enums.hpp:65
sycl::_V1::detail::sycl_to_pi< platform >::type
RT::PiPlatform type
Definition: device_info.hpp:118
defines.hpp
piDeviceGetInfo
pi_result piDeviceGetInfo(pi_device device, pi_device_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Returns requested info for provided native device Return PI_DEVICE_INFO_EXTENSION_DEVICELIB_ASSERT fo...
Definition: pi_esimd_emulator.cpp:592
sycl::_V1::detail::sycl_to_pi< device >::type
RT::PiDevice type
Definition: device_info.hpp:115
sycl::_V1::detail::get_device_info
Param::return_type get_device_info(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:801
sycl::_V1::detail::get_device_info_impl< id< 2 >, info::device::ext_oneapi_max_work_groups_2d >::get
static id< 2 > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:662
__SYCL_AFFINITY_DOMAIN_STRING_CASE
#define __SYCL_AFFINITY_DOMAIN_STRING_CASE(DOMAIN)
PI_FP_ROUND_TO_INF
static constexpr pi_device_fp_config PI_FP_ROUND_TO_INF
Definition: pi.h:707
sycl::_V1::device
The SYCL device class encapsulates a single SYCL device on which kernels may be executed.
Definition: device.hpp:49
sycl::_V1::detail::construct_id< 1 >
id< 1 > construct_id< 1 >(size_t *values)
Definition: device_info.hpp:548
PI_DEVICE_INFO_PARTITION_TYPE
@ PI_DEVICE_INFO_PARTITION_TYPE
Definition: pi.h:285
pi_memory_scope_capabilities
pi_bitfield pi_memory_scope_capabilities
Definition: pi.h:567
pi_mem_properties
pi_bitfield pi_mem_properties
Definition: pi.h:601
pi_device_exec_capabilities
pi_bitfield pi_device_exec_capabilities
Definition: pi.h:548
sycl::_V1::read_write
constexpr mode_tag_t< access_mode::read_write > read_write
Definition: access.hpp:74
sycl::_V1::detail::get_device_info_impl< info::partition_affinity_domain, info::device::partition_type_affinity_domain >::get
static info::partition_affinity_domain get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:456
sycl::_V1::info::device_type
device_type
Definition: info_desc.hpp:44
piGetDeviceAndHostTimer
pi_result piGetDeviceAndHostTimer(pi_device Device, uint64_t *DeviceTime, uint64_t *HostTime)
Queries device for it's global timestamp in nanoseconds, and updates HostTime with the value of the h...
Definition: pi_esimd_emulator.cpp:2074
sycl::_V1::detail::get_device_info_impl< std::vector< memory_scope >, info::device::atomic_fence_scope_capabilities >::get
static std::vector< memory_scope > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:309
program_manager.hpp
sycl::_V1::detail::get_device_info_impl::get
static ReturnT get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:137
sycl::_V1::detail::get_device_info_impl< id< 1 >, info::device::ext_oneapi_max_work_groups_1d >::get
static id< 1 > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:650
sycl::_V1::detail::get_device_info_impl
Definition: device_info.hpp:136
sycl::_V1::detail::plugin::call_nocheck
RT::PiResult call_nocheck(ArgsT... Args) const
Calls the PiApi, traces the call, and returns the result.
Definition: plugin.hpp:170
platform_util.hpp
pi_device_fp_config
pi_bitfield pi_device_fp_config
Definition: pi.h:702
sycl::_V1::detail::get_device_info_impl< info::partition_property, info::device::partition_type_property >::get
static info::partition_property get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:485
sycl::_V1::detail::sycl_to_pi
Definition: device_info.hpp:108
sycl::_V1::detail::get_device_info_impl< id< 2 >, ext::oneapi::experimental::info::device::max_work_groups< 2 > >::get
static id< 2 > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:599
PI_FP_FMA
static constexpr pi_device_fp_config PI_FP_FMA
Definition: pi.h:708
sycl::_V1::detail::get_device_info_impl< id< 3 >, ext::oneapi::experimental::info::device::max_work_groups< 3 > >::get
static id< 3 > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:617
platform.hpp
pi_queue_properties
pi_bitfield pi_queue_properties
Definition: pi.h:620
PI_DEVICE_AFFINITY_DOMAIN_NUMA
static constexpr pi_device_affinity_domain PI_DEVICE_AFFINITY_DOMAIN_NUMA
Definition: pi.h:688
PI_MEM_PROPERTIES_CHANNEL
constexpr pi_mem_properties PI_MEM_PROPERTIES_CHANNEL
Definition: pi.h:602
sycl::_V1::detail::plugin::call
void call(ArgsT... Args) const
Calls the API, traces the call, checks the result.
Definition: plugin.hpp:217
std
Definition: accessor.hpp:3230
PI_FP_INF_NAN
static constexpr pi_device_fp_config PI_FP_INF_NAN
Definition: pi.h:704
sycl::_V1::detail::check_fp_support< info::device::double_fp_config >::type
info::device::native_vector_width_double type
Definition: device_info.hpp:129
PI_EXEC_NATIVE_KERNEL
static constexpr pi_device_exec_capabilities PI_EXEC_NATIVE_KERNEL
Definition: pi.h:716
PI_DEVICE_AFFINITY_DOMAIN_L1_CACHE
static constexpr pi_device_affinity_domain PI_DEVICE_AFFINITY_DOMAIN_L1_CACHE
Definition: pi.h:696
PI_DEVICE_AFFINITY_DOMAIN_L2_CACHE
static constexpr pi_device_affinity_domain PI_DEVICE_AFFINITY_DOMAIN_L2_CACHE
Definition: pi.h:694
sycl::_V1::detail::read_domain_bitfield
std::vector< info::partition_affinity_domain > read_domain_bitfield(pi_device_affinity_domain bits)
Definition: device_info.hpp:54
sycl::_V1::detail::get_device_info_impl< id< 3 >, info::device::ext_oneapi_max_work_groups_3d >::get
static id< 3 > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:674
memory_enums.hpp
sycl::_V1::detail::get_device_info_impl< std::vector< info::partition_affinity_domain >, info::device::partition_affinity_domains >::get
static std::vector< info::partition_affinity_domain > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:442
sycl::_V1::detail::get_device_info_impl< bool, info::device::usm_device_allocations >::get
static bool get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:706
info_desc.hpp
sycl::_V1::detail::get_device_info_impl< std::vector< memory_order >, info::device::atomic_memory_order_capabilities >::get
static std::vector< memory_order > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:270
sycl::_V1::detail::get_device_info_impl< bool, ext::codeplay::experimental::info::device::supports_fusion >::get
static bool get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:785
sycl::_V1::detail::is_sycl_partition_property
static bool is_sycl_partition_property(info::partition_property PP)
Definition: device_info.hpp:391
PI_QUEUE_FLAG_PROFILING_ENABLE
constexpr pi_queue_properties PI_QUEUE_FLAG_PROFILING_ENABLE
Definition: pi.h:625
sycl::_V1::detail::check_fp_support
Definition: device_info.hpp:122
PI_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT
static constexpr pi_device_fp_config PI_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT
Definition: pi.h:710
sycl::_V1::platform
Encapsulates a SYCL platform on which kernels may be executed.
Definition: platform.hpp:45
pi_device_affinity_domain
pi_bitfield pi_device_affinity_domain
Definition: pi.h:687
sycl::_V1::detail::get_device_info_impl< std::vector< size_t >, info::device::sub_group_sizes >::get
static std::vector< size_t > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:508
common_info.hpp
sycl::_V1::detail::get_device_info_impl< std::vector< std::string >, info::device::built_in_kernels >::get
static std::vector< std::string > get(RT::PiDevice dev, const plugin &Plugin)
Definition: device_info.hpp:372
pi_memory_order_capabilities
pi_bitfield pi_memory_order_capabilities
Definition: pi.h:560
sycl::_V1::platform::get_info
detail::is_platform_info_desc< Param >::return_type get_info() const
Queries this SYCL platform for info.
Definition: platform.cpp:61
sycl::_V1::detail::read_fp_bitfield
std::vector< info::fp_config > read_fp_bitfield(pi_device_fp_config bits)
Definition: device_info.hpp:32
sycl::_V1::detail::get_device_info_host
Param::return_type get_device_info_host()=delete
PI_FP_ROUND_TO_ZERO
static constexpr pi_device_fp_config PI_FP_ROUND_TO_ZERO
Definition: pi.h:706
sycl::_V1::detail::get_device_info_string
std::string get_device_info_string(RT::PiDevice dev, RT::PiDeviceInfo InfoCode, const plugin &Plugin)
Definition: device_info.hpp:161
sycl::_V1::info::global_mem_cache_type
global_mem_cache_type
Definition: info_desc.hpp:86
PI_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE
static constexpr pi_device_affinity_domain PI_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE
Definition: pi.h:699
sycl::_V1::detail::affinityDomainToString
std::string affinityDomainToString(info::partition_affinity_domain AffinityDomain)
Definition: device_info.hpp:82