15
15
#include < sycl/detail/ur.hpp>
16
16
#include < sycl/ext/oneapi/experimental/device_architecture.hpp>
17
17
#include < sycl/ext/oneapi/experimental/forward_progress.hpp>
18
+ #include < sycl/info/info_desc.hpp>
18
19
#include < sycl/kernel_bundle.hpp>
19
20
#include < sycl/platform.hpp>
20
21
@@ -28,6 +29,40 @@ inline namespace _V1 {
28
29
29
30
namespace detail {
30
31
32
+ inline info::partition_property
33
+ ConvertPartitionProperty (const ur_device_partition_t &Partition) {
34
+ switch (Partition) {
35
+ case UR_DEVICE_PARTITION_EQUALLY:
36
+ return info::partition_property::partition_equally;
37
+ case UR_DEVICE_PARTITION_BY_COUNTS:
38
+ return info::partition_property::partition_by_counts;
39
+ case UR_DEVICE_PARTITION_BY_AFFINITY_DOMAIN:
40
+ return info::partition_property::partition_by_affinity_domain;
41
+ case UR_DEVICE_PARTITION_BY_CSLICE:
42
+ return info::partition_property::ext_intel_partition_by_cslice;
43
+ default :
44
+ return info::partition_property::no_partition;
45
+ }
46
+ }
47
+
48
+ inline info::partition_affinity_domain
49
+ ConvertAffinityDomain (const ur_device_affinity_domain_flags_t Domain) {
50
+ switch (Domain) {
51
+ case UR_DEVICE_AFFINITY_DOMAIN_FLAG_NUMA:
52
+ return info::partition_affinity_domain::numa;
53
+ case UR_DEVICE_AFFINITY_DOMAIN_FLAG_L1_CACHE:
54
+ return info::partition_affinity_domain::L1_cache;
55
+ case UR_DEVICE_AFFINITY_DOMAIN_FLAG_L2_CACHE:
56
+ return info::partition_affinity_domain::L2_cache;
57
+ case UR_DEVICE_AFFINITY_DOMAIN_FLAG_L3_CACHE:
58
+ return info::partition_affinity_domain::L3_cache;
59
+ case UR_DEVICE_AFFINITY_DOMAIN_FLAG_L4_CACHE:
60
+ return info::partition_affinity_domain::L4_cache;
61
+ default :
62
+ return info::partition_affinity_domain::not_applicable;
63
+ }
64
+ }
65
+
31
66
// Note that UR's enums have weird *_FORCE_UINT32 values, we ignore them in the
32
67
// callers. But we also can't write a fully-covered switch without mentioning it
33
68
// there, which wouldn't make any sense. As such, ensure that "real" values
@@ -503,10 +538,6 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
503
538
// / Queries this SYCL device for information requested by the template
504
539
// / parameter param
505
540
// /
506
- // / Specializations of info::param_traits must be defined in accordance
507
- // / with the info parameters in Table 4.20 of SYCL Spec to facilitate
508
- // / returning the type associated with the param parameter.
509
- // /
510
541
// / \return device info of type described in Table 4.20.
511
542
512
543
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
@@ -728,7 +759,7 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
728
759
for (auto &entry : ur_dev_partitions) {
729
760
// OpenCL extensions may have partition_properties that
730
761
// are not yet defined for SYCL (eg. CL_DEVICE_PARTITION_BY_NAMES_INTEL)
731
- info::partition_property pp (info ::ConvertPartitionProperty (entry));
762
+ info::partition_property pp (detail ::ConvertPartitionProperty (entry));
732
763
switch (pp) {
733
764
case info::partition_property::no_partition:
734
765
case info::partition_property::partition_equally:
@@ -767,7 +798,7 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
767
798
return info::partition_property::no_partition;
768
799
// The old UR implementation also just checked the first element, is that
769
800
// correct?
770
- return info ::ConvertPartitionProperty (PartitionProperties[0 ].type );
801
+ return detail ::ConvertPartitionProperty (PartitionProperties[0 ].type );
771
802
}
772
803
CASE (info::device::partition_type_affinity_domain) {
773
804
std::vector<ur_device_partition_property_t > PartitionProperties =
@@ -776,7 +807,7 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
776
807
return info::partition_affinity_domain::not_applicable;
777
808
for (const auto &PartitionProp : PartitionProperties) {
778
809
if (PartitionProp.type == UR_DEVICE_PARTITION_BY_AFFINITY_DOMAIN)
779
- return info ::ConvertAffinityDomain (
810
+ return detail ::ConvertAffinityDomain (
780
811
PartitionProp.value .affinity_domain );
781
812
}
782
813
0 commit comments