<?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 Hi Charles, in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183834#M392</link>
    <description>&lt;P&gt;Hi Charles,&lt;/P&gt;&lt;P&gt;Thanks for the information we will take a note of this thing and will concern to our engineering&amp;nbsp;team.&lt;/P&gt;&lt;P&gt;We will try to increase the work size as specified&amp;nbsp;and will give you more clear information regarding your issue.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;-Abhishek&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Feb 2020 07:20:00 GMT</pubDate>
    <dc:creator>AbhishekD_Intel</dc:creator>
    <dc:date>2020-02-12T07:20:00Z</dc:date>
    <item>
      <title>calling printf from within kernel</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183830#M388</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The release notes for beta04 state the following is supported:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; - "printf" support in device code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I try this I get an error message:&lt;/P&gt;
&lt;PRE class="brush:bash; class-name:dark;"&gt;error: SYCL kernel cannot call a variadic function&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there some special incantation?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2020 13:31:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183830#M388</guid>
      <dc:creator>leggett__charles</dc:creator>
      <dc:date>2020-02-10T13:31:03Z</dc:date>
    </item>
    <item>
      <title>Figured it out after digging</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183831#M389</link>
      <description>&lt;P&gt;Figured it out after digging through the compiler source:&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark;"&gt;#ifdef __SYCL_DEVICE_ONLY__
  #define CONSTANT __attribute__((opencl_constant))
#else
  #define CONSTANT
#endif

static const CONSTANT char FMT[] = "n: %d\n";
sycl::intel::experimental::printf(FMT, 7);&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suggest fixing the &lt;A href="https://software.intel.com/en-us/articles/intel-oneapi-dpcpp-compiler-release-notes-beta"&gt;release notes&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;However, after a number of iterations in a parallel_for, it will segfault.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 08:37:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183831#M389</guid>
      <dc:creator>leggett__charles</dc:creator>
      <dc:date>2020-02-11T08:37:57Z</dc:date>
    </item>
    <item>
      <title>Hi Charles,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183832#M390</link>
      <description>&lt;P&gt;Hi Charles,&lt;/P&gt;&lt;P&gt;It is specified in the &lt;A href="https://software.intel.com/en-us/articles/intel-oneapi-dpcpp-compiler-release-notes-beta"&gt;release notes&lt;/A&gt; the complete implementation of "printf" with the example.&lt;/P&gt;&lt;P&gt;Can you be more specific regarding your iterations in parallel_for? It will good if you can share your code snippet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 14:14:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183832#M390</guid>
      <dc:creator>AbhishekD_Intel</dc:creator>
      <dc:date>2020-02-11T14:14:48Z</dc:date>
    </item>
    <item>
      <title>yes - please note that the</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183833#M391</link>
      <description>&lt;P&gt;hi Abhishek -&lt;/P&gt;&lt;P&gt;yes - please note that the release notes are incorrect - they're missing the "__" at the beginning and end of the SYCL_DEVICE_ONLY macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my simple example, I'm printing out some integer counters such as cl::sycl::item&amp;lt;1&amp;gt;.get_linear_id()&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark;"&gt; auto k2 = [=](cl::sycl::item&amp;lt;1&amp;gt; item) {
 ...
   unsigned int i = item.get_linear_id(); 
   static const CONSTANT char FMT[] = "n: %u\n";
   sycl::intel::experimental::printf(FMT, i);
...&lt;/PRE&gt;

