#include <cuda_rot_polar_estimator.h>
|
| CudaRotPolarEstimator () |
|
virtual | ~CudaRotPolarEstimator () |
|
| CudaRotPolarEstimator (CudaRotPolarEstimator &o)=delete |
|
CudaRotPolarEstimator & | operator= (const CudaRotPolarEstimator &other)=delete |
|
| CudaRotPolarEstimator (CudaRotPolarEstimator &&o) |
|
CudaRotPolarEstimator const & | operator= (CudaRotPolarEstimator &&o)=delete |
|
template<bool FULL_CIRCLE> |
void | sComputePolarTransform (const GPU &gpu, const Dimensions &dimIn, T *__restrict__ d_in, const Dimensions &dimOut, T *__restrict__ d_out, int posOfFirstRing) |
|
template<bool FULL_CIRCLE> |
void | sNormalize (const GPU &gpu, const Dimensions &dim, T *__restrict__ d_in, T *__restrict__ d_sums, T *__restrict__ d_sumsSqr, int posOfFirstRing) |
|
| ARotationEstimator () |
|
void | init (const RotationEstimationSetting settings, bool reuse) |
|
void | loadReference (const T *ref) |
|
void | compute (T *others) |
|
const std::vector< float > & | getRotations2D () const |
|
virtual | ~ARotationEstimator () |
|
HW & | getHW () const |
|
const RotationEstimationSetting & | getSettings () const |
|
|
static void | sComputeCorrelationsOneToN (const GPU &gpu, const std::complex< T > *d_in, std::complex< T > *d_out, const std::complex< T > *d_ref, const Dimensions &dims, int firstRingRadius) |
|
template<bool FULL_CIRCLE> |
static void | sComputePolarTransform (const GPU &gpu, const Dimensions &dimIn, T *d_in, const Dimensions &dimOut, T *d_out, int posOfFirstRing) |
|
template<bool FULL_CIRCLE> |
static void | sNormalize (const GPU &gpu, const Dimensions &dimIn, T *d_in, T *d_1, T *d_2, int posOfFirstRing) |
|
template<typename T>
class Alignment::CudaRotPolarEstimator< T >
Definition at line 44 of file cuda_rot_polar_estimator.h.
◆ CudaRotPolarEstimator() [1/3]
◆ ~CudaRotPolarEstimator()
◆ CudaRotPolarEstimator() [2/3]
◆ CudaRotPolarEstimator() [3/3]
Definition at line 56 of file cuda_rot_polar_estimator.h.
57 m_mainStream = o.m_mainStream;
58 m_backgroundStream = o.m_backgroundStream;
59 m_samples = o.m_samples;
63 m_d_batch = o.m_d_batch;
64 m_d_batchPolarOrCorr = o.m_d_batchPolarOrCorr;
65 m_d_batchPolarFD = o.m_d_batchPolarFD;
66 m_d_sumsOrMaxPos = o.m_d_sumsOrMaxPos;
67 m_d_sumsSqr = o.m_d_sumsSqr;
68 m_d_batchCorrSumFD = o.m_d_batchCorrSumFD;
71 m_singleToFD = o.m_singleToFD;
72 m_batchToFD = o.m_batchToFD;
73 m_batchToSD = o.m_batchToSD;
78 m_isDataReady = o.m_isDataReady;
81 m_h_batchMaxPositions = o.m_h_batchMaxPositions;
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ sComputeCorrelationsOneToN()
template<typename T >
void Alignment::CudaRotPolarEstimator< T >::sComputeCorrelationsOneToN |
( |
const GPU & |
gpu, |
|
|
const std::complex< T > * |
d_in, |
|
|
std::complex< T > * |
d_out, |
|
|
const std::complex< T > * |
d_ref, |
|
|
const Dimensions & |
dims, |
|
|
int |
firstRingRadius |
|
) |
| |
|
static |
Definition at line 216 of file cuda_rot_polar_estimator.cpp.
223 auto stream = *(cudaStream_t*)gpu.
stream();
226 ceil((dims.
x() * dims.
n()) / (
float)dimBlock.x));
227 if (std::is_same<T, float>::value) {
228 computePolarCorrelationsSumOneToNKernel<float2>
229 <<<dimGrid, dimBlock, 0, stream>>> (
230 (float2*)d_in, (float2*)d_out,
233 dims.
x(), dims.
y(), dims.
n());
234 }
else if (std::is_same<T, double>::value) {
235 computePolarCorrelationsSumOneToNKernel<double2>
236 <<<dimGrid, dimBlock, 0, stream>>> (
237 (double2*)d_in, (double2*)d_out,
240 dims.
x(), dims.
y(), dims.
n());
#define REPORT_ERROR(nerr, ErrormMsg)
CUDA_HD constexpr size_t x() const
CUDA_HD constexpr size_t y() const
CUDA_HD constexpr size_t n() const
◆ sComputePolarTransform() [1/2]
template<typename T>
template<bool FULL_CIRCLE>
◆ sComputePolarTransform() [2/2]
template<typename T>
template<bool FULL_CIRCLE>
Definition at line 281 of file cuda_rot_polar_estimator.cpp.
288 assert (dimIn.
x() == dimIn.
y());
289 assert ((dimOut.
y() + 1) * 2 <= dimIn.
x());
292 ceil((dimOut.
x() * dimOut.
n()) / (
float)dimBlock.x));
294 auto stream = *(cudaStream_t*)gpu.
stream();
296 polarFromCartesian<T, FULL_CIRCLE>
297 <<<dimGrid, dimBlock, 0, stream>>> (
298 d_in, dimIn.
x(), dimIn.
y(),
299 d_out, dimOut.
x(), dimOut.
y(), dimOut.
n(), posOfFirstRing);
CUDA_HD constexpr size_t x() const
CUDA_HD constexpr size_t y() const
CUDA_HD constexpr size_t n() const
◆ sNormalize() [1/2]
template<typename T>
template<bool FULL_CIRCLE>
◆ sNormalize() [2/2]
template<typename T>
template<bool FULL_CIRCLE>
Definition at line 304 of file cuda_rot_polar_estimator.cpp.
313 ceil((dim.
x() * dim.
n()) / (
float)dimBlock.x));
315 auto stream = *(cudaStream_t*)gpu.
stream();
317 size_t bytes = dim.
n() *
sizeof(T);
319 gpuErrchk(cudaMemset(d_sumsSqr, 0, bytes));
320 computeSumSumSqr<T, FULL_CIRCLE>
321 <<<dimGrid, dimBlock, 0, stream>>> (
322 d_in, dim.
x(), dim.
y(), dim.
n(),
323 d_sums, d_sumsSqr, posOfFirstRing);
325 const T piConst = FULL_CIRCLE ? (2 * M_PI) : M_PI;
330 const T radiiSum = (dim.
y() * (2 * posOfFirstRing + dim.
y() - 1)) / (T)2;
331 T
norm = piConst * radiiSum;
334 <<<dimGrid, dimBlock, 0, stream>>> (
335 d_in, dim.
x(), dim.
y(), dim.
n(),
T norm(const std::vector< T > &v)
CUDA_HD constexpr size_t x() const
CUDA_HD constexpr size_t y() const
CUDA_HD constexpr size_t n() const
The documentation for this class was generated from the following files: