[SYCL] Add max work-group size kernel properties
This patch adds two kernel properties to allow users to specify the maximum work-group size that a kernel will be invoked with.
The max_work_group_size property corresponds to the intel::max_work_group_size function attribute, but can be specified with 1, 2, or 3 dimensions (unlike the attribute which accepts only 3).
The max_linear_work_group_size property is similar but is always a single value which denotes the combined linear (total) work-group size. This can be used when the user cannot guarantee a maximum bound in each of the dimensions they wish to run the kernel, but can guarantee a total. This acts similarly to CUDA's maxThreadsPerBlock launch bounds property.
This patch also wires up the 'max_work_group_size' property to the equivalent SPIR-V execution mode, which should hopefully improve certain use cases.
Split from #14448, @steffenlarsen and @gmlueck
Could you please add a CodeGen lit test to exercise the changes in NVPTX.cpp?
Sorry, do you mean a backend CodeGen LIT test, or a frontend CodeGen test?
There are separate (upstream) backend CodeGen tests already for the NVVM annotations, like this one.
This PR adds frontend "CodeGen" tests in sycl/test/check_device_code/extensions/properties, as that's where the LLVM IR codegen tests for the other properties takes place. I think this is the same discussion as in #14502.
Could you please add a CodeGen lit test to exercise the changes in NVPTX.cpp?
Note the updated version of this patch doesn't touch clang any more once #14634 landed.
ping @intel/dpcpp-spirv-reviewers, thanks
ping @intel/dpcpp-spirv-reviewers
Three E2E tests failing on linux:
Failed Tests (3):
SYCL :: DeviceDependencies/free_function_kernels.cpp
SYCL :: LLVMIntrinsicLowering/bitreverse.cpp
SYCL :: LLVMIntrinsicLowering/sub_byte_bitreverse.cpp
All for the same reason:
clang++: error: option '-fno-sycl-allow-device-dependencies' is deprecated and will be removed in a future release
Looks like a pre-existing problem.
Same on Windows:
********************
Failed Tests (2):
SYCL :: DeviceDependencies/free_function_kernels.cpp
SYCL :: LLVMIntrinsicLowering/bitreverse.cpp
@intel/llvm-gatekeepers this is ready to merge, thanks. The failures are unrelated (see above).