Skip to content

Better support of INPUT AGGREGATES

Daniel Campora Perez requested to merge dcampora_testing_0 into master

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 or host_function wrapper function passing an object of type ArgumentReferences<Parameters>. The reason is that when using this wrapper there is an underlying code that automatically transforms ArgumentReferences<Parameters> into Parameters 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> to Parameters 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 by std::vectors, 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 of Parameters 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 Campora Perez

Merge request reports