diff --git a/Grid/tensors/Tensor_class.h b/Grid/tensors/Tensor_class.h index 1b182e32..b48cefcc 100644 --- a/Grid/tensors/Tensor_class.h +++ b/Grid/tensors/Tensor_class.h @@ -64,6 +64,8 @@ public: enum { TensorLevel = GridTypeMapper::TensorLevel + 1 }; + static constexpr accelerator_inline int Nsimd(void) { return sizeof(vector_type)/sizeof(scalar_type); } + // Scalar no action accelerator iScalar() = default; @@ -194,6 +196,8 @@ public: // get double precision version typedef iVector::DoublePrecision, N> DoublePrecision; + + static constexpr accelerator_inline int Nsimd(void) { return sizeof(vector_type)/sizeof(scalar_type); } template ::value, T>::type * = nullptr> accelerator_inline auto operator=(T arg) -> iVector { @@ -304,6 +308,8 @@ public: enum { TensorLevel = GridTypeMapper::TensorLevel + 1 }; + static constexpr accelerator_inline int Nsimd(void) { return sizeof(vector_type)/sizeof(scalar_type); } + accelerator_inline iMatrix(const Zero &z) { zeroit(*this); }; accelerator iMatrix() = default; diff --git a/Grid/tensors/Tensors.h b/Grid/tensors/Tensors.h index c40700c1..43072a24 100644 --- a/Grid/tensors/Tensors.h +++ b/Grid/tensors/Tensors.h @@ -48,4 +48,7 @@ Author: neo #include #include +// Maybe expect different thread on each SIMD lane +#include + #endif