This commit extends the `ResourceLimitsAttr` to support specifying a minimal and maximal subgroup size, and extends `EntryPointABIAttr` to support specifying the requested subgroup size. This is possible now in Vulkan with the VK_EXT_subgroup_size_control extension. For OpenCL it's possible to use the `SubgroupSize` execution mode directly. Reviewed By: ThomasRaoux Differential Revision: https://reviews.llvm.org/D138962
15 lines
506 B
MLIR
15 lines
506 B
MLIR
// RUN: mlir-opt -test-spirv-entry-point-abi %s | FileCheck %s -check-prefix=DEFAULT
|
|
// RUN: mlir-opt -test-spirv-entry-point-abi="workgroup-size=32" %s | FileCheck %s -check-prefix=WG32
|
|
|
|
// DEFAULT: gpu.func @foo()
|
|
// DEFAULT-SAME: spirv.entry_point_abi = #spirv.entry_point_abi<workgroup_size = [1, 1, 1]>
|
|
|
|
// WG32: gpu.func @foo()
|
|
// WG32-SAME: spirv.entry_point_abi = #spirv.entry_point_abi<workgroup_size = [32, 1, 1]>
|
|
|
|
gpu.module @kernels {
|
|
gpu.func @foo() kernel {
|
|
gpu.return
|
|
}
|
|
}
|