It would also be interesting to move from hardwiring memory class into type to a more flexible approach of storing array's memory class as an attribute. As OpenCL does not support classless pointers, however, using functions on arrays would require either code duplication or on-demand generation of versions of function with specific memory classes.

In order to avoid at least some of duplication, mechanism of #define macros can be used.