<?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 Re: Can opencl based code run on devcloud opeapi jupyterlab? in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/Can-opencl-based-code-run-on-devcloud-opeapi-jupyterlab/m-p/1403146#M7082</link>
    <description>&lt;P&gt;ok I will try it!&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jul 2022 14:54:05 GMT</pubDate>
    <dc:creator>Wei-Chih</dc:creator>
    <dc:date>2022-07-25T14:54:05Z</dc:date>
    <item>
      <title>Can opencl based code run on devcloud opeapi jupyterlab?</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Can-opencl-based-code-run-on-devcloud-opeapi-jupyterlab/m-p/1400116#M7073</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I want to know if opencl based code can run on oneapi devcloud to run cpu, gpu and fpga if i add sycl device selector sentence on my opencl based code and perform on devcloud?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 22:08:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Can-opencl-based-code-run-on-devcloud-opeapi-jupyterlab/m-p/1400116#M7073</guid>
      <dc:creator>Wei-Chih</dc:creator>
      <dc:date>2022-07-13T22:08:36Z</dc:date>
    </item>
    <item>
      <title>Re:Can opencl based code run on devcloud opeapi jupyterlab?</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Can-opencl-based-code-run-on-devcloud-opeapi-jupyterlab/m-p/1401483#M7077</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;I'm not sure how you add the sycl selector to your opencl code, maybe you can provide a simple code.&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;Do you want to use your OpenCL kernel with SYCL program? You can do interoperability with backend API, and for the details you can refer to the SYCL 2020 spec &lt;A href="https://registry.khronos.org/SYCL/specs/sycl-2020/pdf/sycl-2020.pdf" target="_blank"&gt;https://registry.khronos.org/SYCL/specs/sycl-2020/pdf/sycl-2020.pdf&lt;/A&gt;, please go to Appendix C: OpenCL backend specification.  A simple code is attached for your reference, not sure if it meets your requirements.  You can compile the code with the command "dpcpp test.cpp -lOpenCL"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;//test.cpp&lt;/P&gt;&lt;P&gt;#include&amp;lt;CL/sycl.hpp&amp;gt;&lt;/P&gt;&lt;P&gt;#include&amp;lt;iostream&amp;gt;&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;int main() {&lt;/P&gt;&lt;P&gt;constexpr size_t size = 16;&lt;/P&gt;&lt;P&gt;std::array&amp;lt;int, size&amp;gt; data;&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;for (int i = 0; i &amp;lt; size; i++) { data[i] = i; }&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;sycl::device dev(sycl::default_selector{});&lt;/P&gt;&lt;P&gt;sycl::context ctx=sycl::context(dev);&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;//auto ocl_dev=dev.get_native&amp;lt;cl::sycl::backend::opencl&amp;gt;();&lt;/P&gt;&lt;P&gt;//auto ocl_ctx=ctx.get_native&amp;lt;cl::sycl::backend::opencl&amp;gt;();&lt;/P&gt;&lt;P&gt;auto ocl_dev=sycl::get_native&amp;lt;cl::sycl::backend::opencl,sycl::device&amp;gt;(dev);&lt;/P&gt;&lt;P&gt;auto ocl_ctx=sycl::get_native&amp;lt;cl::sycl::backend::opencl,sycl::context&amp;gt;(ctx);&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;cl_int err = CL_SUCCESS;&lt;/P&gt;&lt;P&gt;//cl_command_queue ocl_queue = clCreateCommandQueue(ocl_ctx, ocl_dev,0,&amp;amp;err);&lt;/P&gt;&lt;P&gt;cl_command_queue ocl_queue = clCreateCommandQueueWithProperties(ocl_ctx, ocl_dev,0,&amp;amp;err);&lt;/P&gt;&lt;P&gt;sycl::queue q=sycl::make_queue&amp;lt;sycl::backend::opencl&amp;gt;(ocl_queue,ctx); &lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;cl_mem ocl_buf = clCreateBuffer(ocl_ctx,CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, size * sizeof(int), &amp;amp;data[0],&amp;amp;err);&lt;/P&gt;&lt;P&gt;sycl::buffer&amp;lt;int, 1&amp;gt; buffer =sycl::make_buffer&amp;lt;sycl::backend::opencl, int&amp;gt;(ocl_buf, ctx);&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;const char* kernelSource =&lt;/P&gt;&lt;P&gt;R"CLC(&lt;/P&gt;&lt;P&gt;kernel void add(global int* data) {&lt;/P&gt;&lt;P&gt;int index = get_global_id(0);&lt;/P&gt;&lt;P&gt;data[index] = data[index] + 1;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;)CLC"; &lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;cl_program ocl_program = clCreateProgramWithSource(ocl_ctx,1,&amp;amp;kernelSource, nullptr, &amp;amp;err);&lt;/P&gt;&lt;P&gt;clBuildProgram(ocl_program, 1, &amp;amp;ocl_dev, nullptr, nullptr, nullptr);&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;cl_kernel ocl_kernel = clCreateKernel(ocl_program, "add", nullptr);&lt;/P&gt;&lt;P&gt;sycl::kernel add_kernel = sycl::make_kernel&amp;lt;sycl::backend::opencl&amp;gt;(ocl_kernel, ctx);&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;q.submit([&amp;amp;](sycl::handler&amp;amp; h){&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; auto data_acc =buffer.get_access&amp;lt;sycl::access_mode::read_write, sycl::target::device&amp;gt;(h);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; h.set_args(data_acc);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; h.parallel_for(size,add_kernel);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }).wait();&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;clEnqueueReadBuffer(ocl_queue, ocl_buf, CL_TRUE, 0, size*sizeof(int), &amp;amp;data[0], 0, NULL, NULL); &lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;for (int i = 0; i &amp;lt; size; i++) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if (data[i] != i + 1) { std::cout &amp;lt;&amp;lt; "Results did not validate at index " &amp;lt;&amp;lt; i &amp;lt;&amp;lt; "!\n"; return -1; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;std::cout &amp;lt;&amp;lt; "Success!\n";&lt;/P&gt;&lt;P&gt;return 0;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Jul 2022 08:22:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Can-opencl-based-code-run-on-devcloud-opeapi-jupyterlab/m-p/1401483#M7077</guid>
      <dc:creator>cw_intel</dc:creator>
      <dc:date>2022-07-19T08:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Can opencl based code run on devcloud opeapi jupyterlab?</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Can-opencl-based-code-run-on-devcloud-opeapi-jupyterlab/m-p/1401490#M7079</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks for your reply&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I want to try this opencl project from github as below like, how can I do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/eejlny/BUDE-HARP/tree/master/bude_gpu" target="_blank"&gt;https://github.com/eejlny/BUDE-HARP/tree/master/bude_gpu&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 08:46:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Can-opencl-based-code-run-on-devcloud-opeapi-jupyterlab/m-p/1401490#M7079</guid>
      <dc:creator>Wei-Chih</dc:creator>
      <dc:date>2022-07-19T08:46:06Z</dc:date>
    </item>
    <item>
      <title>Re:Can opencl based code run on devcloud opeapi jupyterlab?</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Can-opencl-based-code-run-on-devcloud-opeapi-jupyterlab/m-p/1402990#M7081</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I think you can compile the code with command "dpcpp bude.cpp -lOpenCL" if OpenCL RT is installed on your machine.  If you use Devcloud, I think it is installed. &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 25 Jul 2022 06:54:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Can-opencl-based-code-run-on-devcloud-opeapi-jupyterlab/m-p/1402990#M7081</guid>
      <dc:creator>cw_intel</dc:creator>
      <dc:date>2022-07-25T06:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can opencl based code run on devcloud opeapi jupyterlab?</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Can-opencl-based-code-run-on-devcloud-opeapi-jupyterlab/m-p/1403146#M7082</link>
      <description>&lt;P&gt;ok I will try it!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 14:54:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Can-opencl-based-code-run-on-devcloud-opeapi-jupyterlab/m-p/1403146#M7082</guid>
      <dc:creator>Wei-Chih</dc:creator>
      <dc:date>2022-07-25T14:54:05Z</dc:date>
    </item>
    <item>
      <title>Re:Can opencl based code run on devcloud opeapi jupyterlab?</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Can-opencl-based-code-run-on-devcloud-opeapi-jupyterlab/m-p/1408856#M7086</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri;"&gt;We haven't heard back from you for a long time so we are assuming that the provided details helped you in solving your problem. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Aug 2022 14:55:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Can-opencl-based-code-run-on-devcloud-opeapi-jupyterlab/m-p/1408856#M7086</guid>
      <dc:creator>cw_intel</dc:creator>
      <dc:date>2022-08-17T14:55:36Z</dc:date>
    </item>
  </channel>
</rss>

