max_size.cl:14:57: error: max_size attribute only applies to kernel paremeters which are in local or constant address space
kernel void foo1([[cl::max_size(1)]] cl::local_ptr<int> arg) { }
^
max_size.cl:16:54: error: max_size attribute only applies to kernel paremeters which are in local or constant address space
kernel void foo3([[cl::max_size(1)]] cl::local<int>& arg) { }
^
max_size.cl:18:60: error: max_size attribute only applies to kernel paremeters which are in local or constant address space
kernel void foo4([[cl::max_size(1)]] cl::constant_ptr<int> arg) { }
^
max_size.cl:20:57: error: max_size attribute only applies to kernel paremeters which are in local or constant address space
kernel void foo6([[cl::max_size(1)]] cl::constant<int>& arg) { }
^
4 errors generated.
I.e. the attribute works with cl::local<int>* and cl::constant<int>*.
(Also there is a typo (paremeters) in error messages)
OpenCL C++ specification:
(foo0 is a kernel from https://github.com/KhronosGroup/SPIR/blob/spirv-1.1/test/OpenCL/OpenCL22/attributes/TestBasicAttributes_max_size.cl)
I.e. the attribute works with
cl::local<int>*
andcl::constant<int>*
.(Also there is a typo (paremeters) in error messages)