Skip to content

Commit

Permalink
Merge pull request #1731 from JackAKirk/cuda-coop-nullptr-check
Browse files Browse the repository at this point in the history
[CUDA] Check for nullptr before dereference.
  • Loading branch information
kbenzie committed Jun 11, 2024
2 parents a1f5bc2 + 48d5db8 commit 12d3748
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/adapters/cuda/enqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueCooperativeKernelLaunchExp(
const size_t *pGlobalWorkOffset, const size_t *pGlobalWorkSize,
const size_t *pLocalWorkSize, uint32_t numEventsInWaitList,
const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) {
if (*pGlobalWorkOffset == 0 || pGlobalWorkOffset == nullptr) {
if (pGlobalWorkOffset == nullptr || *pGlobalWorkOffset == 0) {
ur_exp_launch_property_t coop_prop;
coop_prop.id = UR_EXP_LAUNCH_PROPERTY_ID_COOPERATIVE;
coop_prop.value.cooperative = 1;
Expand Down

0 comments on commit 12d3748

Please sign in to comment.