File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
source/adapters/level_zero Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -586,15 +586,26 @@ UR_APIEXPORT ur_result_t UR_APICALL urKernelGetGroupInfo(
586586
587587 ZeStruct<ze_kernel_properties_t > kernelProperties;
588588 kernelProperties.pNext = &workGroupProperties;
589-
590- auto ZeResult = ZE_CALL_NOCHECK (
591- zeKernelGetProperties,
592- (Kernel->ZeKernelMap [Device->ZeDevice ], &kernelProperties));
593- if (ZeResult || workGroupProperties.maxGroupSize == 0 ) {
589+ // Set the Kernel to use as the ZeKernel initally for native handle support.
590+ // This makes the assumption that this device is the same device where this
591+ // kernel was created.
592+ auto ZeKernelDevice = Kernel->ZeKernel ;
593+ auto It = Kernel->ZeKernelMap .find (Device->ZeDevice );
594+ if (It != Kernel->ZeKernelMap .end ()) {
595+ ZeKernelDevice = Kernel->ZeKernelMap [Device->ZeDevice ];
596+ }
597+ if (ZeKernelDevice) {
598+ auto ZeResult = ZE_CALL_NOCHECK (zeKernelGetProperties,
599+ (ZeKernelDevice, &kernelProperties));
600+ if (ZeResult || workGroupProperties.maxGroupSize == 0 ) {
601+ return ReturnValue (
602+ uint64_t {Device->ZeDeviceComputeProperties ->maxTotalGroupSize });
603+ }
604+ return ReturnValue (workGroupProperties.maxGroupSize );
605+ } else {
594606 return ReturnValue (
595607 uint64_t {Device->ZeDeviceComputeProperties ->maxTotalGroupSize });
596608 }
597- return ReturnValue (workGroupProperties.maxGroupSize );
598609 }
599610 case UR_KERNEL_GROUP_INFO_COMPILE_WORK_GROUP_SIZE: {
600611 struct {
You can’t perform that action at this time.
0 commit comments