<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Does Intel OpenCL 2.1 support kernel C++? in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/Does-Intel-OpenCL-2-1-support-kernel-C/m-p/1151268#M6093</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on a project where I'm using OpenCL 2.1 NEO and I want to know if I can use C++ inside the kernel code. I see AMD has that feature and also OpenCL 2.1 it has C++ specs. But I'm not able to use the C++ code inside the kernel.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2019 09:47:23 GMT</pubDate>
    <dc:creator>shetty__sujay</dc:creator>
    <dc:date>2019-12-04T09:47:23Z</dc:date>
    <item>
      <title>Does Intel OpenCL 2.1 support kernel C++?</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Does-Intel-OpenCL-2-1-support-kernel-C/m-p/1151268#M6093</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on a project where I'm using OpenCL 2.1 NEO and I want to know if I can use C++ inside the kernel code. I see AMD has that feature and also OpenCL 2.1 it has C++ specs. But I'm not able to use the C++ code inside the kernel.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 09:47:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Does-Intel-OpenCL-2-1-support-kernel-C/m-p/1151268#M6093</guid>
      <dc:creator>shetty__sujay</dc:creator>
      <dc:date>2019-12-04T09:47:23Z</dc:date>
    </item>
    <item>
      <title>Hi SujayS,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Does-Intel-OpenCL-2-1-support-kernel-C/m-p/1151269#M6094</link>
      <description>&lt;P&gt;Hi SujayS,&lt;/P&gt;&lt;P&gt;Thanks for the interest and the question. I think your question can help a lot of users, so I'm&amp;nbsp;linking some useful resources for users who want to develop with OpenCL-C++ and Intel Graphics Compute Runtime for OpenCL Driver (NEO).&lt;/P&gt;&lt;P&gt;At this time, NEO can&amp;nbsp;ingest SPIR-V. Exploring compilation of&amp;nbsp;OpenCL-C++ to SPIR-V may help you. Here are some overview references and examples:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://github.com/intel/compute-runtime/issues/173#issuecomment-499433587"&gt;NEO Reference&lt;/A&gt;&amp;nbsp;on ingesting OpenCL-C++ through SPIR-V&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://www.anandtech.com/show/9039/khronos-announces-opencl-21-c-comes-to-opencl"&gt;Khronos Announcement&lt;/A&gt;&amp;nbsp;for how SPIR-V ingestion works.&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://www.khronos.org/developers/library/2019-iwocl"&gt;IWOCL 2019 Keynote (see page 20)&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://godbolt.org/z/nGvxAC"&gt;Godbolt (CLANG-LLVM) toolchain example from IWOCL 2019 Keynote&lt;/A&gt;&lt;UL&gt;&lt;LI&gt;Note: it looks like for more recent versions of the clang environment the toggle has changed to -cl-std=clc++ from -cl-std=c++ used in the prepopulated godbolt example.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Khronos SPIR repo &lt;A href="https://clang.llvm.org/docs/UsersManual.html#id66"&gt;guidance&lt;/A&gt; for targeting with the SPIR-V enabled CLANG build toolchain.&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://clang.llvm.org/docs/ClangCommandLineReference.html"&gt;Clang cli document&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://clang.llvm.org/docs/UsersManual.html#id66"&gt;Clang Users Manual OpenCL section&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://software.intel.com/en-us/articles/spir-v-is-a-better-spir-with-intel-opencl-code-builder"&gt;Some context&lt;/A&gt; for ingesting SPIR-V with 2019 Update 5 and earlier versions of the Intel® SDK for OpenCL Applications.&lt;UL&gt;&lt;LI&gt;Note: ioc64 build command won't work for OpenCL-C++, but seeing the OpenCL-C -&amp;gt; SPIR-V -&amp;gt; clCreateProgramWithIL flow can be useful. The ingestion part should be similar.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some spellings for toggles may have been updated between clang version so picking a toolchain to fit your needs may not be so trivial. The Khronos SPIR repo looks like a good place to start to keep it simple.&lt;/P&gt;&lt;P&gt;Hopefully, browsing the above guidance can help you get there. Please let us know how your exploration goes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-MichaelC&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 23:38:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Does-Intel-OpenCL-2-1-support-kernel-C/m-p/1151269#M6094</guid>
      <dc:creator>Michael_C_Intel1</dc:creator>
      <dc:date>2019-12-05T23:38:00Z</dc:date>
    </item>
    <item>
      <title>SujayS,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Does-Intel-OpenCL-2-1-support-kernel-C/m-p/1151270#M6095</link>
      <description>&lt;P&gt;SujayS,&lt;/P&gt;&lt;P&gt;Also noteworthy,&amp;nbsp; the &lt;EM&gt;ioc64 &lt;/EM&gt;tool, can compile SPIR-V to both Intel CPU and Intel Graphics Technology (NEO enabled) targets. You may wish to use it to check offline compilation for targets of interest.&amp;nbsp;The ioc64 tool comes with Intel® SDK for OpenCL™ Applications and&amp;nbsp;the Intel® oneAPI beta Data Parallel C++ Base Toolkit.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ioc64&lt;/EM&gt;&amp;nbsp;maintainers monitor these forums so if you have SPIR-V usage feedback for Intel platforms this would be a good thread to speak to your experience.&lt;/P&gt;&lt;P&gt;-MichaelC&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 23:46:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Does-Intel-OpenCL-2-1-support-kernel-C/m-p/1151270#M6095</guid>
      <dc:creator>Michael_C_Intel1</dc:creator>
      <dc:date>2019-12-05T23:46:00Z</dc:date>
    </item>
    <item>
      <title>I'd like to add a few other</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Does-Intel-OpenCL-2-1-support-kernel-C/m-p/1151271#M6096</link>
      <description>&lt;P&gt;I'd like to add a few additional links to Michael's excellent list above:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Here is an updated link demonstrating an&amp;nbsp;OpenCL C++ kernel and command line that compiles through standard Clang (at least, as of this&amp;nbsp;writing):&amp;nbsp;&amp;nbsp;https://godbolt.org/z/mZ22WE&lt;/LI&gt;&lt;LI&gt;Here is the open source SPIR-V LLVM translator that can convert the LLVM IR bitcode emitted by Clang to SPIR-V:&amp;nbsp;https://github.com/khronosgroup/spirv-llvm-translator&lt;/LI&gt;&lt;LI&gt;Here is an example demonstrating how to create a kernel from a file containing SPIR-V (works on Windows and Linux):&amp;nbsp;https://github.com/bashbaug/SimpleOpenCLSamples/tree/master/samples/05_spirvkernelfromfile&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Finally, if you are interested in a more complete end-to-end C++ experience, I'd encourage you to take a look at SYCL and Intel oneAPI Data Parallel C++.&amp;nbsp; More information about Data Parallel C++ can be found here:&amp;nbsp;https://software.intel.com/en-us/oneapi/dpc-compiler&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 06:47:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Does-Intel-OpenCL-2-1-support-kernel-C/m-p/1151271#M6096</guid>
      <dc:creator>Ben_A_Intel</dc:creator>
      <dc:date>2019-12-06T06:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: Does Intel OpenCL 2.1 support kernel C++?</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Does-Intel-OpenCL-2-1-support-kernel-C/m-p/1283924#M6900</link>
      <description>&lt;P&gt;Is there any way to do compilation of C++ code (for use within an OpenCL kernel) at runtime with Intel OpenCL?&lt;BR /&gt;All avenues suggest that code must be compiled to SPIRV first (at application build/compile time),&amp;nbsp;without allowing arbitrary C++ source to be created, compiled and executed all at runtime.&lt;/P&gt;
