<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 4/25/2018 3:48 PM, Lin, Jin wrote:<br>
</div>
<blockquote type="cite"
cite="mid:262352419881AB4EA6E7EB413CFCA81CC4DB8073@ORSMSX108.amr.corp.intel.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:"\@SimSun";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin-top:0in;
margin-right:0in;
margin-bottom:8.0pt;
margin-left:0in;
line-height:105%;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
color:black;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#0070C0">Given a global
variable @gg, the compiler has to generate code on the host
to specify whether it is passed by value or passed by
reference. In the following example, if the compiler
generates the code for passing by value, the outlined
function on the target </span><span
style="font-family:""",serif;color:#0070C0;border:none
windowtext 1.0pt;padding:0in">i386-pc-linux-gnu</span><span
style="color:#0070C0"> cannot get the correct value since it
assumes the variable @gg is passed by reference. </span><span
style="color:#0070C0"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#0070C0"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#0070C0">Here is the
corresponding IR on the host side.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:red"> %0 = load double,
double* @gg, align 8, !tbaa !3<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:red"> %1 = bitcast
double %0 to i64<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> …<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#0070C0"> %12 =
getelementptr inbounds [4 x i8*], [4 x i8*]*
%.offload_baseptrs, i32 0, i32 2<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#0070C0"> %13 = bitcast
i8** %12 to i64*<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:red"> store i64 %1,
i64* %13, align 8</span></p>
</div>
</blockquote>
<br>
Could you describe the overall process of calling an offloaded
function in a bit more detail? How do you describe the ABI of the
called function to the OpenMP runtime?<br>
<br>
I suspect you shouldn't be trying to store things which aren't
pointers into offload_baseptrs.<br>
<br>
-Eli<br>
<br>
<pre class="moz-signature" cols="72">--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre>
</body>
</html>