MCPcopy Create free account
hub / github.com/clMathLibraries/clFFT / buffer

Class buffer

src/tests/buffer.h:74–1275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
73template <class T>
74class buffer {
75private:
76 // we need to save the requested length x, because
77 // if we change the buffer from complex to real,
78 // (as in a round-trip test) we need to be able to
79 // get back to the original length of x. in the case
80 // of an odd transform length, that's not possible
81 // due to round-off error unless we explicitly save it
82 size_t _requested_length_x;
83 size_t _number_of_dimensions;
84 size_t _batch_size;
85 size_t _distance;
86 layout::buffer_layout_t _layout;
87 clfftResultLocation _placeness;
88
89 std::vector< size_t > _lengths;
90 std::vector< size_t > _strides;
91 bool _tightly_packed_strides;
92 bool _tightly_packed_distance;
93
94 static const size_t tightly_packed = 0;
95
96 // if real or planar:
97 // _the_buffers[re] will hold the real portion
98 // _the_buffers[im] will hold the imaginary portion (planar only)
99 // if interleaved:
100 // _the_buffers[interleaved] will hold the whole banana
101 std::vector< buffer_memory< T > > _the_buffers;
102
103 enum
104 {
105 interleaved = 0,
106 re = 0, // real
107 im = 1 // imaginary
108 };
109
110public:
111 /*****************************************************/
112 buffer( const size_t dimensions_in,
113 const size_t* lengths_in,
114 const size_t* strides_in,
115 const size_t batch_size_in,
116 const size_t distance_in,
117 const layout::buffer_layout_t layout_in,
118 const clfftResultLocation placeness_in
119 )
120 : _number_of_dimensions( dimensions_in )
121 , _batch_size( batch_size_in )
122 , _distance( distance_in )
123 , _layout( layout_in )
124 , _placeness( placeness_in )
125 , _lengths()
126 , _strides()
127 , _the_buffers()
128 {
129 initialize_lengths(lengths_in);
130 initialize_strides(strides_in);
131 initialize_distance(distance_in);

Callers

nothing calls this directly

Calls 6

is_realMethod · 0.95
is_hermitianMethod · 0.95
is_complexMethod · 0.95
set_one_data_pointMethod · 0.95
realMethod · 0.80
imagMethod · 0.80

Tested by

no test coverage detected