lanl / spiner

Performance portable routines for generic, tabulated, multi-dimensional data
https://lanl.github.io/spiner
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

Template on underlying data type #62

Closed Yurlungur closed 1 year ago

Yurlungur commented 1 year ago

PR Summary

The use case of mixed-precision computing has been suggested. This PR attempts to support that need by templating Spiner functionality on underlying data type. This means the following are all valid:

Spiner::DataBox<float> db(3, 2, 1);
Spiner::DataBox<double> db(5, 4, 3);
Spiner::DataBox<long double> db(55);

Any arithmetic type is supported, although I've only tested carefully with floating-point types. Also HDF5 is only supported for float and double at this time.

I've pinged a few people using spiner downstream. @jdolence @chadmeyer @dholladay00 @jhp-lanl and @brryan do you see this breaking anything you're doing with spiner? Is there any design consideration I'm missing here?

PR Checklist

Yurlungur commented 1 year ago

@dholladay00 @mauneyc-LANL this is ready for re-review. Thanks again for taking a look.

Yurlungur commented 1 year ago

Test triggered and passing on Darwin.