[clfft] 06/32: add some gtest cases. note that for 1d fft if one of the dimension after breaking done is bigger than 2048(double) or 4096(single) this cannot be done inplace since we dont support 3d inplace transpose. Thus 729x729x3 can be done for single but not double
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Tue Apr 26 08:34:07 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch master
in repository clfft.
commit 92ca0cb91a3ec7c93fbdccde50951aaf512a942f
Author: unknown <timmy.liu at amd.com>
Date: Fri Mar 11 11:12:16 2016 -0600
add some gtest cases. note that for 1d fft if one of the dimension after breaking done is bigger than 2048(double) or 4096(single) this cannot be done inplace since we dont support 3d inplace transpose. Thus 729x729x3 can be done for single but not double
---
src/library/action.transpose.cpp | 8 +--
src/tests/accuracy_test_pow3.cpp | 112 ++++++++++++++++++++++++++++-----------
src/tests/test_constants.h | 1 -
3 files changed, 87 insertions(+), 34 deletions(-)
diff --git a/src/library/action.transpose.cpp b/src/library/action.transpose.cpp
index f912584..7ec6947 100644
--- a/src/library/action.transpose.cpp
+++ b/src/library/action.transpose.cpp
@@ -335,6 +335,7 @@ clfftStatus FFTGeneratedTransposeNonSquareAction::getWorkSizes(std::vector< size
if (this->signature.nonSquareKernelType == NON_SQUARE_TRANS_TRANSPOSE_BATCHED_LEADING
|| this->signature.nonSquareKernelType == NON_SQUARE_TRANS_TRANSPOSE_BATCHED)
{
+ std::cout << "TIMMY"<< std::endl;
if (smaller_dim % (16 * reShapeFactor) == 0)
wg_slice = smaller_dim / 16 / reShapeFactor;
else
@@ -350,7 +351,7 @@ clfftStatus FFTGeneratedTransposeNonSquareAction::getWorkSizes(std::vector< size
/*Push the data required for the transpose kernels*/
globalWS.clear();
if(this->signature.nonSquareKernelType == NON_SQUARE_TRANS_TRANSPOSE_BATCHED_LEADING)
- globalWS.push_back(global_item_size * 2);
+ globalWS.push_back(global_item_size * dim_ratio);
else if (this->signature.nonSquareKernelType == NON_SQUARE_TRANS_TRANSPOSE_BATCHED)
globalWS.push_back(global_item_size);
@@ -441,10 +442,11 @@ clfftStatus FFTGeneratedTransposeNonSquareAction::getWorkSizes(std::vector< size
{
//1:3 ratio
size_t local_work_size_swap = 256;
- std::vector<std::vector<size_t>> permutationTable;
+ std::vector<std::vector<size_t> > permutationTable;
clfft_transpose_generator::permutation_calculation(dim_ratio, smaller_dim, permutationTable);
size_t global_item_size = permutationTable.size() * local_work_size_swap * this->plan->batchsize;
-
+ for (int i = 2; i < this->plan->length.size(); i++)
+ global_item_size *= this->plan->length[i];
globalWS.push_back(global_item_size);
localWS.push_back(local_work_size_swap);
}
diff --git a/src/tests/accuracy_test_pow3.cpp b/src/tests/accuracy_test_pow3.cpp
index 9ebbe4e..ab88cd5 100644
--- a/src/tests/accuracy_test_pow3.cpp
+++ b/src/tests/accuracy_test_pow3.cpp
@@ -1816,61 +1816,113 @@ TEST_F(accuracy_test_pow3_double, large_1D_out_of_place_hermitian_planar_to_real
// *****************************************************
template< class T, class cl_T, class fftw_T>
-void huge_1D_forward_in_place_complex_planar_to_complex_planar()
+void huge_1D_forward_in_place_complex_planar_to_complex_planar(size_t lenSize, size_t batchSize, layout::buffer_layout_t layoutType, direction::direction_t direction_type)
{
std::vector<size_t> lengths;
- lengths.push_back( huge3 );
- size_t batch = 1;
+ lengths.push_back(lenSize);
+ size_t batch = batchSize;
std::vector<size_t> input_strides;
std::vector<size_t> output_strides;
size_t input_distance = 0;
size_t output_distance = 0;
- layout::buffer_layout_t in_layout = layout::complex_planar;
- layout::buffer_layout_t out_layout = layout::complex_planar;
+ layout::buffer_layout_t in_layout = layoutType;
+ layout::buffer_layout_t out_layout = layoutType;
placeness::placeness_t placeness = placeness::in_place;
- direction::direction_t direction = direction::forward;
+ direction::direction_t direction = direction_type;
data_pattern pattern = sawtooth;
complex_to_complex<T, cl_T, fftw_T>(pattern, direction, lengths, batch, input_strides, output_strides, input_distance, output_distance, in_layout, out_layout, placeness);
}
-
-TEST_F(accuracy_test_pow3_single, huge_1D_forward_in_place_complex_planar_to_complex_planar)
+//177147 = 243 * 243 * 3, backward and forward, planar and interleaved, single and double, batch size 1 and 3
+TEST_F(accuracy_test_pow3_single, huge_1D_forward_in_place_complex_planar_to_complex_planar_177147_1)
{
- try { huge_1D_forward_in_place_complex_planar_to_complex_planar< float, cl_float, fftwf_complex >(); }
+ try { huge_1D_forward_in_place_complex_planar_to_complex_planar< float, cl_float, fftwf_complex >(177147, 1, layout::complex_planar, direction::forward); }
catch (const std::exception& err) { handle_exception(err); }
}
+TEST_F(accuracy_test_pow3_single, huge_1D_backward_in_place_complex_planar_to_complex_planar_177147_1)
+{
+ try { huge_1D_forward_in_place_complex_planar_to_complex_planar< float, cl_float, fftwf_complex >(177147, 1, layout::complex_planar, direction::backward); }
+ catch (const std::exception& err) { handle_exception(err); }
+}
-template< class T, class cl_T, class fftw_T>
-void huge_1D_forward_in_place_complex_interleaved_to_complex_interleaved()
+TEST_F(accuracy_test_pow3_single, huge_1D_forward_in_place_complex_planar_to_complex_planar_177147_3)
{
- std::vector<size_t> lengths;
- lengths.push_back(huge3);
- size_t batch = 1;
- std::vector<size_t> input_strides;
- std::vector<size_t> output_strides;
- size_t input_distance = 0;
- size_t output_distance = 0;
- layout::buffer_layout_t in_layout = layout::complex_interleaved;
- layout::buffer_layout_t out_layout = layout::complex_interleaved;
- placeness::placeness_t placeness = placeness::in_place;
- direction::direction_t direction = direction::forward;
+ try { huge_1D_forward_in_place_complex_planar_to_complex_planar< float, cl_float, fftwf_complex >(177147, 3, layout::complex_planar, direction::forward); }
+ catch (const std::exception& err) { handle_exception(err); }
+}
+TEST_F(accuracy_test_pow3_single, huge_1D_backward_in_place_complex_planar_to_complex_planar_177147_3)
+{
+ try { huge_1D_forward_in_place_complex_planar_to_complex_planar< float, cl_float, fftwf_complex >(177147, 3, layout::complex_planar, direction::backward); }
+ catch (const std::exception& err) { handle_exception(err); }
+}
- data_pattern pattern = sawtooth;
- complex_to_complex<T, cl_T, fftw_T>(pattern, direction, lengths, batch, input_strides, output_strides, input_distance, output_distance, in_layout, out_layout, placeness);
+TEST_F(accuracy_test_pow3_double, huge_1D_forward_in_place_complex_planar_to_complex_planar_177147_1)
+{
+ try { huge_1D_forward_in_place_complex_planar_to_complex_planar< double, cl_double, fftw_complex >(177147, 1, layout::complex_planar, direction::forward); }
+ catch (const std::exception& err) { handle_exception(err); }
+}
+TEST_F(accuracy_test_pow3_double, huge_1D_backward_in_place_complex_planar_to_complex_planar_177147_1)
+{
+ try { huge_1D_forward_in_place_complex_planar_to_complex_planar< double, cl_double, fftw_complex >(177147, 1, layout::complex_planar, direction::backward); }
+ catch (const std::exception& err) { handle_exception(err); }
}
-TEST_F(accuracy_test_pow3_single, huge_1D_forward_in_place_complex_interleaved_to_complex_interleaved)
+TEST_F(accuracy_test_pow3_double, huge_1D_forward_in_place_complex_planar_to_complex_planar_177147_3)
{
- try { huge_1D_forward_in_place_complex_interleaved_to_complex_interleaved< float, cl_float, fftwf_complex >(); }
- catch (const std::exception& err) { handle_exception(err); }
+ try { huge_1D_forward_in_place_complex_planar_to_complex_planar< double, cl_double, fftw_complex >(177147, 3, layout::complex_planar, direction::forward); }
+ catch (const std::exception& err) { handle_exception(err); }
+}
+TEST_F(accuracy_test_pow3_double, huge_1D_backward_in_place_complex_planar_to_complex_planar_177147_3)
+{
+ try { huge_1D_forward_in_place_complex_planar_to_complex_planar< double, cl_double, fftw_complex >(177147, 3, layout::complex_planar, direction::backward); }
+ catch (const std::exception& err) { handle_exception(err); }
+}
+//interleaved
+TEST_F(accuracy_test_pow3_single, huge_1D_forward_in_place_complex_interleaved_to_complex_interleaved_177147_1)
+{
+ try { huge_1D_forward_in_place_complex_planar_to_complex_planar< float, cl_float, fftwf_complex >(177147, 1, layout::complex_interleaved, direction::forward); }
+ catch (const std::exception& err) { handle_exception(err); }
+}
+TEST_F(accuracy_test_pow3_single, huge_1D_backward_in_place_complex_interleaved_to_complex_interleaved_177147_1)
+{
+ try { huge_1D_forward_in_place_complex_planar_to_complex_planar< float, cl_float, fftwf_complex >(177147, 1, layout::complex_interleaved, direction::backward); }
+ catch (const std::exception& err) { handle_exception(err); }
}
-TEST_F(accuracy_test_pow3_double, huge_1D_forward_in_place_complex_interleaved_to_complex_interleaved)
+TEST_F(accuracy_test_pow3_single, huge_1D_forward_in_place_complex_interleaved_to_complex_interleaved_177147_3)
{
- try { huge_1D_forward_in_place_complex_interleaved_to_complex_interleaved< double, cl_double, fftw_complex >(); }
- catch (const std::exception& err) { handle_exception(err); }
+ try { huge_1D_forward_in_place_complex_planar_to_complex_planar< float, cl_float, fftwf_complex >(177147, 3, layout::complex_interleaved, direction::forward); }
+ catch (const std::exception& err) { handle_exception(err); }
+}
+TEST_F(accuracy_test_pow3_single, huge_1D_backward_in_place_complex_interleaved_to_complex_interleaved_177147_3)
+{
+ try { huge_1D_forward_in_place_complex_planar_to_complex_planar< float, cl_float, fftwf_complex >(177147, 3, layout::complex_interleaved, direction::backward); }
+ catch (const std::exception& err) { handle_exception(err); }
}
+TEST_F(accuracy_test_pow3_double, huge_1D_forward_in_place_complex_interleaved_to_complex_interleaved_177147_1)
+{
+ try { huge_1D_forward_in_place_complex_planar_to_complex_planar< double, cl_double, fftw_complex >(177147, 1, layout::complex_interleaved, direction::forward); }
+ catch (const std::exception& err) { handle_exception(err); }
+}
+TEST_F(accuracy_test_pow3_double, huge_1D_backward_in_place_complex_interleaved_to_complex_interleaved_177147_1)
+{
+ try { huge_1D_forward_in_place_complex_planar_to_complex_planar< double, cl_double, fftw_complex >(177147, 1, layout::complex_interleaved, direction::backward); }
+ catch (const std::exception& err) { handle_exception(err); }
+}
+
+TEST_F(accuracy_test_pow3_double, huge_1D_forward_in_place_complex_interleaved_to_complex_interleaved_177147_3)
+{
+ try { huge_1D_forward_in_place_complex_planar_to_complex_planar< double, cl_double, fftw_complex >(177147, 3, layout::complex_interleaved, direction::forward); }
+ catch (const std::exception& err) { handle_exception(err); }
+}
+TEST_F(accuracy_test_pow3_double, huge_1D_backward_in_place_complex_interleaved_to_complex_interleaved_177147_3)
+{
+ try { huge_1D_forward_in_place_complex_planar_to_complex_planar< double, cl_double, fftw_complex >(177147, 3, layout::complex_interleaved, direction::backward); }
+ catch (const std::exception& err) { handle_exception(err); }
+}
+
+
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
// ^^^^^^^^^^^^^^^^^^^^^^^ normal 2D ^^^^^^^^^^^^^^^^^^^^^^ //
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
diff --git a/src/tests/test_constants.h b/src/tests/test_constants.h
index 95f2afc..4b0d9ca 100644
--- a/src/tests/test_constants.h
+++ b/src/tests/test_constants.h
@@ -190,7 +190,6 @@ const size_t small3 = 9;
const size_t normal3 = 729;
const size_t large3 = 6561;
const size_t dlarge3 = 2187;
-const size_t huge3 = 729 * 729 * 3;
const size_t small5 = 25;
const size_t normal5 = 625;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/clfft.git
More information about the debian-science-commits
mailing list