<?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 Offloading to MIC an OpenMP user defined reduction: compilation fails in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Offloading-to-MIC-an-OpenMP-user-defined-reduction-compilation/m-p/1073760#M59071</link>
    <description>&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;Dear all,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;I am trying to compile with the latest Intel compiler (version 16.0.3) a very simple code in which an OpenMP v4.x user defined reduction is offloaded to a MIC.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;Here is the code (attached to the post, for your convenience):&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;#pragma offload_attribute (push,target(mic))&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;typedef struct&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; double real;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; double imag;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;} complex_t;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;complex_t&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;complex_add (complex_t a, complex_t b)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; complex_t c;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; c.real = a.real + b.real;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; c.imag = a.imag + b.imag;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; return c;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;#pragma offload_attribute (pop)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;int&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;main ()&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; complex_t x;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;#pragma omp declare reduction(cmplxAdd: complex_t: omp_out=complex_add(omp_out, omp_in)) initializer( omp_priv={0.0, 0.0} )&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;#pragma offload target(mic) out(x)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; &amp;nbsp; x = (complex_t) {0.0, 0.0};&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;#pragma omp parallel num_threads(48) reduction(cmplxAdd: x)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; x = (complex_t) {1.0, -1.0};&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; printf ("Done: result is &amp;nbsp;%f,%f\n", x.real, x.imag);&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;The code is compiled using&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;icc -O3 -qopenmp -o mytest mytest.c&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;The compiler fails, producing the following error message:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;/tmp/iccI8DGFd.o: In function `main':&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;main.c:(.text+0x199): undefined reference to `__udr_i_0x4633c48'&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;main.c:(.text+0x1d6): undefined reference to `__udr_c_0x4633658'&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;If I understand correctly, the first undefined reference is for the user defined reduction initializer, and the second one for the user defined reduction combiner (the reduction function). However, searching the Internet for related documentation I was not able to find anything about. What should I do to properly compile the code ? Am I missing linking one or more specific libraries ?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;Thank you in advance for your kind assistance.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;Massimo Cafaro&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 25 May 2016 15:36:27 GMT</pubDate>
    <dc:creator>Massimo_C_1</dc:creator>
    <dc:date>2016-05-25T15:36:27Z</dc:date>
    <item>
      <title>Offloading to MIC an OpenMP user defined reduction: compilation fails</title>
      <link>https://community.intel.com/t5/Software-Archive/Offloading-to-MIC-an-OpenMP-user-defined-reduction-compilation/m-p/1073760#M59071</link>
      <description>&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;Dear all,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;I am trying to compile with the latest Intel compiler (version 16.0.3) a very simple code in which an OpenMP v4.x user defined reduction is offloaded to a MIC.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;Here is the code (attached to the post, for your convenience):&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;#pragma offload_attribute (push,target(mic))&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;typedef struct&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; double real;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; double imag;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;} complex_t;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;complex_t&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;complex_add (complex_t a, complex_t b)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; complex_t c;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; c.real = a.real + b.real;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; c.imag = a.imag + b.imag;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; return c;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;#pragma offload_attribute (pop)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;int&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;main ()&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; complex_t x;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;#pragma omp declare reduction(cmplxAdd: complex_t: omp_out=complex_add(omp_out, omp_in)) initializer( omp_priv={0.0, 0.0} )&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;#pragma offload target(mic) out(x)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; &amp;nbsp; x = (complex_t) {0.0, 0.0};&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;#pragma omp parallel num_threads(48) reduction(cmplxAdd: x)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; x = (complex_t) {1.0, -1.0};&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;&amp;nbsp; printf ("Done: result is &amp;nbsp;%f,%f\n", x.real, x.imag);&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;The code is compiled using&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;icc -O3 -qopenmp -o mytest mytest.c&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;The compiler fails, producing the following error message:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;/tmp/iccI8DGFd.o: In function `main':&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;main.c:(.text+0x199): undefined reference to `__udr_i_0x4633c48'&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;main.c:(.text+0x1d6): undefined reference to `__udr_c_0x4633658'&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;If I understand correctly, the first undefined reference is for the user defined reduction initializer, and the second one for the user defined reduction combiner (the reduction function). However, searching the Internet for related documentation I was not able to find anything about. What should I do to properly compile the code ? Am I missing linking one or more specific libraries ?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px; min-height: 15px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;Thank you in advance for your kind assistance.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="color: rgb(84, 87, 95); line-height: normal; font-family: Arial; margin-bottom: 0px;"&gt;&lt;SPAN style="font-kerning: none;"&gt;Massimo Cafaro&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2016 15:36:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Offloading-to-MIC-an-OpenMP-user-defined-reduction-compilation/m-p/1073760#M59071</guid>
      <dc:creator>Massimo_C_1</dc:creator>
      <dc:date>2016-05-25T15:36:27Z</dc:date>
    </item>
    <item>
      <title>Our apologies for missing</title>
      <link>https://community.intel.com/t5/Software-Archive/Offloading-to-MIC-an-OpenMP-user-defined-reduction-compilation/m-p/1073761#M59072</link>
      <description>&lt;P&gt;Our apologies for missing this earlier post. This turns out to be a compiler defect.&amp;nbsp;Please refer to &lt;A href="https://software.intel.com/en-us/forums/intel-many-integrated-core/topic/637390" target="_blank"&gt;this post &lt;/A&gt;for continued updates&amp;nbsp;about a fix in a future&amp;nbsp;release.&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2016 18:41:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Offloading-to-MIC-an-OpenMP-user-defined-reduction-compilation/m-p/1073761#M59072</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2016-06-06T18:41:47Z</dc:date>
    </item>
  </channel>
</rss>

