According to this document page 6 (released by AMD) (and this topics ?), there are some ways to use templates with OpenCL. However, the first document reports this could be done by using some options with clBuildProgramWithSource which doesn't seem to exist... Anyway, assuming it is clBuildProgram rather than the previous one, I attempted to use the so called "-x" option with "clc++", but still, it is not recognized :
warning: ignoring build option: "-x"
In fact, according to the documentation stemming from Khronos, this option is not available! This document may well be deprecated somehow, but are there other ways to use templates inside an OpenCL code?