device_allocator::allocate align parameter should be an argument

Issue #145 resolved
Max Grossman created an issue

In the current spec, the byte alignment of an allocation from a device allocator is specified as a template parameter to the allocate() function. This prevents the use of runtime values for the alignment.

As far as I can tell, there isn’t any reason for this restriction either, as the alignment is then immediately passed as an argument to the segment’s allocate function.

Comments (5)

  1. Dan Bonachea

    @Amir Kamil do you recall why we went with a defaulted template parameter here instead of a defaulted function argument? I think the latter provides all the same benefits as the former, but additionally allows runtime values.

    As Max says, the implementation side for a defaulted function argument looks trivial.

  2. Log in to comment