> On Mon, 3 Jan 2022 18:15:11 +0000 > Elena Agostini wrote: > > > > Alignment only makes sense if power of two. The code should check that and optimize > > > for that. > > > > > > > The alignment value is checked in the gpudev library before > > passing it to the driver. > > > > Adding this kind of checks in the driver has been rejected in the past because it was > > considered dead code (the library was already checking input parameters). > > > > Let me know what are the preferred options. > > Driver could use the mask instead of slow divide operation. I'd not be concerned about performance here. Memory allocation is expensive, typically you want to do it at initialization time. What do you suggest for my other comments?