File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
source/adapters/level_zero Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,11 @@ ze_structure_type_t
215215getZeStructureType<ze_relaxed_allocation_limits_exp_desc_t >() {
216216 return ZE_STRUCTURE_TYPE_RELAXED_ALLOCATION_LIMITS_EXP_DESC;
217217}
218+ template <>
219+ ze_structure_type_t
220+ getZeStructureType<ze_kernel_max_group_size_properties_ext_t >() {
221+ return ZE_STRUCTURE_TYPE_KERNEL_MAX_GROUP_SIZE_EXT_PROPERTIES;
222+ }
218223template <> ze_structure_type_t getZeStructureType<ze_host_mem_alloc_desc_t >() {
219224 return ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC;
220225}
Original file line number Diff line number Diff line change @@ -574,10 +574,20 @@ UR_APIEXPORT ur_result_t UR_APICALL urKernelGetGroupInfo(
574574 return ReturnValue (GlobalWorkSize);
575575 }
576576 case UR_KERNEL_GROUP_INFO_WORK_GROUP_SIZE: {
577- // As of right now, L0 is missing API to query kernel and device specific
578- // max work group size.
579- return ReturnValue (
580- uint64_t {Device->ZeDeviceComputeProperties ->maxTotalGroupSize });
577+ ZeStruct<ze_kernel_max_group_size_properties_ext_t > workGroupProperties;
578+ workGroupProperties.maxGroupSize = 0 ;
579+
580+ ZeStruct<ze_kernel_properties_t > kernelProperties;
581+ kernelProperties.pNext = &workGroupProperties;
582+
583+ auto ZeResult = ZE_CALL_NOCHECK (
584+ zeKernelGetProperties,
585+ (Kernel->ZeKernelMap [Device->ZeDevice ], &kernelProperties));
586+ if (ZeResult || workGroupProperties.maxGroupSize == 0 ) {
587+ return ReturnValue (
588+ uint64_t {Device->ZeDeviceComputeProperties ->maxTotalGroupSize });
589+ }
590+ return ReturnValue (workGroupProperties.maxGroupSize );
581591 }
582592 case UR_KERNEL_GROUP_INFO_COMPILE_WORK_GROUP_SIZE: {
583593 struct {
You can’t perform that action at this time.
0 commit comments