Skip to content

Commit 5cb6589

Browse files
martygrantkbenzie
authored andcommitted
Merge pull request #2503 from omarahmed1111/fix-cuda-uninitialized-event
[Windows][CUDA] Fix cuda uninitialized event warning
1 parent 688179d commit 5cb6589

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
@@ -52,7 +52,7 @@ commandHandleReleaseInternal(ur_exp_command_buffer_command_handle_t Command) {
5252
// of the `ur_event_t` object doesn't free the underlying CuEvent_t object and
5353
// we need to do it manually ourselves.
5454
if (Command->SignalNode) {
55-
CUevent SignalEvent;
55+
CUevent SignalEvent{};
5656
UR_CHECK_ERROR(
5757
cuGraphEventRecordNodeGetEvent(Command->SignalNode, &SignalEvent));
5858
UR_CHECK_ERROR(cuEventDestroy(SignalEvent));
@@ -85,7 +85,7 @@ ur_exp_command_buffer_handle_t_::~ur_exp_command_buffer_handle_t_() {
8585
std::unique_ptr<ur_event_handle_t_>
8686
ur_exp_command_buffer_handle_t_::addSignalNode(CUgraphNode DepNode,
8787
CUgraphNode &SignalNode) {
88-
CUevent Event;
88+
CUevent Event{};
8989
UR_CHECK_ERROR(cuEventCreate(&Event, CU_EVENT_DEFAULT));
9090
UR_CHECK_ERROR(
9191
cuGraphAddEventRecordNode(&SignalNode, CudaGraph, &DepNode, 1, Event));
@@ -1433,7 +1433,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferUpdateSignalEventExp(
14331433
return UR_RESULT_ERROR_INVALID_OPERATION;
14341434
}
14351435

1436-
CUevent SignalEvent;
1436+
CUevent SignalEvent{};
14371437
UR_CHECK_ERROR(cuGraphEventRecordNodeGetEvent(SignalNode, &SignalEvent));
14381438

14391439
if (phEvent) {

source/adapters/cuda/device.cpp

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

12441244
if (pDeviceTimestamp) {

source/adapters/cuda/platform.cpp

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

8686
ScopedContext Active(Context); // Set native ctx as active
87-
CUevent EvBase;
87+
CUevent EvBase{};
8888
UR_CHECK_ERROR(cuEventCreate(&EvBase, CU_EVENT_DEFAULT));
8989

9090
// Use default stream to record base event counter

0 commit comments

Comments
 (0)