43template <
typename FloatType>
45 int const *start,
int const *size,
int const *dim,
48 auto const copy_size =
49 static_cast<std::size_t
>(element * size[2]) *
sizeof(FloatType);
51 auto const m_in_offset = element * dim[2];
52 auto const s_in_offset = element * (dim[2] * (dim[1] - size[1]));
54 auto const m_out_offset = element * size[2];
56 int li_in = element * (start[2] + dim[2] * (start[1] + dim[1] * start[0]));
59 for (
int s = 0; s < size[0]; s++) {
60 for (
int m = 0; m < size[1]; m++) {
61 memmove(&(out[li_out]), &(in[li_in]), copy_size);
63 li_out += m_out_offset;
82template <
typename FloatType>
84 int const *start,
int const *size,
int const *dim,
87 auto const copy_size =
88 static_cast<std::size_t
>(element * size[2]) *
sizeof(FloatType);
90 auto const m_out_offset = element * dim[2];
91 auto const s_out_offset = element * (dim[2] * (dim[1] - size[1]));
93 auto const m_in_offset = element * size[2];
96 int li_out = element * (start[2] + dim[2] * (start[1] + dim[1] * start[0]));
98 for (
int s = 0; s < size[0]; s++) {
99 for (
int m = 0; m < size[1]; m++) {
100 memmove(&(out[li_out]), &(in[li_in]), copy_size);
101 li_in += m_in_offset;
102 li_out += m_out_offset;
104 li_out += s_out_offset;
void fft_pack_block(FloatType const *const in, FloatType *const out, int const *start, int const *size, int const *dim, int element)
Pack a 3D-block of size size starting at start of an input 3D-grid in with dimension dim into an outp...
void fft_unpack_block(FloatType const *const in, FloatType *const out, int const *start, int const *size, int const *dim, int element)
Unpack a 3D-block in of size size into an output 3D-grid out of size dim starting at position start.