[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 21 14:19:53 PST 2024


erichkeane wrote:

> > Also note, this is missing Clang lit tests, and doesn't seem to be correctly handling dependent expressions for x,y, and z.
> 
> What does it mean to "handle dependent expressions for x,y, and z"? Thanks!

An expression can be 'dependent', which is a C++'ism for 'has some sort of dependence on a containing template'

SO something like:

```
template<typename T, unsigned Z>
[[clang::amdgpu_num_work_groups(T::value, std::is_aggregate_v<T< ? 1 : 2, Z)]] void foo(){}
```

Note how the 3 arguments to the attribute are each dependent in some way on one of the template arguments.

https://github.com/llvm/llvm-project/pull/79035


More information about the cfe-commits mailing list