Skip to content

Commit

Permalink
Merge pull request oneapi-src#2503 from omarahmed1111/fix-cuda-uninit…
Browse files Browse the repository at this point in the history
…ialized-event

[Windows][CUDA] Fix cuda uninitialized event warning
  • Loading branch information
martygrant authored Jan 3, 2025
2 parents ab5e53f + 82dae74 commit 545a01b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions source/adapters/cuda/command_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ur_result_t commandHandleReleaseInternal(
// of the `ur_event_t` object doesn't free the underlying CuEvent_t object and
// we need to do it manually ourselves.
if (Command->SignalNode) {
CUevent SignalEvent;
CUevent SignalEvent{};
UR_CHECK_ERROR(
cuGraphEventRecordNodeGetEvent(Command->SignalNode, &SignalEvent));
UR_CHECK_ERROR(cuEventDestroy(SignalEvent));
Expand Down Expand Up @@ -90,7 +90,7 @@ ur_exp_command_buffer_handle_t_::~ur_exp_command_buffer_handle_t_() {
std::unique_ptr<ur_event_handle_t_>
ur_exp_command_buffer_handle_t_::addSignalNode(CUgraphNode DepNode,
CUgraphNode &SignalNode) {
CUevent Event;
CUevent Event{};
UR_CHECK_ERROR(cuEventCreate(&Event, CU_EVENT_DEFAULT));
UR_CHECK_ERROR(
cuGraphAddEventRecordNode(&SignalNode, CudaGraph, &DepNode, 1, Event));
Expand Down Expand Up @@ -1430,7 +1430,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferUpdateSignalEventExp(
return UR_RESULT_ERROR_INVALID_OPERATION;
}

CUevent SignalEvent;
CUevent SignalEvent{};
UR_CHECK_ERROR(cuGraphEventRecordNodeGetEvent(SignalNode, &SignalEvent));

if (phEvent) {
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/cuda/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceCreateWithNativeHandle(
ur_result_t UR_APICALL urDeviceGetGlobalTimestamps(ur_device_handle_t hDevice,
uint64_t *pDeviceTimestamp,
uint64_t *pHostTimestamp) {
CUevent Event;
CUevent Event{};
ScopedContext Active(hDevice);

if (pDeviceTimestamp) {
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/cuda/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ urPlatformGet(ur_adapter_handle_t *, uint32_t, uint32_t NumEntries,
UR_CHECK_ERROR(cuDevicePrimaryCtxRetain(&Context, Device));

ScopedContext Active(Context); // Set native ctx as active
CUevent EvBase;
CUevent EvBase{};
UR_CHECK_ERROR(cuEventCreate(&EvBase, CU_EVENT_DEFAULT));

// Use default stream to record base event counter
Expand Down

0 comments on commit 545a01b

Please sign in to comment.