Skip to content

Commit

Permalink
[Runtime][CUDA] Fix flag constant for cuEventCreate (#20040)
Browse files Browse the repository at this point in the history
Refer to [CUDA documentation
here](https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__EVENT.html#group__CUDA__EVENT_1g450687e75f3ff992fe01662a43d9d3db),
it seems that `CU_EVENT_WAIT_DEFAULT` cannot be used as a flag in
`cuEventCreate`.

I think `CU_EVENT_WAIT_DEFAULT` is basically for some other CUDA APIs
like `cuStreamWaitEvent`
([here](https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g6a898b652dfc6aa1d5c8d97062618b2f)).

It's interesting that currently these two constant is defined as the
same value `0` in CUDA (so no functional change : ), but I believe it
should be better if we can correct it.
  • Loading branch information
PragmaTwice authored Feb 20, 2025
1 parent b58b966 commit 852ca27
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions runtime/src/iree/hal/drivers/cuda/cuda_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ iree_hal_cuda_deferred_work_queue_device_interface_create_native_event(
(iree_hal_cuda_deferred_work_queue_device_interface_t*)(base_device_interface);
return IREE_CURESULT_TO_STATUS(
device_interface->cuda_symbols,
cuEventCreate((CUevent*)out_event, CU_EVENT_WAIT_DEFAULT),
"cuEventCreate");
cuEventCreate((CUevent*)out_event, CU_EVENT_DEFAULT), "cuEventCreate");
}

static iree_status_t
Expand Down

0 comments on commit 852ca27

Please sign in to comment.