|
16 | 16 | ur_event_handle_t_::ur_event_handle_t_(ur_command_t Type,
|
17 | 17 | ur_context_handle_t Context,
|
18 | 18 | ur_queue_handle_t Queue,
|
19 |
| - hipStream_t Stream, uint32_t StreamToken) |
| 19 | + hipEvent_t EvEnd, hipEvent_t EvQueued, |
| 20 | + hipEvent_t EvStart, hipStream_t Stream, |
| 21 | + uint32_t StreamToken) |
20 | 22 | : CommandType{Type}, RefCount{1}, HasOwnership{true},
|
21 | 23 | HasBeenWaitedOn{false}, IsRecorded{false}, IsStarted{false},
|
22 |
| - StreamToken{StreamToken}, EventId{0}, EvEnd{nullptr}, EvStart{nullptr}, |
23 |
| - EvQueued{nullptr}, Queue{Queue}, Stream{Stream}, Context{Context} { |
24 |
| - |
25 |
| - bool ProfilingEnabled = |
26 |
| - Queue->URFlags & UR_QUEUE_FLAG_PROFILING_ENABLE || isTimestampEvent(); |
27 |
| - |
28 |
| - UR_CHECK_ERROR(hipEventCreateWithFlags( |
29 |
| - &EvEnd, ProfilingEnabled ? hipEventDefault : hipEventDisableTiming)); |
30 |
| - |
31 |
| - if (ProfilingEnabled) { |
32 |
| - UR_CHECK_ERROR(hipEventCreateWithFlags(&EvQueued, hipEventDefault)); |
33 |
| - UR_CHECK_ERROR(hipEventCreateWithFlags(&EvStart, hipEventDefault)); |
34 |
| - } |
35 |
| - |
| 24 | + StreamToken{StreamToken}, EventId{0}, EvEnd{EvEnd}, EvQueued{EvQueued}, |
| 25 | + EvStart{EvStart}, Queue{Queue}, Stream{Stream}, Context{Context} { |
36 | 26 | urQueueRetain(Queue);
|
37 | 27 | urContextRetain(Context);
|
38 | 28 | }
|
@@ -62,7 +52,7 @@ ur_result_t ur_event_handle_t_::start() {
|
62 | 52 | if (Queue->URFlags & UR_QUEUE_FLAG_PROFILING_ENABLE || isTimestampEvent()) {
|
63 | 53 | // NOTE: This relies on the default stream to be unused.
|
64 | 54 | UR_CHECK_ERROR(hipEventRecord(EvQueued, 0));
|
65 |
| - UR_CHECK_ERROR(hipEventRecord(EvStart, Queue->get())); |
| 55 | + UR_CHECK_ERROR(hipEventRecord(EvStart, Stream)); |
66 | 56 | }
|
67 | 57 | } catch (ur_result_t Error) {
|
68 | 58 | Result = Error;
|
|
0 commit comments