TASMANIAN icon indicating copy to clipboard operation
TASMANIAN copied to clipboard

Add long int support for data

Open mkstoyanov opened this issue 7 years ago • 5 comments

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.

mkstoyanov avatar Dec 14 '17 15:12 mkstoyanov

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

mkstoyanov avatar Sep 25 '18 21:09 mkstoyanov

  • 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)

mkstoyanov avatar Oct 02 '18 23:10 mkstoyanov

  • The 2D wrappers are used everywhere in the code
  • Internal indexing mostly converted to size_t, very few places left that still use int indexing
  • Note: OpenMP implementations on some platforms require signed indexing, int or long long

mkstoyanov avatar Mar 27 '19 13:03 mkstoyanov

  • 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

mkstoyanov avatar Jan 10 '20 22:01 mkstoyanov

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.

mkstoyanov avatar Mar 07 '20 19:03 mkstoyanov