Skip to content

Commit f496880

Browse files
authored
Merge pull request #1674 from JackAKirk/cuda-wire-cooperative-kernel
[CUDA] wire up cooperative kernel launch
2 parents a2005dd + 8c8e723 commit f496880

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

source/adapters/cuda/enqueue.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,14 @@ 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) {
539+
ur_exp_launch_property_t coop_prop;
540+
coop_prop.id = UR_EXP_LAUNCH_PROPERTY_ID_COOPERATIVE;
541+
coop_prop.value.cooperative = 1;
542+
return urEnqueueKernelLaunchCustomExp(
543+
hQueue, hKernel, workDim, pGlobalWorkSize, pLocalWorkSize, 1,
544+
&coop_prop, numEventsInWaitList, phEventWaitList, phEvent);
545+
}
538546
return urEnqueueKernelLaunch(hQueue, hKernel, workDim, pGlobalWorkOffset,
539547
pGlobalWorkSize, pLocalWorkSize,
540548
numEventsInWaitList, phEventWaitList, phEvent);

0 commit comments

Comments
 (0)