Skip to content

Matrix tensor size type#1212

Merged
bendudson merged 2 commits intonextfrom
matrix_tensor_size_type
Aug 20, 2018
Merged

Matrix tensor size type#1212
bendudson merged 2 commits intonextfrom
matrix_tensor_size_type

Conversation

@d7919
Copy link
Member

@d7919 d7919 commented Aug 19, 2018

Use size_type to define the type of size related variables in Matrix and Tensor

Currently set this to int whilst previous behaviour would be
equivalent to unsigned int. The motivation for changing to int is
that this allows operator() uses to vectorise when in loops with an
int index.

Changing loop indices to unsigned int (or std::size_t) doesn't
actually allow vectorisation even when Matrix::size_type = std::size_t
as Array currently also uses int as the indexing type. This seems to
be enough to prevent vectorisation in simple loops over Matrix elements.

d7919 added 2 commits August 17, 2018 16:36
and Tensor

Currently set this to `int` whilst previous behaviour would be
equivalent to `unsigned int`. The motivation for changing to `int` is
that this allows `operator()` uses to vectorise when in loops with an
`int` index.

Changing loop indices to `unsigned int` (or `std::size_t`) doesn't
actually allow vectorisation even when `Matrix::size_type = std::size_t`
as `Array` currently also uses `int` as the indexing type. This seems to
be enough to prevent vectorisation in simple loops over `Matrix` elements.
@bendudson bendudson merged commit be38ce9 into next Aug 20, 2018
@bendudson bendudson deleted the matrix_tensor_size_type branch August 20, 2018 10:27
@ZedThree
Copy link
Member

Long-term, this should use Array<T>::size_type, once that is defined and used consistently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants