TASMANIAN
TASMANIAN copied to clipboard
Add long int support for data
No need to overhaul the index set class, only the values storage class and the associated load/unload commands. Check to see how this would affect the ML capabilities.
Updated design decision:
- keep the number of multi-indexes, number of outputs, and number of points to evaluate, all as
int
type - make sure that there is no chance of overflow when multiplying large integers, mostly by type-casting the indexes to
size_t
- added Data2D template, which wraps around a vector or array and splits contiguous memory into strips
- Data2D can be called with only integers inputs and still prevent overflow by ensuring proper type-casting
- Data2D is used in many places, but not everywhere yet (some places may need other solutions too)
- The 2D wrappers are used everywhere in the code
- Internal indexing mostly converted to
size_t
, very few places left that still useint
indexing - Note: OpenMP implementations on some platforms require signed indexing,
int
orlong long
-
when the file format is updated, all sizes and indexes would be updated to size_t or long long
-
the internal integers can also be updated
-
the cuda kernels remain working with 32-bit int due to the cuBlas interface
Decision: switch internal indexing to long long
Unsigned nature of size_t
limits some algorithms, such as searching and special traversals of tensor points. The signed integers also don't suffer from OpenMP limitations on some platforms.
The unsigned indexing also causes issues, since without warnings enabled, using negative numbers in size_t
does not result in compile time error but in using maximum number. Hence, signed integers do not provide reasonable safety. Signed indexing is good.