| 32 | }; |
| 33 | |
| 34 | void test_persistent_plan( size_t * length, clfftLayout input_layout, clfftLayout output_layout, clfftResultLocation result_location ) |
| 35 | { |
| 36 | try |
| 37 | { |
| 38 | clfftDim cl_dimension; |
| 39 | if( length[dimy] == 1 && length[dimz] == 1 ) |
| 40 | cl_dimension = CLFFT_1D; |
| 41 | else if( length[dimz] == 1 ) |
| 42 | cl_dimension = CLFFT_2D; |
| 43 | else |
| 44 | cl_dimension = CLFFT_3D; |
| 45 | |
| 46 | fftw_dim fftw_dimension = static_cast<fftw_dim>(cl_dimension); |
| 47 | |
| 48 | { |
| 49 | clfft_single write_fft( cl_dimension, length, NULL, 1, 0); |
| 50 | write_fft.input.set_all_data_points_on_all_passes_to_value(1.0f,0.0f); |
| 51 | write_fft.set_forward_transform(); |
| 52 | |
| 53 | if( result_location == CLFFT_INPLACE ) |
| 54 | write_fft.set_in_place(); |
| 55 | else |
| 56 | write_fft.set_out_of_place(); |
| 57 | |
| 58 | write_fft.input_layout(input_layout); |
| 59 | write_fft.output_layout(output_layout); |
| 60 | write_fft.write_plan_to_file("wakkawakka.fft"); |
| 61 | } |
| 62 | |
| 63 | clfft_single read_fft( cl_dimension, length, NULL, 1, 0); |
| 64 | read_fft.input.set_all_data_points_on_all_passes_to_value(1.0f,0.0f); |
| 65 | read_fft.set_forward_transform(); |
| 66 | read_fft.read_plan_from_file("wakkawakka.fft"); |
| 67 | read_fft.transform(); |
| 68 | |
| 69 | fftw_single reference( fftw_dimension, length); |
| 70 | reference.set_forward_transform(); |
| 71 | reference.data.set_all_data_points_on_all_passes_to_value(1.0f,0.0f); |
| 72 | reference.transform(); |
| 73 | |
| 74 | if( read_fft.placeness() == CLFFT_INPLACE ) |
| 75 | EXPECT_EQ( true, read_fft.input.is_equal_to( reference.data)); |
| 76 | else |
| 77 | EXPECT_EQ( true, read_fft.output.is_equal_to( reference.data)); |
| 78 | } |
| 79 | catch( const std::exception& err ) |
| 80 | { |
| 81 | handle_exception(err); |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | TEST_F(clfft_PersistentPlans, DISABLED_normal_1d_inplace_interleaved) |
| 86 | { |
no test coverage detected