Better support of INPUT AGGREGATES
This MR allows algorithms with AGGREGATE datatypes to use arguments
in the argument list that is passed to the global_function
or the host_function
execution.
- Up until now, if there was an AGGREGATE defined as an input (eg. GatherSelections.cu) it was not possible to use the
global_function
orhost_function
wrapper function passing an object of typeArgumentReferences<Parameters>
. The reason is that when using this wrapper there is an underlying code that automatically transformsArgumentReferences<Parameters>
intoParameters
for convenience. However, that did not support AGGREGATE inputs, and the resulting code would not compile. That is now fixed. - While AGGREGATEs do not prevent using the automatic
ArgumentReferences<Parameters>
toParameters
conversion, it should be noted that AGGREGATEs must not be accessed in kernels (eg. functions marked__global__
), as that would lead to a runtime error. The reason is that AGGREGATEs are hosted bystd::vector
s, and memory on the host stack is not accessible from the device. A similar implicit restriction applies with HOST variables in kernels, or with DEVICE variables in host functions, which are part ofParameters
but should also not be accessed, because that would lead to an access to unaccessible memory.
This MR also fixes other issues that AGGREGATEs had:
- Fix an issue by which if an AGGREGATE was empty the configuration generation did not generate valid configurations.
- Fix an issue by which if an AGGREGATE was empty Allen would not compile as some scheduler code relied on AGGREGATEs having at least one element.
Edited by Daniel Hugo Campora Perez