Xmipp
v3.23.11-Nereus
xmipp
libraries
reconstruction_cuda
cuda_gpu_geo_shift_transformer.h
Go to the documentation of this file.
1
/***************************************************************************
2
*
3
* Authors: David Strelak (davidstrelak@gmail.com)
4
*
5
* Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
6
*
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20
* 02111-1307 USA
21
*
22
* All comments concerning this program package may be sent to the
23
* e-mail address 'xmipp@cnb.csic.es'
24
***************************************************************************/
25
37
#ifndef CUDA_GEO_SHIFT_TRANSFORMER
38
#define CUDA_GEO_SHIFT_TRANSFORMER
39
40
#include <assert.h>
41
#include <exception>
42
#include "
core/multidim_array.h
"
43
#include "
reconstruction/gpu_geo_transformer_defines.h
"
44
#include "
cuda_xmipp_utils.h
"
45
#include "
gpu.h
"
46
50
template
<
typename
T>
51
class
GeoShiftTransformer
{
52
53
public
:
55
GeoShiftTransformer
() :
56
device(-1), imgs(NULL), ffts(NULL), stream(NULL), isReady(false) {
57
};
58
59
~GeoShiftTransformer
() {
60
release
();
61
}
62
74
void
init
(
const
GPU
&gpu,
size_t
x
,
size_t
y
,
size_t
n
,
int
device,
myStreamHandle
*stream);
75
83
void
initLazy
(
const
GPU
&gpu,
size_t
x,
size_t
y,
size_t
n,
int
device,
84
myStreamHandle
*stream = NULL);
85
89
void
release
();
90
98
template
<
typename
T_IN>
99
void
applyShift
(
MultidimArray<T>
&output,
const
MultidimArray<T_IN>
&input,
100
T shiftX, T shiftY);
101
102
void
test
();
103
104
private
:
110
template
<
typename
T_IN>
111
void
checkRestrictions(
MultidimArray<T>
&output,
112
const
MultidimArray<T_IN>
&input);
113
114
private
:
115
bool
isReady;
116
117
int
device;
118
myStreamHandle
* stream;
119
120
const
GPU
*m_gpu;
121
122
GpuMultidimArrayAtGpu<T>
*imgs;
// object for FFT
123
mycufftHandle
fftHandle;
// plan of the FFT
124
GpuMultidimArrayAtGpu<std::complex<T>
> *ffts;
// object for FFT
125
mycufftHandle
ifftHandle;
// plan of the FFT
126
};
128
#endif // CUDA_GEO_SHIFT_TRANSFORMER
GeoShiftTransformer::release
void release()
Definition:
cuda_gpu_geo_shift_transformer.cpp:34
GeoShiftTransformer::applyShift
void applyShift(MultidimArray< T > &output, const MultidimArray< T_IN > &input, T shiftX, T shiftY)
Definition:
cuda_gpu_geo_shift_transformer.cpp:87
MultidimArray
Definition:
common_lines.h:35
y
static double * y
Definition:
numerical_recipes.cpp:8487
gpu_geo_transformer_defines.h
x
doublereal * x
Definition:
numerical_recipes.cpp:2230
GeoShiftTransformer::GeoShiftTransformer
GeoShiftTransformer()
Definition:
cuda_gpu_geo_shift_transformer.h:55
cuda_xmipp_utils.h
gpu.h
GeoShiftTransformer
Definition:
cuda_gpu_geo_shift_transformer.h:51
GeoShiftTransformer::init
void init(const GPU &gpu, size_t x, size_t y, size_t n, int device, myStreamHandle *stream)
Definition:
cuda_gpu_geo_shift_transformer.cpp:53
GpuMultidimArrayAtGpu
Definition:
cuda_xmipp_utils.h:181
GeoShiftTransformer::test
void test()
Definition:
cuda_gpu_geo_shift_transformer.cpp:131
GPU
Definition:
gpu.h:36
myStreamHandle
Definition:
cuda_xmipp_utils.h:57
GeoShiftTransformer::~GeoShiftTransformer
~GeoShiftTransformer()
Definition:
cuda_gpu_geo_shift_transformer.h:59
n
int * n
Definition:
numerical_recipes.cpp:2229
GeoShiftTransformer::initLazy
void initLazy(const GPU &gpu, size_t x, size_t y, size_t n, int device, myStreamHandle *stream=NULL)
Definition:
cuda_gpu_geo_shift_transformer.cpp:78
multidim_array.h
mycufftHandle
Definition:
cuda_xmipp_utils.h:37
Generated by
1.8.13