clspv icon indicating copy to clipboard operation
clspv copied to clipboard

OpenCL C++ support

Open jbsolomon opened this issue 5 years ago • 2 comments

Hi -- I noticed that in the following issue, @kpet mentioned that there's OpenCL C++ support. I'm interested in using this for a "realtime" rendering experiment with OpenVDB since VDB isn't well-supported on GPU anywhere else (it's highly template-oriented) and I'm targeting Vulkan.

https://github.com/google/clspv/issues/371#issuecomment-492812831

Is there any documentation for this or for its status? I'd love to give it a spin!

jbsolomon avatar Mar 24 '20 14:03 jbsolomon

C++ for OpenCL itself is experimental and work-in-progress. The language documentation for C++ for OpenCL is maintained there: https://github.com/KhronosGroup/OpenCL-Docs/tree/master/cxx4opencl. Feedback on missing features of interest is welcome as issues in https://github.com/KhronosGroup/OpenCL-Docs.

You can pass -cl-std=CLC++ to clspv to compile C++ for OpenCL (you wil also need -inline-entry-points). clspv support for this is even more experimental than OpenCL C support but the basics seem to work and I know a couple of people who have had success playing with this.

Feel free to raise issues as and when you hit them (and don't hesitate to let us know about significant successes as well :)).

kpet avatar Mar 24 '20 15:03 kpet

If use combination of further flags

-pod-pushconstant -cl-std=CLC++ -inline-entry-points

got:

POD arguments as push constants are not compatible with module scope push constants

Can't say this is critical, but a bit confusing. It works without -pod-pushconstant.

FROL256 avatar Mar 31 '21 09:03 FROL256

as shown in compiler-explorer, clspv supports CLC++

rjodinchr avatar Mar 29 '23 09:03 rjodinchr