&lt;P&gt;Examples of existing toolsets that allow for runtime compilation:&lt;BR /&gt;- NVRTC&amp;nbsp; (nvidias runtime compiler)&lt;BR /&gt;- OpenGL/GLSL&lt;BR /&gt;- OpenCL (using standard C)&lt;BR /&gt;- OpenCL&amp;nbsp; on AMD&amp;nbsp; (via their "opencl static c++ kernel language" extension)&lt;BR /&gt;- etc...&lt;/P&gt;
&lt;P&gt;the use-case is executing shader graphs.&lt;BR /&gt;So imagine the user at runtime can construct an arbitrary node-graph representing a large computation.&lt;BR /&gt;I would like to translate that node-graph into C++ sourcecode at runtime, and then execute on the device.&lt;BR /&gt;If such a system were possible with Intel OpenCL,&amp;nbsp; what would need to be installed on the users machine to make this work?&lt;/P&gt;
&lt;P&gt;thanks very much&lt;BR /&gt;Brian Sharpe&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 00:57:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Does-Intel-OpenCL-2-1-support-kernel-C/m-p/1283924#M6900</guid>
      <dc:creator>Sharpe__Brian</dc:creator>
      <dc:date>2021-05-24T00:57:26Z</dc:date>
    </item>
  </channel>
</rss>

