<?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:Using third party compilers with oneAPI in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Using-third-party-compilers-with-oneAPI/m-p/1482183#M3013</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We assume that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Vankudothu Vaishnavi.&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 02 May 2023 07:29:44 GMT</pubDate>
    <dc:creator>VaishnaviV_Intel</dc:creator>
    <dc:date>2023-05-02T07:29:44Z</dc:date>
    <item>
      <title>Using third party compilers with oneAPI</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Using-third-party-compilers-with-oneAPI/m-p/1478018#M2989</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I've been trying to compile a small program as a proof of concept using icpx and g++. I've been following the instructions provided &lt;A href="https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/developer-guide-reference/2023-0/use-third-party-compiler-as-host-compiler-dpc-code.html#GUID-609F7155-1B80-4E05-9FEC-BA7F0D6BD000" target="_blank" rel="noopener"&gt;here&lt;/A&gt;, but I can't get it to work. Specifically, when I run the following command:&lt;/P&gt;
&lt;P&gt;icpx -fsycl -fsycl-device-only -Xclang -fsycl-int-header=add-vector-host.h add-vector.cpp&lt;/P&gt;
&lt;P&gt;it generates an empty header file. I'm not sure what I'm doing wrong - the bc file seems to be generated correctly, but there are no specifications on what to do with that file.&lt;/P&gt;
&lt;P&gt;I'm using three different files: one with my host code, another with my function definition, and a header file. The program is just a simple vector addition. I've tried both a functor and a function with the SYCL_EXTERNAL macro, but neither has made any difference. If I compile everything with icpx it works just fine.&lt;/P&gt;
&lt;P&gt;Any help or advice would be greatly appreciated. Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 17:16:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Using-third-party-compilers-with-oneAPI/m-p/1478018#M2989</guid>
      <dc:creator>mcolacchio</dc:creator>
      <dc:date>2023-04-18T17:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using third party compilers with oneAPI</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Using-third-party-compilers-with-oneAPI/m-p/1478305#M2992</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for posting in Intel Communities.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We are unable to reproduce your issue at our end.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We are using oneAPI 2023.1.0 version and Ubuntu 20.04.6 LTS Operating system.&lt;/P&gt;
&lt;P&gt;Below is the sample code we used,&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;host.cpp&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;#include &amp;lt;CL/sycl.hpp&amp;gt;
#include &amp;lt;iostream&amp;gt;
#include "add-vector.h"

int main() {
  constexpr int N = 10;

  // Create a SYCL queue
  cl::sycl::queue q;

  // Create input and output buffers on the device
  cl::sycl::buffer&amp;lt;float&amp;gt; in_buf{cl::sycl::range&amp;lt;1&amp;gt;(N)};
  cl::sycl::buffer&amp;lt;float&amp;gt; out_buf{cl::sycl::range&amp;lt;1&amp;gt;(N)};

  // Initialize input buffer on the host
  {
    auto in_ptr = in_buf.get_access&amp;lt;cl::sycl::access::mode::write&amp;gt;();
    for (int i = 0; i &amp;lt; N; i++) {
      in_ptr[i] = i;
    }
  }

  // Launch the SYCL kernel
  q.submit([&amp;amp;](cl::sycl::handler&amp;amp; h) {
    auto in_ptr = in_buf.get_access&amp;lt;cl::sycl::access::mode::read&amp;gt;(h);
    auto out_ptr = out_buf.get_access&amp;lt;cl::sycl::access::mode::write&amp;gt;(h);
    h.parallel_for&amp;lt;class add_vector&amp;gt;(cl::sycl::range&amp;lt;1&amp;gt;(N),
                                      [=](cl::sycl::id&amp;lt;1&amp;gt; idx) {
      out_ptr[idx] = add(in_ptr[idx], 1.0f);
    });
  });

  // Read the output buffer from the device and print the results
  auto out_ptr = out_buf.get_access&amp;lt;cl::sycl::access::mode::read&amp;gt;();
  for (int i = 0; i &amp;lt; N; i++) {
    std::cout &amp;lt;&amp;lt; out_ptr[i] &amp;lt;&amp;lt; " ";
  }
  std::cout &amp;lt;&amp;lt; std::endl;

  return 0;
}
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;add-vector.cpp&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;#include &amp;lt;CL/sycl.hpp&amp;gt;
#include "add-vector.h"
float add(float a, float b) {
  return a + b;
}
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;add-vector.h&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;#ifndef ADD_VECTOR_H
#define ADD_VECTOR_H
float SYCL_EXTERNAL add(float a, float b);
#endif
&lt;/LI-CODE&gt;
&lt;P&gt;Here are the commands we tried, to execute the code:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;source /opt/intel/oneapi/setvars.sh
export LIBDIR=/opt/intel/oneapi/compiler/latest/linux/lib
icpx -fsycl -c host.cpp -fPIC -o host.o
icpx -fsycl -c add-vector.cpp -fPIC -o add-vector.o
icpx -fsycl -fsycl-device-only -Xclang -fsycl-int-header=a_host.h host.cpp
icpx -fsycl -fsycl-device-only -Xclang -fsycl-int-header=b_host.h add-vector.cpp
g++ -std=c++17 -c host.cpp -o a_host.o -include a_host.h -fPIC -I/opt/intel/oneapi/compiler/latest/linux/include -I/opt/intel/oneapi/compiler/latest/linux/include/sycl
g++ -std=c++17 -c add-vector.cpp -o b_host.o -include b_host.h -fPIC -I/opt/intel/oneapi/compiler/latest/linux/include -I/opt/intel/oneapi/compiler/latest/linux/include/sycl
icpx -fPIC -fsycl -fsycl-link host.o add-vector.o -o device.o
g++ a_host.o b_host.o device.o -L$LIBDIR -lOpenCL -lsycl -o finalexe.exe 
./finalexe.exe&lt;/LI-CODE&gt;
&lt;P&gt;Please let us know, if you still face any issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;
&lt;P&gt;Vankudothu Vaishnavi.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 10:55:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Using-third-party-compilers-with-oneAPI/m-p/1478305#M2992</guid>
      <dc:creator>VaishnaviV_Intel</dc:creator>
      <dc:date>2023-04-19T10:55:27Z</dc:date>
    </item>
    <item>
      <title>Re:Using third party compilers with oneAPI</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Using-third-party-compilers-with-oneAPI/m-p/1479995#M3008</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Has the information provided above helped? If yes, could you please confirm whether we can close this thread from our end?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Vankudothu Vaishnavi.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Apr 2023 10:26:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Using-third-party-compilers-with-oneAPI/m-p/1479995#M3008</guid>
      <dc:creator>VaishnaviV_Intel</dc:creator>
      <dc:date>2023-04-25T10:26:12Z</dc:date>
    </item>
    <item>
      <title>Re:Using third party compilers with oneAPI</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Using-third-party-compilers-with-oneAPI/m-p/1482183#M3013</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We assume that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Vankudothu Vaishnavi.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 02 May 2023 07:29:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Using-third-party-compilers-with-oneAPI/m-p/1482183#M3013</guid>
      <dc:creator>VaishnaviV_Intel</dc:creator>
      <dc:date>2023-05-02T07:29:44Z</dc:date>
    </item>
  </channel>
</rss>

