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

Method selectBufferArguments

src/library/enqueue.cpp:100–530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100clfftStatus FFTAction::selectBufferArguments(FFTPlan * fftPlan,
101 cl_mem* clInputBuffers,
102 cl_mem* clOutputBuffers,
103 std::vector< cl_mem > &inputBuff,
104 std::vector< cl_mem > &outputBuff)
105{
106
107 // 1d with normal length will fall into the below category
108 // add: 2d transpose kernel will fall into here too.
109 inputBuff.reserve( 2 );
110 outputBuff.reserve( 2 );
111
112 // Decode the relevant properties from the plan paramter to figure out how many input/output buffers we have
113 switch( fftPlan->inputLayout )
114 {
115 case CLFFT_COMPLEX_INTERLEAVED:
116 {
117 switch( fftPlan->outputLayout )
118 {
119 case CLFFT_COMPLEX_INTERLEAVED:
120 {
121 if( fftPlan->placeness == CLFFT_INPLACE )
122 {
123 inputBuff.push_back( clInputBuffers[ 0 ] );
124 }
125 else
126 {
127 inputBuff.push_back( clInputBuffers[ 0 ] );
128 outputBuff.push_back( clOutputBuffers[ 0 ] );
129 }
130
131 break;
132 }
133 case CLFFT_COMPLEX_PLANAR:
134 {
135 if( fftPlan->placeness == CLFFT_INPLACE )
136 {
137 // Invalid to be an inplace transform, and go from 1 to 2 buffers
138 return CLFFT_INVALID_ARG_VALUE;
139 }
140 else
141 {
142 inputBuff.push_back( clInputBuffers[ 0 ] );
143
144 outputBuff.push_back( clOutputBuffers[ 0 ] );
145 outputBuff.push_back( clOutputBuffers[ 1 ] );
146 }
147
148 break;
149 }
150 case CLFFT_HERMITIAN_INTERLEAVED:
151 {
152 if( fftPlan->placeness == CLFFT_INPLACE )
153 {
154 return CLFFT_INVALID_ARG_VALUE;
155 }
156 else
157 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected