Skip to content

Commit adcf897

Browse files
committed
Addressing feedback from review
1 parent df32ed7 commit adcf897

File tree

7 files changed

+10
-490
lines changed

7 files changed

+10
-490
lines changed

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -276,15 +276,13 @@ _pi_event::_pi_event(pi_command_type type, pi_context context, pi_queue queue)
276276
isStarted_{false}, evEnd_{nullptr}, evStart_{nullptr}, evQueued_{nullptr},
277277
queue_{queue}, context_{context} {
278278

279-
if (type != PI_COMMAND_TYPE_USER) {
280-
PI_CHECK_ERROR(cuEventCreate(&evEnd_, CU_EVENT_DEFAULT));
279+
assert(type != PI_COMMAND_TYPE_USER);
281280

282-
if (queue_->properties_ & PI_QUEUE_PROFILING_ENABLE) {
283-
PI_CHECK_ERROR(cuEventCreate(&evQueued_, CU_EVENT_DEFAULT));
284-
PI_CHECK_ERROR(cuEventCreate(&evStart_, CU_EVENT_DEFAULT));
285-
}
286-
} else {
287-
cl::sycl::detail::pi::die("User-defined events not implemented");
281+
PI_CHECK_ERROR(cuEventCreate(&evEnd_, CU_EVENT_DEFAULT));
282+
283+
if (queue_->properties_ & PI_QUEUE_PROFILING_ENABLE) {
284+
PI_CHECK_ERROR(cuEventCreate(&evQueued_, CU_EVENT_DEFAULT));
285+
PI_CHECK_ERROR(cuEventCreate(&evStart_, CU_EVENT_DEFAULT));
288286
}
289287

290288
if (queue_ != nullptr) {
@@ -2622,24 +2620,7 @@ pi_result cuda_piextKernelSetArgPointer(pi_kernel kernel, pi_uint32 arg_index,
26222620
// Events
26232621
//
26242622
pi_result cuda_piEventCreate(pi_context context, pi_event *event) {
2625-
assert(context != nullptr);
2626-
assert(event != nullptr);
2627-
pi_result retErr = PI_SUCCESS;
2628-
pi_event retEvent = nullptr;
2629-
2630-
try {
2631-
retEvent = _pi_event::make_user(context);
2632-
if (retEvent == nullptr) {
2633-
retErr = PI_OUT_OF_HOST_MEMORY;
2634-
}
2635-
} catch (pi_result err) {
2636-
retErr = err;
2637-
} catch (...) {
2638-
retErr = PI_OUT_OF_RESOURCES;
2639-
}
2640-
2641-
*event = retEvent;
2642-
return retErr;
2623+
cl::sycl::detail::pi::die("PI Event Create not implemented in CUDA backend");
26432624
}
26442625

26452626
pi_result cuda_piEventGetInfo(pi_event event, pi_event_info param_name,
@@ -2703,13 +2684,13 @@ pi_result cuda_piEventSetCallback(pi_event event,
27032684
pi_int32 command_exec_callback_type,
27042685
pfn_notify notify, void *user_data) {
27052686

2706-
cl::sycl::detail::pi::die("Event Callback not implemented");
2687+
cl::sycl::detail::pi::die("Event Callback not implemented in CUDA backend");
27072688
return PI_SUCCESS;
27082689
}
27092690

27102691
pi_result cuda_piEventSetStatus(pi_event event, pi_int32 execution_status) {
27112692

2712-
cl::sycl::detail::pi::die("Event Set Status not implemented");
2693+
cl::sycl::detail::pi::die("Event Set Status not implemented in CUDA backend");
27132694
return PI_INVALID_VALUE;
27142695
}
27152696

sycl/plugins/cuda/pi_cuda.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,6 @@ class _pi_event {
358358
//
359359
pi_uint64 get_end_time() const;
360360

361-
// make a user event. CUDA has no concept of user events, so this
362-
// functionality is implemented by the CUDA PI implementation.
363-
static pi_event make_user(pi_context context) {
364-
return new _pi_event(PI_COMMAND_TYPE_USER, context, nullptr);
365-
}
366-
367361
// construct a native CUDA. This maps closely to the underlying CUDA event.
368362
static pi_event make_native(pi_command_type type, pi_queue queue) {
369363
return new _pi_event(type, queue->get_context(), queue);

sycl/unittests/pi/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ add_sycl_unittest(PiTests OBJECT
66
EnqueueMemTest.cpp
77
PiMock.cpp
88
PlatformTest.cpp
9-
EventTest.cpp
109
)
1110

1211
add_dependencies(PiTests sycl)

0 commit comments

Comments
 (0)