Skip to content

Commit 19f125e

Browse files
author
Peter Andreas Entschev
committed
Moved large FFT unit tests to fft_large.cpp
1 parent 2bcaea9 commit 19f125e

2 files changed

Lines changed: 58 additions & 38 deletions

File tree

test/fft.cpp

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -408,25 +408,6 @@ TEST(fft, CPP_4D)
408408
delete[] h_B;
409409
}
410410

411-
TEST(fft2, CPP_4D)
412-
{
413-
af::array a = af::randu(1024, 1024, 32);
414-
af::array b = af::fft2(a);
415-
416-
af::array A = af::moddims(a, 1024, 1024, 4, 8);
417-
af::array B = af::fft2(A);
418-
419-
af::cfloat *h_b = b.host<af::cfloat>();
420-
af::cfloat *h_B = B.host<af::cfloat>();
421-
422-
for (int i = 0; i < a.elements(); i++) {
423-
ASSERT_EQ(h_b[i], h_B[i]) << "at: " << i << std::endl;
424-
}
425-
426-
delete[] h_b;
427-
delete[] h_B;
428-
}
429-
430411
TEST(ifft, CPP_4D)
431412
{
432413
af::array a = af::randu(1024, 1024, c32);
@@ -446,25 +427,6 @@ TEST(ifft, CPP_4D)
446427
delete[] h_B;
447428
}
448429

449-
TEST(ifft2, CPP_4D)
450-
{
451-
af::array a = af::randu(1024, 1024, 32, c32);
452-
af::array b = af::ifft2(a);
453-
454-
af::array A = af::moddims(a, 1024, 1024, 4, 8);
455-
af::array B = af::ifft2(A);
456-
457-
af::cfloat *h_b = b.host<af::cfloat>();
458-
af::cfloat *h_B = B.host<af::cfloat>();
459-
460-
for (int i = 0; i < a.elements(); i++) {
461-
ASSERT_EQ(h_b[i], h_B[i]) << "at: " << i << std::endl;
462-
}
463-
464-
delete[] h_b;
465-
delete[] h_B;
466-
}
467-
468430
TEST(fft, GFOR)
469431
{
470432
af::array a = af::randu(1024, 1024);

test/fft_large.cpp

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*******************************************************
2+
* Copyright (c) 2015, ArrayFire
3+
* All rights reserved.
4+
*
5+
* This file is distributed under 3-clause BSD license.
6+
* The complete license agreement can be obtained at:
7+
* http://arrayfire.com/licenses/BSD-3-Clause
8+
********************************************************/
9+
10+
#include <gtest/gtest.h>
11+
#include <arrayfire.h>
12+
#include <af/dim4.hpp>
13+
#include <af/traits.hpp>
14+
#include <string>
15+
#include <vector>
16+
#include <stdexcept>
17+
#include <testHelpers.hpp>
18+
19+
using std::string;
20+
using std::vector;
21+
22+
TEST(fft2, CPP_4D)
23+
{
24+
af::array a = af::randu(1024, 1024, 32);
25+
af::array b = af::fft2(a);
26+
27+
af::array A = af::moddims(a, 1024, 1024, 4, 8);
28+
af::array B = af::fft2(A);
29+
30+
af::cfloat *h_b = b.host<af::cfloat>();
31+
af::cfloat *h_B = B.host<af::cfloat>();
32+
33+
for (int i = 0; i < a.elements(); i++) {
34+
ASSERT_EQ(h_b[i], h_B[i]) << "at: " << i << std::endl;
35+
}
36+
37+
delete[] h_b;
38+
delete[] h_B;
39+
}
40+
41+
TEST(ifft2, CPP_4D)
42+
{
43+
af::array a = af::randu(1024, 1024, 32, c32);
44+
af::array b = af::ifft2(a);
45+
46+
af::array A = af::moddims(a, 1024, 1024, 4, 8);
47+
af::array B = af::ifft2(A);
48+
49+
af::cfloat *h_b = b.host<af::cfloat>();
50+
af::cfloat *h_B = B.host<af::cfloat>();
51+
52+
for (int i = 0; i < a.elements(); i++) {
53+
ASSERT_EQ(h_b[i], h_B[i]) << "at: " << i << std::endl;
54+
}
55+
56+
delete[] h_b;
57+
delete[] h_B;
58+
}

0 commit comments

Comments
 (0)