cancel
Showing results for 
Search instead for 
Did you mean: 

OpenCL

cozy
Adept I

max_constant_size attribute is ignored while OpenCL kernel compiling

Hello.

I'm trying 'max_constant_size attribute' to optimize OpenCL performance.

But compiler(clBuildProgram) ignored this attribute. Can I have any workaround?

Regards,


source code

kernel void mykernel(global int* a,
constant int* b __attribute__((max_constant_size (65536)))
){
size_t idx = get_global_id(0);
a[idx] = b[idx & 0x3FFF];
}

 

compiler message

error: unknown attribute 'max_constant_size' ignored [-Werror,-Wunknown-attributes]

 

My platform

Ubuntu 22.04.1 LTS

ROCm 5.3.0

Radeon Pro VII

0 Likes
1 Solution

Here is the OpenCL team's feedback on this: 

"The "max_constant_size" attribute is not a standard OpenCL attribute. Maybe it was supported by the earlier compiler tool-chains like AMDIL or HSAIL, however the current OpenCL compiler does not support this attribute. 

It is to note that it would have little benefit for current AMD GPUs."

 

View solution in original post

0 Likes
5 Replies
dipak
Big Boss

Hi @cozy ,

Thank you for the query. I have whitelisted you and moved the post to the AMD OpenCL forum. 

Thanks.

0 Likes
dipak
Big Boss

I have forwarded the query to the OpenCL team. I will let you know once I get any feedback from them.

Please note, ROCm related support is provided at the ROCm GitHub site itself. Here is the link to post any  query/issue related to ROCm: https://github.com/RadeonOpenCompute/ROCm/issues

Thanks.

0 Likes

Thank you for your response.

Sorry, I didn't know that support site.

Thanks.

0 Likes

Here is the OpenCL team's feedback on this: 

"The "max_constant_size" attribute is not a standard OpenCL attribute. Maybe it was supported by the earlier compiler tool-chains like AMDIL or HSAIL, however the current OpenCL compiler does not support this attribute. 

It is to note that it would have little benefit for current AMD GPUs."

 

0 Likes

I understand. Thank you for your reply.

Please give my regards to OpenCL team.