c++ - How to use templates with OpenCL? -
according this document page 6 (released amd) (and topics ?), there ways utilize templates opencl. however, first document reports done using options clbuildprogramwithsource doesn't seem exist... anyway, assuming clbuildprogram rather previous one, attempted utilize called "-x" alternative "clc++", still, not recognized :
warning: ignoring build option: "-x"
in fact, according documentation stemming khronos, alternative not available! document may deprecated somehow, there other ways utilize templates within opencl code?
the -x
alternative available on latest amd opencl runtimes back upwards opencl 1.2 , static c++ language extension. won't find word in official khronos docs because amd initiative, and, ultimately, vendor extension.
i assume have right runtime, kernel needs built these options:
-x clc++
if able build kernels classes using this, should able utilize templates.
if doesn't work, means either runtime installation botched, e.g. you're using wrong compiler somehow, or means not have right runtime. if so, please give platform info.
i've messed static c++ extension while ago , can testify -x clc++
work.
also beware using extension render code not portable , locked in amd-compliant devices, unlikely other vendors introduce exact same extension (if ever).
also, note on khronos docs - ones returned google typically opencl 1.0 versions can irritating. recommend downloading 1.1 or 1.2 standard getting local re-create of relevant html documentation quick access, if utilize opencl lot. helps.
c++ templates opencl
No comments:
Post a Comment