<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=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<base href="x-msg://3051/"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@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:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
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;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
span.EmailStyle21
{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.25in 1.0in 1.25in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="2050" />
</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="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Tanya,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I’ve fixed the width/alignment and the debug info remarks, and also removed the sampler initialization function for now.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">The main idea in passing through the OpenCLRuntime for initializing samplers is enabling the initialization of non-integer vendor specific samplers later on.
It’s not required for the current implementation, but it will be needed later on to support other representations of the sampler type, like in SPIR.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I prefer to leave sampler_t implemented with an i32 representation rather than removing it – the built-in types are needed for clean restriction checking.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> Guy<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><img width="420" height="116" id="Picture_x0020_1" src="cid:image001.png@01CDAFA4.77FD2AB0" alt="email_signature_guy_new2"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Tanya Lattner [mailto:lattner@apple.com]
<br>
<b>Sent:</b> Saturday, October 20, 2012 07:45<br>
<b>To:</b> Benyei, Guy<br>
<b>Cc:</b> Richard Smith; cfe-dev@cs.uiuc.edu; Villmow, Micah; Anton.Lokhmotov@arm.com<br>
<b>Subject:</b> Re: [cfe-dev] OpenCL & SPIR specific types - proposal and patch<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Guy,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">+ case BuiltinType::OCLSampler:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ case BuiltinType::OCLEvent:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ case BuiltinType::OCLImage1d:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ case BuiltinType::OCLImage1dArray:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ case BuiltinType::OCLImage1dBuffer:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ case BuiltinType::OCLImage2d:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ case BuiltinType::OCLImage2dArray:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ case BuiltinType::OCLImage3d:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ // Currently these types are pointers to opaque types.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ Width = Target->getPointerWidth(0);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ Align = Target->getPointerAlign(0);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ break;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> }<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Is wrong if sampler is i32 I think.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Also, probably wrong:<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">+ case BuiltinType::OCLSampler:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ return getOrCreateStructPtrType("opencl_sampler_t", OCLSamplerDITy);<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Why do this?<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">+ } else if (type->isSamplerT()) {<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ CGM.getOpenCLRuntime().initializeOpenCLSampler(this, lvalue.getAddress(), EmitScalarExpr(init));<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> } <o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I also don't understand why you need to go through the OpenCLRuntime for this.<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">+ if (D->getType()->isSamplerT()) {<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ getOpenCLRuntime().initializeOpenCLSampler(NULL, GV, Init);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ } else {<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ GV->setInitializer(Init);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ }<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I would rather just see sampler ripped out for now. I have no issues with the images/event code.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">-Tanya<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p><span style="color:#1F497D">…</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>