<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:宋体;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
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]-->
</head>
<body lang="ZH-CN" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">I just send a patch “Remove newValueProxy from scalarize pass to genWriter pass.” to fix this bug, can you apply and try it? Thanks.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> beignet-bounces+rong.r.yang=intel.com@lists.freedesktop.org
[mailto:beignet-bounces+rong.r.yang=intel.com@lists.freedesktop.org] <b>On Behalf Of
</b>Matt Harvey<br>
<b>Sent:</b> Sunday, October 13, 2013 6:48 AM<br>
<b>To:</b> beignet@lists.freedesktop.org<br>
<b>Subject:</b> [Beignet] assertion failed in llvm_gen_backend.cpp<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">Hi list,<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">When I run the kernel copied below, I find that it compiles just fine, but upon running emits the following error:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">ASSERTION FAILED: scalarMap.find(key) != scalarMap.end()<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> at file /media/Programming/src/beignet/backend/src/llvm/llvm_gen_backend.cpp, function gbe::ir::Register gbe::RegisterTranslator::getScalar(llvm::Value*, uint32_t), line 373<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Stack dump:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">0. Running pass 'Function Pass Manager' on module '/tmp/fileLxplMp.ll'.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">1. Running pass 'Gen Back-End' on function '@edge_detect'<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">This looks like a bug to me.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Thanks,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Matt<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Here is the kernel that caused this error:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">__constant sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">float calculate_intensity(float4 rgba)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">{<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> //equation taken from <a href="http://en.wikipedia.org/wiki/YUV#Converting_between_Y.27UV_and_RGB">
http://en.wikipedia.org/wiki/YUV#Converting_between_Y.27UV_and_RGB</a><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> return (0.299f * rgba[0]) +<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> (0.587f * rgba[1]) +<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> (0.114f * rgba[2]);<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">}<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">__kernel void edge_detect(__read_only image2d_t image_in,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> __write_only image2d_t image_out,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> __read_only ulong image_width,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> __read_only ulong image_height)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">{<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> const int2 pos = { get_global_id(0), get_global_id(1) };<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> float4 output = (float4)(0.0f, 0.0f, 0.0f, 1.0f); //black<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> if ((pos[0] != 0) && (pos[1] != 0) && (pos[0] != image_width) && (pos[1] != image_height))<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> {<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> float A = calculate_intensity(read_imagef(image_in, sampler, (int2)(pos[0] - 1, pos[1] - 1)));<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> float F = calculate_intensity(read_imagef(image_in, sampler, (int2)(pos[0], pos[1] + 1)));<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> float G = calculate_intensity(read_imagef(image_in, sampler, (int2)(pos[0] - 1, pos[1] + 1)));<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> float H = calculate_intensity(read_imagef(image_in, sampler, (int2)(pos[0] - 1, pos[1])));<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> float addFG = F + G;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> float addAH = A + H;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> float subtraction = addFG - addAH;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> if (subtraction > 383.0f)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> {<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> output = (float4)(1.0f, 1.0f, 1.0f, 1.0f);<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> }<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> }<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> write_imagef(image_out, pos, output);<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">}<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</div>
</div>
</body>
</html>