dash-project / dash

DASH, the C++ Template Library for Distributed Data Structures with Support for Hierarchical Locality for HPC and Data-Driven Science
http://www.dash-project.org/
Other
154 stars 44 forks source link

NumDimensions, alternative way to the template parameter #681

Open Goon83 opened 4 years ago

Goon83 commented 4 years ago

Hi, Sorry for too many questions here. I am developing a DASH plugin to ArrayUDF and had a question about the NumDimensions. It is a template parameter to the Matrix class (as below). Do we have another way to bypass this it? Say, I declare a Matrix first and then pass the NumDimensions as a parameter. I am asking because using DASH to be as a storage layer needs to be generic pointer to a matrix with any dimension. But, this NumDimensions template parameter introduces lots of duplicated code.

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
class dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >

From: https://codedocs.xyz/dash-project/dash/a01398.html