File tree 2 files changed +19
-4
lines changed
source/adapters/level_zero 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
215
215
getZeStructureType<ze_relaxed_allocation_limits_exp_desc_t >() {
216
216
return ZE_STRUCTURE_TYPE_RELAXED_ALLOCATION_LIMITS_EXP_DESC;
217
217
}
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
+ }
218
223
template <> ze_structure_type_t getZeStructureType<ze_host_mem_alloc_desc_t >() {
219
224
return ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC;
220
225
}
Original file line number Diff line number Diff line change @@ -574,10 +574,20 @@ UR_APIEXPORT ur_result_t UR_APICALL urKernelGetGroupInfo(
574
574
return ReturnValue (GlobalWorkSize);
575
575
}
576
576
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 );
581
591
}
582
592
case UR_KERNEL_GROUP_INFO_COMPILE_WORK_GROUP_SIZE: {
583
593
struct {
You can’t perform that action at this time.
0 commit comments