&lt;P&gt;when the work size is between 2^16 and 2^17, first it stops printing out the integers (though continues to print out the rest of the string part of the statement, then as the work size increases further, it segfaults.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I try to print out more values in the same statement (eg several integers), it will start failing for smaller work sizes. Maybe a buffer is getting filled?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 17:07:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183833#M391</guid>
      <dc:creator>leggett__charles</dc:creator>
      <dc:date>2020-02-11T17:07:00Z</dc:date>
    </item>
    <item>
      <title>Hi Charles,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183834#M392</link>
      <description>&lt;P&gt;Hi Charles,&lt;/P&gt;&lt;P&gt;Thanks for the information we will take a note of this thing and will concern to our engineering&amp;nbsp;team.&lt;/P&gt;&lt;P&gt;We will try to increase the work size as specified&amp;nbsp;and will give you more clear information regarding your issue.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;-Abhishek&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 07:20:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183834#M392</guid>
      <dc:creator>AbhishekD_Intel</dc:creator>
      <dc:date>2020-02-12T07:20:00Z</dc:date>
    </item>
    <item>
      <title>Hi Charles,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183835#M393</link>
      <description>&lt;P&gt;Hi Charles,&lt;/P&gt;&lt;P&gt;I tried the way you are solving the problem and its working for me, even for the workgroup size more than 2^17 it's executing the code and also printing the whole string with numbers without any segFault, you can find the code that I have used:&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark;"&gt;#ifdef __SYCL_DEVICE_ONLY__
          #define CONSTANT __attribute__((opencl_constant))
#else
          #define CONSTANT
#endif


auto exception_handler = [] (cl::sycl::exception_list exceptions) {
      for (std::exception_ptr const&amp;amp; e : exceptions) {
         try {
            std::rethrow_exception(e);
         } catch(cl::sycl::exception const&amp;amp; e) {
         std::cout &amp;lt;&amp;lt; "Caught asynchronous SYCL exception:\n"
                   &amp;lt;&amp;lt; e.what() &amp;lt;&amp;lt; std::endl;
         }
      }
   };


        cl::sycl::queue queue(sycl::default_selector{}, exception_handler);

        std::cout &amp;lt;&amp;lt; "Running on "
                &amp;lt;&amp;lt; queue.get_device().get_info&amp;lt;cl::sycl::info::device::name&amp;gt;()
                &amp;lt;&amp;lt; "\n";
        {

                queue.submit([&amp;amp;] (cl::sycl::handler&amp;amp; cgh) {
                                
                                cgh.parallel_for&amp;lt;class vector_addition&amp;gt;(cl::sycl::range&amp;lt;1&amp;gt;(N), [=](cl::sycl::item&amp;lt;1&amp;gt; idx) {
                                                
                                                unsigned int i = idx.get_linear_id();
                                                static const CONSTANT char FMT[] = "n: %u\n";
                                                sycl::intel::experimental::printf(FMT, i);

                                                });
                                });
        }
&lt;/PRE&gt;

&lt;P&gt;As the workgroup size limit is between&amp;nbsp;0 to 4,294,967,295 it will run without any segFault, I will suggest you to debug&amp;nbsp;your code&amp;nbsp;and if possible send your source code so that we can debug the problem.&lt;/P&gt;
&lt;P&gt;-Abhishek&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 13:31:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183835#M393</guid>
      <dc:creator>AbhishekD_Intel</dc:creator>
      <dc:date>2020-02-12T13:31:00Z</dc:date>
    </item>
    <item>
      <title>Hi Charles,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183836#M394</link>
      <description>&lt;P&gt;Hi Charles,&lt;/P&gt;&lt;P&gt;I hope your issue got resolved, Can we close this thread?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 04:40:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183836#M394</guid>
      <dc:creator>AbhishekD_Intel</dc:creator>
      <dc:date>2020-02-18T04:40:16Z</dc:date>
    </item>
    <item>
      <title>Hi Abhishek -</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183837#M395</link>
      <description>Hi Abhishek -

  I don't think it's resolved - there's definitely something odd going on. If you can provide me with an email address, I'll send you my code. Otherwise I will be at the Aurora workshop next week, and can discuss it with the dpcpp developers there.</description>
      <pubDate>Tue, 18 Feb 2020 06:07:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183837#M395</guid>
      <dc:creator>leggett__charles</dc:creator>
      <dc:date>2020-02-18T06:07:23Z</dc:date>
    </item>
    <item>
      <title>Hi Charles,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183838#M396</link>
      <description>&lt;P&gt;Hi Charles,&lt;/P&gt;&lt;P&gt;You can send me your code privately so that we can debug it.&lt;/P&gt;&lt;P&gt;-Abhishek&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 06:53:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183838#M396</guid>
      <dc:creator>AbhishekD_Intel</dc:creator>
      <dc:date>2020-02-18T06:53:25Z</dc:date>
    </item>
    <item>
      <title>Hi Charles,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183839#M397</link>
      <description>&lt;P&gt;Hi Charles,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;We tested the code that you shared privately,&amp;nbsp;and on our platform with Ubuntu 18.04 and&amp;nbsp;beta-04 Toolkit and its working perfectly.&lt;/P&gt;&lt;P&gt;We are working on the logs&amp;nbsp;shared by you privately and will get back to you soon.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 13:36:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1183839#M397</guid>
      <dc:creator>AbhishekD_Intel</dc:creator>
      <dc:date>2020-02-21T13:36:39Z</dc:date>
    </item>
    <item>
      <title>Re:calling printf from within kernel</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1285774#M1231</link>
      <description>&lt;P&gt;Hi Charles,&lt;/P&gt;&lt;P&gt;Can you confirm whether the issue is resolved with Gold?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Subarna&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 31 May 2021 06:33:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1285774#M1231</guid>
      <dc:creator>Subarnarek_G_Intel</dc:creator>
      <dc:date>2021-05-31T06:33:07Z</dc:date>
    </item>
    <item>
      <title>Re:calling printf from within kernel</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1286553#M1251</link>
      <description>&lt;P&gt;Closing this thread as the bug is already fixed. &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jun 2021 15:01:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1286553#M1251</guid>
      <dc:creator>Subarnarek_G_Intel</dc:creator>
      <dc:date>2021-06-02T15:01:48Z</dc:date>
    </item>
    <item>
      <title>Re:calling printf from within kernel</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1286554#M1252</link>
      <description>&lt;P&gt;&lt;I style="font-family: Calibri, sans-serif; font-size: 11pt;"&gt;This issue has been resolved and we will no longer respond to this thread.&amp;nbsp;If you require additional assistance from Intel, please start a new thread.&amp;nbsp;Any further interaction in this thread will be considered community only&lt;/I&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jun 2021 15:02:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/calling-printf-from-within-kernel/m-p/1286554#M1252</guid>
      <dc:creator>Subarnarek_G_Intel</dc:creator>
      <dc:date>2021-06-02T15:02:04Z</dc:date>
    </item>
  </channel>
</rss>

