<html 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 15 (filtered medium)">
<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="en-IT" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">> On Mon, 3 Jan 2022 18:15:11 +0000<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> Elena Agostini <eagostini@nvidia.com> wrote:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > > Alignment only makes sense if power of two. The code should check that and optimize<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > > for that.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > ><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> ><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > The alignment value is checked in the gpudev library before<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > passing it to the driver.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> ><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > Adding this kind of checks in the driver has been rejected in the past because it was<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > considered dead code (the library was already checking input parameters).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> ><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> > Let me know what are the preferred options.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">> Driver could use the mask instead of slow divide operation.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I'd not be concerned about performance here.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Memory allocation is expensive, typically you want to do it<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">at initialization time.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">What do you suggest for my other comments?<o:p></o:p></span></p>
</div>
</div>
</body>
</html>