TA provides the very useful TA::make_array which allows you to make a DistArray from a lambda. This issue is for adding a ctor to TensorWrapper which allows the user to write a lambda which fills in the tensor. I'm not 100% sure on what signature we want the lambda to have. A couple possibilities:
double(std::vector<int>); // Given an index return the value
void(std::vector<int> lo, std::vector<int> hi, double*); // Given the range of the block and the block's start fill it in
The first is more generalizable (to non-contiguous memory buffers, row- vs. column-major, etc.) and with modern compiler optimizations it may actually perform quite well.
TA provides the very useful
TA::make_arraywhich allows you to make aDistArrayfrom a lambda. This issue is for adding a ctor toTensorWrapperwhich allows the user to write a lambda which fills in the tensor. I'm not 100% sure on what signature we want the lambda to have. A couple possibilities:The first is more generalizable (to non-contiguous memory buffers, row- vs. column-major, etc.) and with modern compiler optimizations it may actually perform quite well.