|
9 | 9 | //===----------------------------------------------------------------------===// |
10 | 10 |
|
11 | 11 | #include "event.hpp" |
12 | | -#include "common.hpp" |
13 | 12 | #include "context.hpp" |
14 | 13 | #include "device.hpp" |
15 | 14 | #include "queue.hpp" |
|
19 | 18 |
|
20 | 19 | ur_event_handle_t_::ur_event_handle_t_(ur_command_t Type, |
21 | 20 | ur_context_handle_t Context, |
22 | | - ur_queue_handle_t Queue, CUstream Stream, |
| 21 | + ur_queue_handle_t Queue, |
| 22 | + native_type EvEnd, native_type EvQueued, |
| 23 | + native_type EvStart, CUstream Stream, |
23 | 24 | uint32_t StreamToken) |
24 | 25 | : CommandType{Type}, RefCount{1}, HasOwnership{true}, |
25 | 26 | HasBeenWaitedOn{false}, IsRecorded{false}, IsStarted{false}, |
26 | | - StreamToken{StreamToken}, EvEnd{nullptr}, EvStart{nullptr}, |
27 | | - EvQueued{nullptr}, Queue{Queue}, Stream{Stream}, Context{Context} { |
28 | | - |
29 | | - bool ProfilingEnabled = Queue->URFlags & UR_QUEUE_FLAG_PROFILING_ENABLE; |
30 | | - |
31 | | - UR_CHECK_ERROR(cuEventCreate( |
32 | | - &EvEnd, ProfilingEnabled ? CU_EVENT_DEFAULT : CU_EVENT_DISABLE_TIMING)); |
33 | | - |
34 | | - if (ProfilingEnabled) { |
35 | | - UR_CHECK_ERROR(cuEventCreate(&EvQueued, CU_EVENT_DEFAULT)); |
36 | | - UR_CHECK_ERROR(cuEventCreate(&EvStart, CU_EVENT_DEFAULT)); |
37 | | - } |
38 | | - |
39 | | - if (Queue != nullptr) { |
40 | | - urQueueRetain(Queue); |
41 | | - } |
| 27 | + StreamToken{StreamToken}, EventID{0}, EvEnd{EvEnd}, EvStart{EvStart}, |
| 28 | + EvQueued{EvQueued}, Queue{Queue}, Stream{Stream}, Context{Context} { |
| 29 | + urQueueRetain(Queue); |
42 | 30 | urContextRetain(Context); |
43 | 31 | } |
44 | 32 |
|
45 | 33 | ur_event_handle_t_::ur_event_handle_t_(ur_context_handle_t Context, |
46 | 34 | CUevent EventNative) |
47 | 35 | : CommandType{UR_COMMAND_EVENTS_WAIT}, RefCount{1}, HasOwnership{false}, |
48 | 36 | HasBeenWaitedOn{false}, IsRecorded{false}, IsStarted{false}, |
49 | | - StreamToken{std::numeric_limits<uint32_t>::max()}, EvEnd{EventNative}, |
50 | | - EvStart{nullptr}, EvQueued{nullptr}, Queue{nullptr}, Context{Context} { |
| 37 | + StreamToken{std::numeric_limits<uint32_t>::max()}, EventID{0}, |
| 38 | + EvEnd{EventNative}, EvStart{nullptr}, EvQueued{nullptr}, Queue{nullptr}, |
| 39 | + Stream{nullptr}, Context{Context} { |
51 | 40 | urContextRetain(Context); |
52 | 41 | } |
53 | 42 |
|
|
0 commit comments