Skip to content

Commit 545a01b

Browse files
authored
Merge pull request #2503 from omarahmed1111/fix-cuda-uninitialized-event
[Windows][CUDA] Fix cuda uninitialized event warning
2 parents ab5e53f + 82dae74 commit 545a01b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

source/adapters/cuda/command_buffer.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ ur_result_t commandHandleReleaseInternal(
5454
// of the `ur_event_t` object doesn't free the underlying CuEvent_t object and
5555
// we need to do it manually ourselves.
5656
if (Command->SignalNode) {
57-
CUevent SignalEvent;
57+
CUevent SignalEvent{};
5858
UR_CHECK_ERROR(
5959
cuGraphEventRecordNodeGetEvent(Command->SignalNode, &SignalEvent));
6060
UR_CHECK_ERROR(cuEventDestroy(SignalEvent));
@@ -90,7 +90,7 @@ ur_exp_command_buffer_handle_t_::~ur_exp_command_buffer_handle_t_() {
9090
std::unique_ptr<ur_event_handle_t_>
9191
ur_exp_command_buffer_handle_t_::addSignalNode(CUgraphNode DepNode,
9292
CUgraphNode &SignalNode) {
93-
CUevent Event;
93+
CUevent Event{};
9494
UR_CHECK_ERROR(cuEventCreate(&Event, CU_EVENT_DEFAULT));
9595
UR_CHECK_ERROR(
9696
cuGraphAddEventRecordNode(&SignalNode, CudaGraph, &DepNode, 1, Event));
@@ -1430,7 +1430,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferUpdateSignalEventExp(
14301430
return UR_RESULT_ERROR_INVALID_OPERATION;
14311431
}
14321432

1433-
CUevent SignalEvent;
1433+
CUevent SignalEvent{};
14341434
UR_CHECK_ERROR(cuGraphEventRecordNodeGetEvent(SignalNode, &SignalEvent));
14351435

14361436
if (phEvent) {

source/adapters/cuda/device.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceCreateWithNativeHandle(
12391239
ur_result_t UR_APICALL urDeviceGetGlobalTimestamps(ur_device_handle_t hDevice,
12401240
uint64_t *pDeviceTimestamp,
12411241
uint64_t *pHostTimestamp) {
1242-
CUevent Event;
1242+
CUevent Event{};
12431243
ScopedContext Active(hDevice);
12441244

12451245
if (pDeviceTimestamp) {

source/adapters/cuda/platform.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ urPlatformGet(ur_adapter_handle_t *, uint32_t, uint32_t NumEntries,
8888
UR_CHECK_ERROR(cuDevicePrimaryCtxRetain(&Context, Device));
8989

9090
ScopedContext Active(Context); // Set native ctx as active
91-
CUevent EvBase;
91+
CUevent EvBase{};
9292
UR_CHECK_ERROR(cuEventCreate(&EvBase, CU_EVENT_DEFAULT));
9393

9494
// Use default stream to record base event counter

0 commit comments

Comments
 (0)