7#ifndef __PHOENIX_TRANSPOSE_IMPL_H__
8#define __PHOENIX_TRANSPOSE_IMPL_H__
21template<
typename T,
typename U>
23 size_t nbRowOut,
size_t nbColOut,
size_t outputPadding,
bool isTransposed)
27 size_t outputRowSize(nbColOut + outputPadding);
29 for(
size_t i(0lu); i < nbRowOut; ++i){
30 for(
size_t j(0lu); j < nbColOut; ++j){
31 tabOutput[i*outputRowSize + j] = tabInput[i*nbColOut + j];
35 for(
size_t j(0lu); j < nbColOut; ++j){
36 for(
size_t i(0lu); i < nbRowOut; ++i){
37 tabOutput[i*outputRowSize + j] = tabInput[i + j*nbRowOut];
52template<
typename T,
typename U>
54 size_t nbRowOut,
size_t nbColOut,
size_t nbBlockRowOut,
size_t nbBlockColOut,
size_t outputPadding)
61 size_t outputRowSize(nbColOut + outputPadding);
62 for(
size_t i(0lu); i < nbColOut; i += nbBlockColOut){
63 for(
size_t j(0lu); j < nbRowOut; j += nbBlockRowOut){
65 for(
size_t k(i); k < std::min(i + nbBlockColOut, nbColOut); ++k){
66 for(
size_t l(j); l < std::min(j + nbBlockRowOut, nbRowOut); ++l){
68 tabOutput[l*outputRowSize + k] = tabInput[k*nbRowOut + l];
85template<
typename T,
typename U>
87 size_t nbRowOut,
size_t nbColOut,
size_t nbBlockRowOut,
size_t nbBlockColOut,
size_t outputPadding,
bool isTransposed)
92 size_t outputRowSize(nbColOut + outputPadding);
93 for(
size_t i(0lu); i < nbColOut; i += nbBlockColOut){
94 for(
size_t j(0lu); j < nbRowOut; j += nbBlockRowOut){
96 for(
size_t k(i); k < std::min(i + nbBlockColOut, nbColOut); ++k){
97 for(
size_t l(j); l < std::min(j + nbBlockRowOut, nbRowOut); ++l){
98 tabOutput[l*outputRowSize + k] = tabInput[l*nbRowOut + k];
105 nbRowOut, nbColOut, nbBlockRowOut, nbBlockColOut, outputPadding);
const T * phoenix_assume_aligned(const T *tabValue)
Call __builtin_assume_aligned with proper argument by respect to the table type.
void phoenix_transpose_block(T *__restrict__ ptabOutput, const U *__restrict__ ptabInput, size_t nbRowOut, size_t nbColOut, size_t nbBlockRowOut, size_t nbBlockColOut, size_t outputPadding)
Transpose and convert the table of U into a table of T.
void phoenix_transpose_block_copy(T *__restrict__ ptabOutput, const U *__restrict__ ptabInput, size_t nbRowOut, size_t nbColOut, size_t nbBlockRowOut, size_t nbBlockColOut, size_t outputPadding, bool isTransposed)
Convert the table of U into a table of T.
void phoenix_transpose_copy(T *__restrict__ ptabOutput, const U *__restrict__ ptabInput, size_t nbRowOut, size_t nbColOut, size_t outputPadding, bool isTransposed)
Convert the table of U into a table of T.