-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL][Level Zero] Implement sycl_ext_intel_queue_index extension #7599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3e0fe6a
f642f25
fedf467
f1ff38b
a34fc24
00fa9bf
971ef1a
19ddea0
3d6892b
97337cb
ebb1f30
48c8b81
ae6d72a
0acba89
b3c49ff
0f36b15
cc76d2c
ca1eea8
1e199b3
fb9841b
312388e
98560e0
930fe25
fb22a45
a9fffdd
9892278
7cfb199
622c991
423a8f2
ca9de54
7522fa9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -489,7 +489,7 @@ _pi_event::_pi_event(pi_command_type type, pi_context context, pi_queue queue, | |
streamToken_{stream_token}, evEnd_{nullptr}, evStart_{nullptr}, | ||
evQueued_{nullptr}, queue_{queue}, stream_{stream}, context_{context} { | ||
|
||
bool profilingEnabled = queue_->properties_ & PI_QUEUE_PROFILING_ENABLE; | ||
bool profilingEnabled = queue_->properties_ & PI_QUEUE_FLAG_PROFILING_ENABLE; | ||
|
||
PI_CHECK_ERROR(cuEventCreate( | ||
&evEnd_, profilingEnabled ? CU_EVENT_DEFAULT : CU_EVENT_DISABLE_TIMING)); | ||
|
@@ -526,7 +526,7 @@ pi_result _pi_event::start() { | |
pi_result result = PI_SUCCESS; | ||
|
||
try { | ||
if (queue_->properties_ & PI_QUEUE_PROFILING_ENABLE) { | ||
if (queue_->properties_ & PI_QUEUE_FLAG_PROFILING_ENABLE) { | ||
// NOTE: This relies on the default stream to be unused. | ||
result = PI_CHECK_ERROR(cuEventRecord(evQueued_, 0)); | ||
result = PI_CHECK_ERROR(cuEventRecord(evStart_, stream_)); | ||
|
@@ -633,7 +633,7 @@ pi_result _pi_event::release() { | |
|
||
PI_CHECK_ERROR(cuEventDestroy(evEnd_)); | ||
|
||
if (queue_->properties_ & PI_QUEUE_PROFILING_ENABLE) { | ||
if (queue_->properties_ & PI_QUEUE_FLAG_PROFILING_ENABLE) { | ||
PI_CHECK_ERROR(cuEventDestroy(evQueued_)); | ||
PI_CHECK_ERROR(cuEventDestroy(evStart_)); | ||
} | ||
|
@@ -1681,14 +1681,14 @@ pi_result cuda_piDeviceGetInfo(pi_device device, pi_device_info param_name, | |
} | ||
case PI_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES: { | ||
// The mandated minimum capability: | ||
auto capability = | ||
PI_QUEUE_PROFILING_ENABLE | PI_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE; | ||
auto capability = PI_QUEUE_FLAG_PROFILING_ENABLE | | ||
PI_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE; | ||
return getInfo(param_value_size, param_value, param_value_size_ret, | ||
capability); | ||
} | ||
case PI_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES: { | ||
// The mandated minimum capability: | ||
auto capability = PI_QUEUE_PROFILING_ENABLE; | ||
auto capability = PI_QUEUE_FLAG_PROFILING_ENABLE; | ||
return getInfo(param_value_size, param_value, param_value_size_ret, | ||
capability); | ||
} | ||
|
@@ -1945,6 +1945,10 @@ pi_result cuda_piDeviceGetInfo(pi_device device, pi_device_info param_name, | |
sycl::detail::pi::assertion(value >= 0); | ||
return getInfo(param_value_size, param_value, param_value_size_ret, value); | ||
} | ||
case PI_EXT_INTEL_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES: { | ||
return getInfo(param_value_size, param_value, param_value_size_ret, | ||
pi_int32{1}); | ||
} | ||
|
||
// TODO: Investigate if this information is available on CUDA. | ||
case PI_DEVICE_INFO_DEVICE_ID: | ||
|
@@ -2501,7 +2505,7 @@ pi_result cuda_piQueueCreate(pi_context context, pi_device device, | |
} | ||
|
||
const bool is_out_of_order = | ||
properties & PI_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE; | ||
properties & PI_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE; | ||
|
||
std::vector<CUstream> computeCuStreams( | ||
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, | |
return PI_ERROR_OUT_OF_RESOURCES; | ||
} | ||
} | ||
pi_result cuda_piextQueueCreate(pi_context Context, pi_device Device, | ||
pi_queue_properties *Properties, | ||
pi_queue *Queue) { | ||
assert(Properties); | ||
// Expect flags mask to be passed first. | ||
assert(Properties[0] == PI_QUEUE_FLAGS); | ||
pi_queue_properties Flags = Properties[1]; | ||
// Extra data isn't supported yet. | ||
assert(Properties[2] == 0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct me if I'm wrong, but this assert can be triggered by the user. Would it be better to return There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Discussed offline. This will be done in a follow-up patch. |
||
return cuda_piQueueCreate(Context, Device, Flags, Queue); | ||
} | ||
|
||
pi_result cuda_piQueueGetInfo(pi_queue command_queue, pi_queue_info param_name, | ||
size_t param_value_size, void *param_value, | ||
|
@@ -3849,7 +3864,8 @@ pi_result cuda_piEventGetProfilingInfo(pi_event event, | |
assert(event != nullptr); | ||
|
||
pi_queue queue = event->get_queue(); | ||
if (queue == nullptr || !(queue->properties_ & PI_QUEUE_PROFILING_ENABLE)) { | ||
if (queue == nullptr || | ||
!(queue->properties_ & PI_QUEUE_FLAG_PROFILING_ENABLE)) { | ||
return PI_ERROR_PROFILING_INFO_NOT_AVAILABLE; | ||
} | ||
|
||
|
@@ -5473,6 +5489,7 @@ pi_result piPluginInit(pi_plugin *PluginInit) { | |
cuda_piextContextCreateWithNativeHandle) | ||
// Queue | ||
_PI_CL(piQueueCreate, cuda_piQueueCreate) | ||
_PI_CL(piextQueueCreate, cuda_piextQueueCreate) | ||
_PI_CL(piQueueGetInfo, cuda_piQueueGetInfo) | ||
_PI_CL(piQueueFinish, cuda_piQueueFinish) | ||
_PI_CL(piQueueFlush, cuda_piQueueFlush) | ||
|
Uh oh!
There was an error while loading. Please reload this page.