Skip to content

Commit d2ec964

Browse files
[SYCL][Level Zero] Implement sycl_ext_intel_queue_index extension (intel#7599)
The feature needs to pass extra data to `piQueueCreate` which is impossible with the current interface. As such, and because of the current ABI freeze, a new `piQueueCreateEx` interface has been added accepting `pi_queue_properties *Properties` (similarly to other interfaces allowing optional/additional data) with the plan to retire the old one at the next ABI break window. Extension spec: intel#7520
1 parent 86ba180 commit d2ec964

23 files changed

+268
-79
lines changed

sycl/doc/extensions/proposed/sycl_ext_intel_queue_index.asciidoc renamed to sycl/doc/extensions/supported/sycl_ext_intel_queue_index.asciidoc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ SYCL specification refer to that revision.
4343

4444
== Status
4545

46-
This is a proposed extension specification, intended to gather community
47-
feedback. Interfaces defined in this specification may not be implemented yet
48-
or may be in a preliminary state. The specification itself may also change in
49-
incompatible ways before it is finalized. *Shipping software products should
50-
not rely on APIs defined in this specification.*
46+
This extension is implemented and fully supported by DPC++.
5147

5248

5349
== Overview

sycl/include/sycl/detail/pi.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ _PI_API(piextContextGetNativeHandle)
4343
_PI_API(piextContextCreateWithNativeHandle)
4444
// Queue
4545
_PI_API(piQueueCreate)
46+
_PI_API(piextQueueCreate)
4647
_PI_API(piQueueGetInfo)
4748
_PI_API(piQueueFinish)
4849
_PI_API(piQueueFlush)

sycl/include/sycl/detail/pi.h

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,12 @@
6565
// partitioning by affinity domain is disabled by default and can be temporarily
6666
// restored via SYCL_PI_LEVEL_ZERO_EXPOSE_CSLICE_IN_AFFINITY_PARTITIONING
6767
// environment variable.
68+
// 12.20 Added piextQueueCreate API to be used instead of piQueueCreate, also
69+
// added PI_EXT_INTEL_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES for piDeviceGetInfo.
70+
// Both are needed to support sycl_ext_intel_queue_index extension.
6871

6972
#define _PI_H_VERSION_MAJOR 12
70-
#define _PI_H_VERSION_MINOR 19
73+
#define _PI_H_VERSION_MINOR 20
7174

7275
#define _PI_STRING_HELPER(a) #a
7376
#define _PI_CONCAT(a, b) _PI_STRING_HELPER(a.b)
@@ -295,6 +298,9 @@ typedef enum {
295298
// Return 0 if device doesn't have any memory modules. Return the minimum of
296299
// the bus width values if there are several memory modules on the device.
297300
PI_EXT_INTEL_DEVICE_INFO_MEMORY_BUS_WIDTH = 0x10031,
301+
// Return 1 if the device doesn't have a notion of a "queue index". Otherwise,
302+
// return the number of queue indices that are available for this device.
303+
PI_EXT_INTEL_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES = 0x10032,
298304
PI_DEVICE_INFO_ATOMIC_64 = 0x10110,
299305
PI_DEVICE_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES = 0x10111,
300306
PI_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES = 0x11000,
@@ -587,13 +593,17 @@ constexpr pi_usm_mem_properties PI_MEM_USM_ALLOC_BUFFER_LOCATION = 0x419E;
587593
// NOTE: queue properties are implemented this way to better support bit
588594
// manipulations
589595
using pi_queue_properties = pi_bitfield;
590-
constexpr pi_queue_properties PI_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE = (1 << 0);
591-
constexpr pi_queue_properties PI_QUEUE_PROFILING_ENABLE = (1 << 1);
592-
constexpr pi_queue_properties PI_QUEUE_ON_DEVICE = (1 << 2);
593-
constexpr pi_queue_properties PI_QUEUE_ON_DEVICE_DEFAULT = (1 << 3);
594-
constexpr pi_queue_properties PI_EXT_ONEAPI_QUEUE_DISCARD_EVENTS = (1 << 4);
595-
constexpr pi_queue_properties PI_EXT_ONEAPI_QUEUE_PRIORITY_LOW = (1 << 5);
596-
constexpr pi_queue_properties PI_EXT_ONEAPI_QUEUE_PRIORITY_HIGH = (1 << 6);
596+
constexpr pi_queue_properties PI_QUEUE_FLAGS = -1;
597+
constexpr pi_queue_properties PI_QUEUE_COMPUTE_INDEX = -2;
598+
// clang-format off
599+
constexpr pi_queue_properties PI_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE = (1 << 0);
600+
constexpr pi_queue_properties PI_QUEUE_FLAG_PROFILING_ENABLE = (1 << 1);
601+
constexpr pi_queue_properties PI_QUEUE_FLAG_ON_DEVICE = (1 << 2);
602+
constexpr pi_queue_properties PI_QUEUE_FLAG_ON_DEVICE_DEFAULT = (1 << 3);
603+
constexpr pi_queue_properties PI_EXT_ONEAPI_QUEUE_FLAG_DISCARD_EVENTS = (1 << 4);
604+
constexpr pi_queue_properties PI_EXT_ONEAPI_QUEUE_FLAG_PRIORITY_LOW = (1 << 5);
605+
constexpr pi_queue_properties PI_EXT_ONEAPI_QUEUE_FLAG_PRIORITY_HIGH = (1 << 6);
606+
// clang-format on
597607

598608
using pi_result = _pi_result;
599609
using pi_platform_info = _pi_platform_info;
@@ -1125,9 +1135,18 @@ __SYCL_EXPORT pi_result piextContextCreateWithNativeHandle(
11251135
//
11261136
// Queue
11271137
//
1138+
1139+
// TODO: Remove during next ABI break and rename piextQueueCreate to
1140+
// piQueueCreate.
11281141
__SYCL_EXPORT pi_result piQueueCreate(pi_context context, pi_device device,
11291142
pi_queue_properties properties,
11301143
pi_queue *queue);
1144+
/// \param properties points to a zero-terminated array of extra data describing
1145+
/// desired queue properties. Format is
1146+
/// {[PROPERTY[, property-specific elements of data]*,]* 0}
1147+
__SYCL_EXPORT pi_result piextQueueCreate(pi_context context, pi_device device,
1148+
pi_queue_properties *properties,
1149+
pi_queue *queue);
11311150

11321151
__SYCL_EXPORT pi_result piQueueGetInfo(pi_queue command_queue,
11331152
pi_queue_info param_name,

sycl/include/sycl/detail/property_helper.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ enum PropWithDataKind {
5757
ImageContextBound = 3,
5858
BufferMemChannel = 4,
5959
AccPropBufferLocation = 5,
60-
PropWithDataKindSize = 6,
60+
QueueComputeIndex = 6,
61+
PropWithDataKindSize = 7,
6162
};
6263

6364
// Base class for dataless properties, needed to check that the type of an

sycl/include/sycl/feature_test.hpp.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ __SYCL_INLINE_VER_NAMESPACE(_V1) {
6464
#define SYCL_EXT_INTEL_MEM_CHANNEL_PROPERTY 1
6565
#define SYCL_EXT_INTEL_USM_ADDRESS_SPACES 2
6666
#define SYCL_EXT_INTEL_RUNTIME_BUFFER_LOCATION 1
67+
#define SYCL_EXT_INTEL_QUEUE_INDEX 1
6768
#define SYCL_EXT_ONEAPI_BACKEND_LEVEL_ZERO 3
6869
#define SYCL_EXT_ONEAPI_USM_DEVICE_READ_ONLY 1
6970
#define SYCL_EXT_ONEAPI_KERNEL_PROPERTIES 1

sycl/include/sycl/info/ext_intel_device_traits.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ __SYCL_PARAM_TRAITS_SPEC(ext::intel, device, uuid, detail::uuid_type, PI_DEVICE_
1515
__SYCL_PARAM_TRAITS_SPEC(ext::intel, device, free_memory, pi_uint64, PI_EXT_INTEL_DEVICE_INFO_FREE_MEMORY)
1616
__SYCL_PARAM_TRAITS_SPEC(ext::intel, device, memory_clock_rate, pi_uint32, PI_EXT_INTEL_DEVICE_INFO_MEMORY_CLOCK_RATE)
1717
__SYCL_PARAM_TRAITS_SPEC(ext::intel, device, memory_bus_width, pi_uint32, PI_EXT_INTEL_DEVICE_INFO_MEMORY_BUS_WIDTH)
18+
__SYCL_PARAM_TRAITS_SPEC(ext::intel, device, max_compute_queue_indices, pi_int32, PI_EXT_INTEL_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES)
1819
#ifdef __SYCL_PARAM_TRAITS_TEMPLATE_SPEC_NEEDS_UNDEF
1920
#undef __SYCL_PARAM_TRAITS_TEMPLATE_SPEC
2021
#undef __SYCL_PARAM_TRAITS_TEMPLATE_SPEC_NEEDS_UNDEF

sycl/include/sycl/properties/queue_properties.hpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,24 @@ class use_default_stream
5151
// clang-format on
5252
} // namespace property::queue
5353

54+
namespace ext {
55+
namespace intel {
56+
namespace property {
57+
namespace queue {
58+
class compute_index : public sycl::detail::PropertyWithData<
59+
sycl::detail::PropWithDataKind::QueueComputeIndex> {
60+
public:
61+
compute_index(int idx) : idx(idx) {}
62+
int get_index() { return idx; }
63+
64+
private:
65+
int idx;
66+
};
67+
} // namespace queue
68+
} // namespace property
69+
} // namespace intel
70+
} // namespace ext
71+
5472
// Forward declaration
5573
class queue;
5674

@@ -78,6 +96,9 @@ struct is_property_of<property::queue::cuda::use_default_stream, queue>
7896
template <>
7997
struct is_property_of<ext::oneapi::cuda::property::queue::use_default_stream,
8098
queue> : std::true_type {};
99+
template <>
100+
struct is_property_of<ext::intel::property::queue::compute_index, queue>
101+
: std::true_type {};
81102

82103
} // __SYCL_INLINE_VER_NAMESPACE(_V1)
83104
} // namespace sycl

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ _pi_event::_pi_event(pi_command_type type, pi_context context, pi_queue queue,
489489
streamToken_{stream_token}, evEnd_{nullptr}, evStart_{nullptr},
490490
evQueued_{nullptr}, queue_{queue}, stream_{stream}, context_{context} {
491491

492-
bool profilingEnabled = queue_->properties_ & PI_QUEUE_PROFILING_ENABLE;
492+
bool profilingEnabled = queue_->properties_ & PI_QUEUE_FLAG_PROFILING_ENABLE;
493493

494494
PI_CHECK_ERROR(cuEventCreate(
495495
&evEnd_, profilingEnabled ? CU_EVENT_DEFAULT : CU_EVENT_DISABLE_TIMING));
@@ -526,7 +526,7 @@ pi_result _pi_event::start() {
526526
pi_result result = PI_SUCCESS;
527527

528528
try {
529-
if (queue_->properties_ & PI_QUEUE_PROFILING_ENABLE) {
529+
if (queue_->properties_ & PI_QUEUE_FLAG_PROFILING_ENABLE) {
530530
// NOTE: This relies on the default stream to be unused.
531531
result = PI_CHECK_ERROR(cuEventRecord(evQueued_, 0));
532532
result = PI_CHECK_ERROR(cuEventRecord(evStart_, stream_));
@@ -633,7 +633,7 @@ pi_result _pi_event::release() {
633633

634634
PI_CHECK_ERROR(cuEventDestroy(evEnd_));
635635

636-
if (queue_->properties_ & PI_QUEUE_PROFILING_ENABLE) {
636+
if (queue_->properties_ & PI_QUEUE_FLAG_PROFILING_ENABLE) {
637637
PI_CHECK_ERROR(cuEventDestroy(evQueued_));
638638
PI_CHECK_ERROR(cuEventDestroy(evStart_));
639639
}
@@ -1681,14 +1681,14 @@ pi_result cuda_piDeviceGetInfo(pi_device device, pi_device_info param_name,
16811681
}
16821682
case PI_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES: {
16831683
// The mandated minimum capability:
1684-
auto capability =
1685-
PI_QUEUE_PROFILING_ENABLE | PI_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE;
1684+
auto capability = PI_QUEUE_FLAG_PROFILING_ENABLE |
1685+
PI_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE;
16861686
return getInfo(param_value_size, param_value, param_value_size_ret,
16871687
capability);
16881688
}
16891689
case PI_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES: {
16901690
// The mandated minimum capability:
1691-
auto capability = PI_QUEUE_PROFILING_ENABLE;
1691+
auto capability = PI_QUEUE_FLAG_PROFILING_ENABLE;
16921692
return getInfo(param_value_size, param_value, param_value_size_ret,
16931693
capability);
16941694
}
@@ -1945,6 +1945,10 @@ pi_result cuda_piDeviceGetInfo(pi_device device, pi_device_info param_name,
19451945
sycl::detail::pi::assertion(value >= 0);
19461946
return getInfo(param_value_size, param_value, param_value_size_ret, value);
19471947
}
1948+
case PI_EXT_INTEL_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES: {
1949+
return getInfo(param_value_size, param_value, param_value_size_ret,
1950+
pi_int32{1});
1951+
}
19481952

19491953
// TODO: Investigate if this information is available on CUDA.
19501954
case PI_DEVICE_INFO_DEVICE_ID:
@@ -2501,7 +2505,7 @@ pi_result cuda_piQueueCreate(pi_context context, pi_device device,
25012505
}
25022506

25032507
const bool is_out_of_order =
2504-
properties & PI_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE;
2508+
properties & PI_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE;
25052509

25062510
std::vector<CUstream> computeCuStreams(
25072511
is_out_of_order ? _pi_queue::default_num_compute_streams : 1);
@@ -2524,6 +2528,17 @@ pi_result cuda_piQueueCreate(pi_context context, pi_device device,
25242528
return PI_ERROR_OUT_OF_RESOURCES;
25252529
}
25262530
}
2531+
pi_result cuda_piextQueueCreate(pi_context Context, pi_device Device,
2532+
pi_queue_properties *Properties,
2533+
pi_queue *Queue) {
2534+
assert(Properties);
2535+
// Expect flags mask to be passed first.
2536+
assert(Properties[0] == PI_QUEUE_FLAGS);
2537+
pi_queue_properties Flags = Properties[1];
2538+
// Extra data isn't supported yet.
2539+
assert(Properties[2] == 0);
2540+
return cuda_piQueueCreate(Context, Device, Flags, Queue);
2541+
}
25272542

25282543
pi_result cuda_piQueueGetInfo(pi_queue command_queue, pi_queue_info param_name,
25292544
size_t param_value_size, void *param_value,
@@ -3849,7 +3864,8 @@ pi_result cuda_piEventGetProfilingInfo(pi_event event,
38493864
assert(event != nullptr);
38503865

38513866
pi_queue queue = event->get_queue();
3852-
if (queue == nullptr || !(queue->properties_ & PI_QUEUE_PROFILING_ENABLE)) {
3867+
if (queue == nullptr ||
3868+
!(queue->properties_ & PI_QUEUE_FLAG_PROFILING_ENABLE)) {
38533869
return PI_ERROR_PROFILING_INFO_NOT_AVAILABLE;
38543870
}
38553871

@@ -5473,6 +5489,7 @@ pi_result piPluginInit(pi_plugin *PluginInit) {
54735489
cuda_piextContextCreateWithNativeHandle)
54745490
// Queue
54755491
_PI_CL(piQueueCreate, cuda_piQueueCreate)
5492+
_PI_CL(piextQueueCreate, cuda_piextQueueCreate)
54765493
_PI_CL(piQueueGetInfo, cuda_piQueueGetInfo)
54775494
_PI_CL(piQueueFinish, cuda_piQueueFinish)
54785495
_PI_CL(piQueueFlush, cuda_piQueueFlush)

sycl/plugins/esimd_emulator/pi_esimd_emulator.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ pi_result piDeviceGetInfo(pi_device Device, pi_device_info ParamName,
663663
case PI_DEVICE_INFO_OPENCL_C_VERSION:
664664
return ReturnValue("");
665665
case PI_DEVICE_INFO_QUEUE_PROPERTIES:
666-
return ReturnValue(pi_queue_properties{PI_QUEUE_ON_DEVICE});
666+
return ReturnValue(pi_queue_properties{PI_QUEUE_FLAG_ON_DEVICE});
667667
case PI_DEVICE_INFO_MAX_WORK_ITEM_SIZES: {
668668
struct {
669669
size_t Arr[3];
@@ -785,6 +785,8 @@ pi_result piDeviceGetInfo(pi_device Device, pi_device_info ParamName,
785785
return ReturnValue(pi_uint32{0});
786786
case PI_DEVICE_INFO_SUB_GROUP_SIZES_INTEL:
787787
return ReturnValue(size_t{1});
788+
case PI_EXT_INTEL_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES:
789+
return ReturnValue(pi_int32{1});
788790

789791
CASE_PI_UNSUPPORTED(PI_DEVICE_INFO_MAX_NUM_SUB_GROUPS)
790792
CASE_PI_UNSUPPORTED(PI_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS)
@@ -923,11 +925,21 @@ bool _pi_context::checkSurfaceArgument(pi_mem_flags Flags, void *HostPtr) {
923925
return true;
924926
}
925927

928+
pi_result piextQueueCreate(pi_context Context, pi_device Device,
929+
pi_queue_properties *Properties, pi_queue *Queue) {
930+
assert(Properties);
931+
// Expect flags mask to be passed first.
932+
assert(Properties[0] == PI_QUEUE_FLAGS);
933+
pi_queue_properties Flags = Properties[1];
934+
// Extra data isn't supported yet.
935+
assert(Properties[2] == 0);
936+
return piQueueCreate(Context, Device, Flags, Queue);
937+
}
926938
pi_result piQueueCreate(pi_context Context, pi_device Device,
927939
pi_queue_properties Properties, pi_queue *Queue) {
928940
ARG_UNUSED(Device);
929941

930-
if (Properties & PI_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE) {
942+
if (Properties & PI_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE) {
931943
// TODO : Support Out-of-order Queue
932944
*Queue = nullptr;
933945
return PI_ERROR_INVALID_QUEUE_PROPERTIES;

sycl/plugins/hip/pi_hip.cpp

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ _pi_event::_pi_event(pi_command_type type, pi_context context, pi_queue queue,
534534

535535
assert(type != PI_COMMAND_TYPE_USER);
536536

537-
bool profilingEnabled = queue_->properties_ & PI_QUEUE_PROFILING_ENABLE;
537+
bool profilingEnabled = queue_->properties_ & PI_QUEUE_FLAG_PROFILING_ENABLE;
538538

539539
PI_CHECK_ERROR(hipEventCreateWithFlags(
540540
&evEnd_, profilingEnabled ? hipEventDefault : hipEventDisableTiming));
@@ -562,7 +562,7 @@ pi_result _pi_event::start() {
562562
pi_result result = PI_SUCCESS;
563563

564564
try {
565-
if (queue_->properties_ & PI_QUEUE_PROFILING_ENABLE) {
565+
if (queue_->properties_ & PI_QUEUE_FLAG_PROFILING_ENABLE) {
566566
// NOTE: This relies on the default stream to be unused.
567567
PI_CHECK_ERROR(hipEventRecord(evQueued_, 0));
568568
PI_CHECK_ERROR(hipEventRecord(evStart_, queue_->get()));
@@ -663,7 +663,7 @@ pi_result _pi_event::release() {
663663
assert(queue_ != nullptr);
664664
PI_CHECK_ERROR(hipEventDestroy(evEnd_));
665665

666-
if (queue_->properties_ & PI_QUEUE_PROFILING_ENABLE) {
666+
if (queue_->properties_ & PI_QUEUE_FLAG_PROFILING_ENABLE) {
667667
PI_CHECK_ERROR(hipEventDestroy(evQueued_));
668668
PI_CHECK_ERROR(hipEventDestroy(evStart_));
669669
}
@@ -1588,14 +1588,14 @@ pi_result hip_piDeviceGetInfo(pi_device device, pi_device_info param_name,
15881588
}
15891589
case PI_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES: {
15901590
// The mandated minimum capability:
1591-
auto capability =
1592-
PI_QUEUE_PROFILING_ENABLE | PI_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE;
1591+
auto capability = PI_QUEUE_FLAG_PROFILING_ENABLE |
1592+
PI_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE;
15931593
return getInfo(param_value_size, param_value, param_value_size_ret,
15941594
capability);
15951595
}
15961596
case PI_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES: {
15971597
// The mandated minimum capability:
1598-
auto capability = PI_QUEUE_PROFILING_ENABLE;
1598+
auto capability = PI_QUEUE_FLAG_PROFILING_ENABLE;
15991599
return getInfo(param_value_size, param_value, param_value_size_ret,
16001600
capability);
16011601
}
@@ -1841,6 +1841,10 @@ pi_result hip_piDeviceGetInfo(pi_device device, pi_device_info param_name,
18411841
sycl::detail::pi::assertion(value >= 0);
18421842
return getInfo(param_value_size, param_value, param_value_size_ret, value);
18431843
}
1844+
case PI_EXT_INTEL_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES: {
1845+
return getInfo(param_value_size, param_value, param_value_size_ret,
1846+
pi_int32{1});
1847+
}
18441848

18451849
// TODO: Implement.
18461850
case PI_DEVICE_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES:
@@ -2378,7 +2382,7 @@ pi_result hip_piQueueCreate(pi_context context, pi_device device,
23782382
unsigned int flags = 0;
23792383

23802384
const bool is_out_of_order =
2381-
properties & PI_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE;
2385+
properties & PI_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE;
23822386

23832387
std::vector<hipStream_t> computeHipStreams(
23842388
is_out_of_order ? _pi_queue::default_num_compute_streams : 1);
@@ -2401,6 +2405,17 @@ pi_result hip_piQueueCreate(pi_context context, pi_device device,
24012405
return PI_ERROR_OUT_OF_RESOURCES;
24022406
}
24032407
}
2408+
pi_result hip_piextQueueCreate(pi_context Context, pi_device Device,
2409+
pi_queue_properties *Properties,
2410+
pi_queue *Queue) {
2411+
assert(Properties);
2412+
// Expect flags mask to be passed first.
2413+
assert(Properties[0] == PI_QUEUE_FLAGS);
2414+
pi_queue_properties Flags = Properties[1];
2415+
// Extra data isn't supported yet.
2416+
assert(Properties[2] == 0);
2417+
return hip_piQueueCreate(Context, Device, Flags, Queue);
2418+
}
24042419

24052420
pi_result hip_piQueueGetInfo(pi_queue command_queue, pi_queue_info param_name,
24062421
size_t param_value_size, void *param_value,
@@ -3674,7 +3689,8 @@ pi_result hip_piEventGetProfilingInfo(pi_event event,
36743689
assert(event != nullptr);
36753690

36763691
pi_queue queue = event->get_queue();
3677-
if (queue == nullptr || !(queue->properties_ & PI_QUEUE_PROFILING_ENABLE)) {
3692+
if (queue == nullptr ||
3693+
!(queue->properties_ & PI_QUEUE_FLAG_PROFILING_ENABLE)) {
36783694
return PI_ERROR_PROFILING_INFO_NOT_AVAILABLE;
36793695
}
36803696

@@ -5201,6 +5217,7 @@ pi_result piPluginInit(pi_plugin *PluginInit) {
52015217
hip_piextContextCreateWithNativeHandle)
52025218
// Queue
52035219
_PI_CL(piQueueCreate, hip_piQueueCreate)
5220+
_PI_CL(piextQueueCreate, hip_piextQueueCreate)
52045221
_PI_CL(piQueueGetInfo, hip_piQueueGetInfo)
52055222
_PI_CL(piQueueFinish, hip_piQueueFinish)
52065223
_PI_CL(piQueueFlush, hip_piQueueFlush)

0 commit comments

Comments
 (0)