Skip to content

Commit 12d3748

Browse files
authored
Merge pull request #1731 from JackAKirk/cuda-coop-nullptr-check
[CUDA] Check for nullptr before dereference.
2 parents a1f5bc2 + 48d5db8 commit 12d3748

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/adapters/cuda/enqueue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueCooperativeKernelLaunchExp(
535535
const size_t *pGlobalWorkOffset, const size_t *pGlobalWorkSize,
536536
const size_t *pLocalWorkSize, uint32_t numEventsInWaitList,
537537
const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) {
538-
if (*pGlobalWorkOffset == 0 || pGlobalWorkOffset == nullptr) {
538+
if (pGlobalWorkOffset == nullptr || *pGlobalWorkOffset == 0) {
539539
ur_exp_launch_property_t coop_prop;
540540
coop_prop.id = UR_EXP_LAUNCH_PROPERTY_ID_COOPERATIVE;
541541
coop_prop.value.cooperative = 1;

0 commit comments

Comments
 (0)