[PATCH] D47958: [CUDA][HIP] Allow CUDA `__global__` functions to have amdgpu kernel attributes

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 8 14:07:57 PDT 2018


yaxunl marked an inline comment as done.
yaxunl added a comment.

In https://reviews.llvm.org/D47958#1126875, @tra wrote:

> Drive-by review:
>
> The patch could use a better description.
>  Something that describes *what* the patch does (E.g. enforce that attributes X/Y/Z are only applied to __global__ functions.)
>  *why* the change is needed is relevant, too, but it's not very useful without the *what* part.


Thanks for your suggestion. Modified the description.



================
Comment at: test/SemaCUDA/amdgpu-attrs.cu:66-69
+// expected-error at +2{{attribute 'reqd_work_group_size' can only be applied to a kernel function}}
+__attribute__((reqd_work_group_size(32, 64, 64)))
+__global__ void reqd_work_group_size_32_64_64() {}
+
----------------
tra wrote:
> This is confusing. Isn't `kernel` == `__global__` function?
> 
> Considering that the error message is `diag::err_opencl_kernel_attr`, I think the diagnostics should say `applied to a OpenCL kernel function`
Thanks for the suggestion. Will do.


https://reviews.llvm.org/D47958





More information about the cfe-commits mailing list