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

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 8 13:59:45 PDT 2018


tra added a comment.

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.



================
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() {}
+
----------------
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`


https://reviews.llvm.org/D47958





More information about the cfe-commits mailing list