UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cfft2d_calc_block.hpp
1 /* fft_calc_block.hpp */
2 /* $Id$ */
3 #ifndef __cfft2d_calc_block_hpp
4 #define __cfft2d_calc_block_hpp
5 
6 //#ifdef U_CUDA_ENABLED
7 
8 #ifdef GE_BUILD
9 #include <calc_block.hpp>
10 #else
11 #include <dcf/calc_block.hpp>
12 #endif
13 
14 namespace dcf
15 {
17  class CFFT2DCalcBlock : public CalcBlock
18  {
19  public:
20 
25  CFFT2DCalcBlock(const dcf::Manager &manager, int direction = 1, bool normalize = true);
26 
28  virtual ~CFFT2DCalcBlock();
29 
31  virtual void start();
32 
35  void setData(size_t dim_x, size_t dim_y, float *re_data, float *im_data);
36 
38  void setDirection(int dir) {m_data.dir = dir;}
39 
41  int getDirection() const {return m_data.dir;}
42 
44  bool isNormalize() const {return m_data.normalize;}
45 
47  void setNormalize(bool normalize) {m_data.normalize = normalize;}
48 
50  void calcModule(size_t dim_x, size_t dim_y, float *re, float *im, float *mod);
51 
52  protected:
53 
55  struct
56  {
57  size_t dim_x, dim_y;
58  bool new_plan;
59  float *re;
60  float *im;
61  int dir;
62  bool normalize;
63  } m_data;
64 
66  virtual void run();
67 
69  bool cuda_fft();
70 
73 
76 
78  void cuda_set_data(size_t dim_x, size_t dim_y, float *re_data, float *im_data);
79 
80  private:
81 
82  };
83 };
84 
85 //#endif /* U_CUDA_ENABLED */
86 
87 #endif /* cfft2d_calc_block.hpp */
void setData(size_t dim_x, size_t dim_y, float *re_data, float *im_data)
error_t
Definition: types.hpp:11
Definition: manager.hpp:19
int dir
Definition: cfft2d_calc_block.hpp:61
const dcf::Manager * manager() const
Definition: calc_block.hpp:43
bool normalize
Definition: cfft2d_calc_block.hpp:62
float * re
Definition: cfft2d_calc_block.hpp:59
void setNormalize(bool normalize)
Definition: cfft2d_calc_block.hpp:47
int getDirection() const
Definition: cfft2d_calc_block.hpp:41
float * im
Definition: cfft2d_calc_block.hpp:60
struct dcf::CFFT2DCalcBlock::@4 m_data
dcf::error_t free_device()
Definition: calc_block.hpp:17
void calcModule(size_t dim_x, size_t dim_y, float *re, float *im, float *mod)
bool isNormalize() const
Definition: cfft2d_calc_block.hpp:44
virtual void start()
CFFT2DCalcBlock(const dcf::Manager &manager, int direction=1, bool normalize=true)
dcf::error_t select_device()
Definition: cfft2d_calc_block.hpp:17
void cuda_set_data(size_t dim_x, size_t dim_y, float *re_data, float *im_data)
void setDirection(int dir)
Definition: cfft2d_calc_block.hpp:38
bool new_plan
Definition: cfft2d_calc_block.hpp:58
virtual ~CFFT2DCalcBlock()
virtual void run()
size_t dim_y
Definition: cfft2d_calc_block.hpp:57