From: Mark Abraham Date: Tue, 3 Aug 2021 13:42:42 +0000 (+0000) Subject: Add GPU 3D FFT tests X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=8dd21f717c82277c611b537d92c19348ded5b357;p=alexxy%2Fgromacs.git Add GPU 3D FFT tests --- diff --git a/src/gromacs/fft/tests/CMakeLists.txt b/src/gromacs/fft/tests/CMakeLists.txt index 4a6e1dd848..319a6ab7f3 100644 --- a/src/gromacs/fft/tests/CMakeLists.txt +++ b/src/gromacs/fft/tests/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2012,2013,2020, by the GROMACS development team, led by +# Copyright (c) 2012,2013,2020,2021, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,7 +32,7 @@ # To help us fund GROMACS development, we humbly ask that you cite # the research papers on the package. Check out http://www.gromacs.org. -gmx_add_unit_test(FFTUnitTests fft-test - CPP_SOURCE_FILES +gmx_add_unit_test(FFTUnitTests fft-test HARDWARE_DETECTION + GPU_CPP_SOURCE_FILES fft.cpp ) diff --git a/src/gromacs/fft/tests/fft.cpp b/src/gromacs/fft/tests/fft.cpp index 3ef73d4f3f..b743d3d114 100644 --- a/src/gromacs/fft/tests/fft.cpp +++ b/src/gromacs/fft/tests/fft.cpp @@ -47,18 +47,30 @@ #include "gromacs/fft/fft.h" +#include "config.h" + #include #include +#include #include +#include "gromacs/fft/gpu_3dfft.h" #include "gromacs/fft/parallel_3dfft.h" +#include "gromacs/gpu_utils/clfftinitializer.h" +#if GMX_GPU +# include "gromacs/gpu_utils/devicebuffer.h" +#endif #include "gromacs/utility/stringutil.h" #include "testutils/refdata.h" +#include "testutils/test_hardware_environment.h" #include "testutils/testasserts.h" +#include "testutils/testmatchers.h" -namespace +namespace gmx +{ +namespace test { /*! \brief Input data for FFT tests. @@ -109,25 +121,23 @@ const double inputdata[] = { class BaseFFTTest : public ::testing::Test { public: - BaseFFTTest() : checker_(data_.rootChecker()), flags_(GMX_FFT_FLAG_CONSERVATIVE) - { - // TODO: These tolerances are just something that has been observed - // to be sufficient to pass the tests. It would be nicer to - // actually argue about why they are sufficient (or what is). - checker_.setDefaultTolerance(gmx::test::relativeToleranceAsPrecisionDependentUlp(10.0, 64, 512)); - } + BaseFFTTest() : flags_(GMX_FFT_FLAG_CONSERVATIVE) {} ~BaseFFTTest() override { gmx_fft_cleanup(); } - gmx::test::TestReferenceData data_; - gmx::test::TestReferenceChecker checker_; - std::vector in_, out_; - int flags_; + TestReferenceData data_; + std::vector in_, out_; + int flags_; + // TODO: These tolerances are just something that has been observed + // to be sufficient to pass the tests. It would be nicer to + // actually argue about why they are sufficient (or what is). + // Should work for both one-way and forward+backward transform. + FloatingPointTolerance defaultTolerance_ = relativeToleranceAsPrecisionDependentUlp(10.0, 64, 512); }; class FFTTest : public BaseFFTTest { public: - FFTTest() : fft_(nullptr) {} + FFTTest() : fft_(nullptr) { checker_.setDefaultTolerance(defaultTolerance_); } ~FFTTest() override { if (fft_) @@ -135,13 +145,14 @@ public: gmx_fft_destroy(fft_); } } - gmx_fft_t fft_; + TestReferenceChecker checker_ = data_.rootChecker(); + gmx_fft_t fft_; }; class ManyFFTTest : public BaseFFTTest { public: - ManyFFTTest() : fft_(nullptr) {} + ManyFFTTest() : fft_(nullptr) { checker_.setDefaultTolerance(defaultTolerance_); } ~ManyFFTTest() override { if (fft_) @@ -149,7 +160,8 @@ public: gmx_many_fft_destroy(fft_); } } - gmx_fft_t fft_; + TestReferenceChecker checker_ = data_.rootChecker(); + gmx_fft_t fft_; }; @@ -159,11 +171,11 @@ class FFTTest1D : public FFTTest, public ::testing::WithParamInterface { }; -class FFFTest3D : public BaseFFTTest +class FFTTest3D : public BaseFFTTest { public: - FFFTest3D() : fft_(nullptr) {} - ~FFFTest3D() override + FFTTest3D() : fft_(nullptr) {} + ~FFTTest3D() override { if (fft_) { @@ -276,44 +288,172 @@ TEST_F(FFTTest, Real2DLength18_15Test) // _checker.checkSequenceArray(rx*ny, out, "backward"); } +namespace +{ + +/*! \brief Check that the real grid after forward and backward + * 3D transforms matches the input real grid. */ +void checkRealGrid(const ivec realGridSize, + const ivec realGridSizePadded, + ArrayRef inputRealGrid, + ArrayRef outputRealGridValues) +{ + // Normalize the output (as the implementation does not + // normalize either FFT) + const real normalizationConstant = 1.0 / (realGridSize[XX] * realGridSize[YY] * realGridSize[ZZ]); + std::transform(outputRealGridValues.begin(), + outputRealGridValues.end(), + outputRealGridValues.begin(), + [normalizationConstant](const real r) { return r * normalizationConstant; }); + // Check the real grid, skipping unused data from the padding + const auto realGridTolerance = relativeToleranceAsFloatingPoint(10, 1e-6); + for (int i = 0; i < realGridSize[XX] * realGridSize[YY]; i++) + { + auto expected = + arrayRefFromArray(inputRealGrid.data() + i * realGridSizePadded[ZZ], realGridSize[ZZ]); + auto actual = arrayRefFromArray(outputRealGridValues.data() + i * realGridSizePadded[ZZ], + realGridSize[ZZ]); + EXPECT_THAT(actual, Pointwise(RealEq(realGridTolerance), expected)) + << formatString("checking backward transform part %d", i); + } +} + +} // namespace + // TODO: test with threads and more than 1 MPI ranks -TEST_F(FFFTest3D, Real5_6_9) +TEST_F(FFTTest3D, Real5_6_9) { - int ndata[] = { 5, 6, 9 }; - MPI_Comm comm[] = { MPI_COMM_NULL, MPI_COMM_NULL }; + int realGridSize[] = { 5, 6, 9 }; + MPI_Comm comm[] = { MPI_COMM_NULL, MPI_COMM_NULL }; real* rdata; t_complex* cdata; - ivec local_ndata, offset, rsize, csize, complex_order; + ivec local_ndata, offset, realGridSizePadded, complexGridSizePadded, complex_order; + TestReferenceChecker checker(data_.rootChecker()); + checker.setDefaultTolerance(defaultTolerance_); - gmx_parallel_3dfft_init(&fft_, ndata, &rdata, &cdata, comm, TRUE, 1); + gmx_parallel_3dfft_init(&fft_, realGridSize, &rdata, &cdata, comm, TRUE, 1); - gmx_parallel_3dfft_real_limits(fft_, local_ndata, offset, rsize); - gmx_parallel_3dfft_complex_limits(fft_, complex_order, local_ndata, offset, csize); - checker_.checkVector(rsize, "rsize"); - checker_.checkVector(csize, "csize"); - int size = csize[0] * csize[1] * csize[2]; + gmx_parallel_3dfft_real_limits(fft_, local_ndata, offset, realGridSizePadded); + gmx_parallel_3dfft_complex_limits(fft_, complex_order, local_ndata, offset, complexGridSizePadded); + checker.checkVector(realGridSizePadded, "realGridSizePadded"); + checker.checkVector(complexGridSizePadded, "complexGridSizePadded"); + int size = complexGridSizePadded[0] * complexGridSizePadded[1] * complexGridSizePadded[2]; int sizeInBytes = size * sizeof(t_complex); int sizeInReals = sizeInBytes / sizeof(real); + // Prepare the real grid in_ = std::vector(sizeInReals); // Use std::copy to convert from double to real easily std::copy(inputdata, inputdata + sizeInReals, in_.begin()); // Use memcpy to convert to t_complex easily memcpy(rdata, in_.data(), sizeInBytes); + + // Do the forward FFT to compute the complex grid gmx_parallel_3dfft_execute(fft_, GMX_FFT_REAL_TO_COMPLEX, 0, nullptr); - // TODO use std::complex and add checkComplex for it - checker_.checkSequenceArray(size * 2, reinterpret_cast(cdata), "forward"); - // Use std::copy to convert from double to real easily - std::copy(inputdata, inputdata + sizeInReals, in_.begin()); - // Use memcpy to convert to t_complex easily - memcpy(cdata, in_.data(), sizeInBytes); + // Check the complex grid (NB this data has not been normalized) + ArrayRef complexGridValues = arrayRefFromArray(reinterpret_cast(cdata), size * 2); + checker.checkSequence( + complexGridValues.begin(), complexGridValues.end(), "ComplexGridAfterRealToComplex"); + + // Do the back transform gmx_parallel_3dfft_execute(fft_, GMX_FFT_COMPLEX_TO_REAL, 0, nullptr); - for (int i = 0; i < ndata[0] * ndata[1]; i++) // check sequence but skip unused data + + ArrayRef outputRealGridValues = arrayRefFromArray( + rdata, realGridSizePadded[XX] * realGridSizePadded[YY] * realGridSizePadded[ZZ]); + checkRealGrid(realGridSize, realGridSizePadded, in_, outputRealGridValues); +} + +#if GMX_GPU +TEST_F(FFTTest3D, GpuReal5_6_9) +{ + // Ensure library resources are managed appropriately + ClfftInitializer clfftInitializer; + for (const auto& testDevice : getTestHardwareEnvironment()->getTestDeviceList()) { - checker_.checkSequenceArray( - ndata[2], rdata + i * rsize[2], gmx::formatString("backward %d", i).c_str()); + TestReferenceChecker checker(data_.rootChecker()); // Must be inside the loop to avoid warnings + checker.setDefaultTolerance(defaultTolerance_); + + const DeviceContext& deviceContext = testDevice->deviceContext(); + setActiveDevice(testDevice->deviceInfo()); + const DeviceStream& deviceStream = testDevice->deviceStream(); + + ivec realGridSize = { 5, 6, 9 }; + ivec realGridSizePadded = { realGridSize[XX], realGridSize[YY], (realGridSize[ZZ] / 2 + 1) * 2 }; + ivec complexGridSizePadded = { realGridSize[XX], realGridSize[YY], (realGridSize[ZZ] / 2) + 1 }; + + checker.checkVector(realGridSizePadded, "realGridSizePadded"); + checker.checkVector(complexGridSizePadded, "complexGridSizePadded"); + + int size = complexGridSizePadded[0] * complexGridSizePadded[1] * complexGridSizePadded[2]; + int sizeInReals = size * 2; + + // Set up the complex grid. Complex numbers take twice the + // memory. + std::vector complexGridValues(sizeInReals); + in_.resize(sizeInReals); + // Use std::copy to convert from double to real easily + std::copy(inputdata, inputdata + sizeInReals, in_.begin()); + + // Allocate the device buffers + DeviceBuffer realGrid, complexGrid; + allocateDeviceBuffer(&realGrid, in_.size(), deviceContext); + allocateDeviceBuffer(&complexGrid, complexGridValues.size(), deviceContext); + + const bool useDecomposition = false; + const bool performOutOfPlaceFFT = true; + Gpu3dFft gpu3dFft(realGridSize, + realGridSizePadded, + complexGridSizePadded, + useDecomposition, + performOutOfPlaceFFT, + deviceContext, + deviceStream, + realGrid, + complexGrid); + + // Transfer the real grid input data for the FFT + copyToDeviceBuffer( + &realGrid, in_.data(), 0, in_.size(), deviceStream, GpuApiCallBehavior::Sync, nullptr); + + // Do the forward FFT to compute the complex grid + CommandEvent* timingEvent = nullptr; + gpu3dFft.perform3dFft(GMX_FFT_REAL_TO_COMPLEX, timingEvent); + deviceStream.synchronize(); + + // Check the complex grid (NB this data has not been normalized) + copyFromDeviceBuffer(complexGridValues.data(), + &complexGrid, + 0, + complexGridValues.size(), + deviceStream, + GpuApiCallBehavior::Sync, + nullptr); + checker.checkSequence( + complexGridValues.begin(), complexGridValues.end(), "ComplexGridAfterRealToComplex"); + + // Do the back transform + gpu3dFft.perform3dFft(GMX_FFT_COMPLEX_TO_REAL, timingEvent); + deviceStream.synchronize(); + + // Transfer the real grid back from the device + std::vector outputRealGridValues(in_.size()); + copyFromDeviceBuffer(outputRealGridValues.data(), + &realGrid, + 0, + outputRealGridValues.size(), + deviceStream, + GpuApiCallBehavior::Sync, + nullptr); + + checkRealGrid(realGridSize, realGridSizePadded, in_, outputRealGridValues); + + freeDeviceBuffer(&realGrid); + freeDeviceBuffer(&complexGrid); } } -} // namespace +#endif + +} // namespace test +} // namespace gmx diff --git a/src/gromacs/fft/tests/refdata/FFFTest3D_Real5_6_9.xml b/src/gromacs/fft/tests/refdata/FFFTest3D_Real5_6_9.xml deleted file mode 100644 index 63e1eb7265..0000000000 --- a/src/gromacs/fft/tests/refdata/FFFTest3D_Real5_6_9.xml +++ /dev/null @@ -1,677 +0,0 @@ - - - - - 5 - 6 - 10 - - - 5 - 6 - 5 - - - 300 - 136.09999999999999 - 0 - 6.1046777798672718 - -9.6927915189833946 - -156.90467777986728 - -44.500278567324997 - -156.90467777986728 - 44.500278567324997 - 6.1046777798672718 - 9.6927915189833946 - 109.33089836200787 - 144.0174147413677 - 110.98910420129505 - -75.428066165741754 - -28.957680459929328 - -35.773394870359915 - 12.909729603318853 - -51.326604840195436 - -17.828427811489327 - -51.168418460828008 - 80.282164734026082 - -30.151275351195387 - 46.266467708046036 - -2.5678489670789695 - -79.201790713534407 - -57.924296703634695 - 82.000686192249177 - -94.147447732293045 - 79.405763443152921 - -57.639099104105966 - 174.5 - -82.099208278764806 - -1.0211355262416717 - -80.952112737709058 - 115.14489096295327 - -67.412953751874596 - 65.004908445660504 - 16.143174029504717 - -55.628663882372045 - -81.859587355434371 - -73.063063096033957 - -35.171612785160626 - 22.705466420779317 - 46.342233241626971 - -37.809610613745839 - -14.488888242266853 - -79.566298372895176 - 40.132587632371795 - 171.53659040275272 - -43.288340582509605 - -53.849999999999994 - 8.7468565782228325 - -37.527983739057511 - -76.662755634952219 - -46.050013953391961 - 82.151413216948384 - 93.26075304045446 - 71.72939427904592 - 82.167244651995048 - -68.64440036357621 - 34.447925708729784 - -46.679698485304449 - 47.084315355518264 - 53.226361938057281 - -39.940061988556401 - -56.889712822841695 - -54.133563551261311 - 162.86277437335812 - 0.13978000683655267 - -83.154435988355104 - 77.450843683464598 - 99.232127419610549 - 25.603100973672902 - -41.980268634661634 - -63.660910025502318 - 0.38754591548317308 - -14.140629179993443 - -109.4766531704594 - -1.8193728170681087 - -50.783752164257926 - -28.349999999999952 - 66.250943389509573 - 41.767316918315906 - 141.31781715474784 - -98.532415917009445 - -56.132356053022541 - -26.039172227730639 - -32.616671442082939 - 43.404271226424349 - 74.736944696670093 - -75.394910708698106 - -63.045733778267902 - 58.365744569582262 - 39.770614495173518 - -89.180292566745976 - -54.385841985238315 - -23.894931563229392 - 99.576471973869459 - 1.8243953109653859 - 79.398509308323142 - -93.249999999999986 - -38.19172030689375 - 71.020497976742078 - -1.7414685014859375 - -45.144746631885752 - 136.91007840098462 - 76.807385747829073 - -61.008015162243666 - 83.066862907314615 - -10.854137720612538 - 11.146194900875926 - -39.325905869819678 - -44.096266736330733 - -54.376841765161188 - 38.091494194864921 - -10.091555063687309 - 28.417313488040552 - 104.61453969853031 - -132.63257919812122 - 13.423985690353295 - -89.798336147192956 - -124.42587252332874 - -177.69961189145357 - -86.970199597566591 - 93.17963732706697 - -17.907496809528595 - 21.200096591640985 - -170.3504082897976 - -56.000998352042203 - -18.570020938666069 - -41.500000000000043 - 70.148057706539575 - 92.677142033179237 - 12.237494316957232 - 63.749995048043708 - -69.490209658536372 - 59.724306187452875 - 16.675397899553808 - -41.651443268675777 - 8.5343775020010852 - 13.130336383741636 - -22.927176864452179 - 116.12111228365779 - -45.760745866170936 - -29.881200055227058 - 24.907824000483362 - -39.485004753366795 - -8.2658722859128169 - 60.512645744111403 - 100.43935627235211 - -12.299999999999983 - -1.532107773982716e-14 - -105.67236454974396 - -26.742612718204111 - 23.572364549743824 - -22.442318619165579 - 23.572364549743931 - 22.442318619165665 - -105.67236454974388 - 26.74261271820416 - 42.035849450475915 - -41.135575070858103 - 101.09538167141052 - 13.414183590793666 - -72.121180894777268 - -60.285029492264044 - -4.2385225536985374 - -12.733879099379028 - -2.2031334820560886 - -5.9043348756325251 - 80.964834850820381 - -8.4039231702524511 - -131.61904089627444 - -28.451722994458656 - -9.7116784144650872 - -28.127997000734677 - -10.749861458489509 - -19.317475675829929 - 20.460493103348547 - 99.431367993784676 - -3.3000000000000114 - -11.085125168440795 - -22.328371106147429 - 9.1879447293819183 - -85.659284275876232 - -7.1290511976147108 - -68.632393167495465 - -26.374469875305937 - -61.079951450481019 - -80.646702595135139 - -53.250684301296275 - -70.41197369012103 - 41.788374988548171 - 32.640898630438265 - -34.654631341454106 - 137.86853343714677 - 22.242615745077465 - 81.318379495452149 - -23.038816467169607 - -59.640953773067203 - -93.249999999999986 - 38.19172030689375 - 83.066862907314615 - 10.854137720612538 - 76.807385747829073 - 61.008015162243666 - -45.144746631885752 - -136.91007840098462 - 71.020497976742078 - 1.7414685014859375 - -29.122549319509069 - -55.548007164359561 - -91.848515147247426 - 25.06854222882243 - 7.3660985224634778 - -19.841635066202443 - -54.161343304004404 - 32.336599137264542 - 48.259353160853109 - -110.07063552157047 - -25.626531284617432 - -34.453667272791314 - 40.635846175667098 - 152.67975355881111 - 91.78484627866203 - 79.680065800736912 - -91.796318858791864 - 60.323017825477706 - -163.82188856316603 - 25.244915999312511 - 52.850000000000058 - -2.3382685902179858 - -19.91408137475327 - -59.783730527586336 - 32.573560897852467 - 39.669307866057125 - 31.658633708141917 - -44.218290841443348 - -33.918113231241179 - -63.665841176367557 - -106.97911453329807 - 64.66325190459132 - 45.356186666025032 - 34.173035237197205 - -39.799606476905076 - -13.643005636820957 - 44.499372603779527 - 33.891599639990183 - -140.20066970017646 - -124.76439777461155 - -53.850000000000009 - -8.7468565782228183 - 82.167244651995205 - 68.644400363576096 - 93.260753040454404 - -71.729394279046062 - -46.050013953392131 - -82.151413216948328 - -37.527983739057447 - 76.662755634952305 - -7.3610436092304763 - -30.547454539791147 - -18.733928727339173 - -18.102923805155882 - -62.82063554018734 - 30.062829944592039 - 25.151783100728036 - -44.495797289735151 - -26.734819466231169 - 62.413919808452206 - -48.153015000031743 - 47.71798614443874 - -22.179018783043063 - 5.6175083821953766 - -9.6620741626321305 - -2.8341625358714282 - -79.862998875491655 - 28.256495771921998 - 53.788706248057551 - -29.917919391540103 - -3.3000000000000398 - -72.572928837136018 - -11.154757375936285 - 123.56158573276491 - 4.391989120832692 - -61.96304685084263 - -18.30723670508241 - 116.70643860522515 - 0.37000496018599804 - -218.31535114198857 - -38.139800074234053 - -30.521720281097942 - -107.60901341744089 - -90.941870214929992 - 59.289174146567866 - -85.926292155264207 - -4.1465872345487398 - 162.12010447830716 - 102.1718381873422 - 60.231632931236987 - - - 9 - 98.799999999999997 - -114.17356732757719 - 53.384075393173227 - 141.47199899409034 - 199.50902369698844 - 113.62515772012821 - -240.27199899409035 - 7.0334226660655048 - 165.42188785122184 - - - 9 - -1.5752990424915652 - -2.9455394548274754 - 49.95592752379568 - 9.2464792224190404 - -80.868528144019606 - 142.01990127005607 - -145.11209026077205 - -67.696439219454547 - -220.99493351685803 - - - 9 - -138.07787643056315 - -95.826875135688994 - 73.996428626422301 - 107.42916512459894 - -172.52346162732448 - -184.75361826185093 - -99.268395609140242 - 93.058202090688113 - 94.74898396157765 - - - 9 - -235.80000000000004 - 81.949379543941745 - 10.473869144692348 - 184.41408311032413 - -37.698123461634296 - 8.4715186995471896 - 42.385916889675968 - 0.26911387157102595 - -81.465757798118148 - - - 9 - -78.322123569436854 - 248.55977420749613 - -35.552362712469616 - -85.931604390859917 - -61.809843162557783 - -176.47551156447958 - 96.170834875401255 - 261.258274628913 - -104.07999105072589 - - - 9 - 155.17529904249164 - -98.054784036654695 - 104.7868879046318 - 38.312090260771917 - -323.53345409503578 - 200.2760504100425 - 44.753520777580981 - -91.192657145303485 - 55.247568503627704 - - - 9 - 15.303512203673439 - 305.8417773965229 - 149.63642319825721 - 97.994280036482849 - -119.45564486257564 - -131.61449725304536 - -137.33825432710083 - -143.59706871739439 - -83.794037618517763 - - - 9 - 142.92194440900039 - -106.94848208349096 - -177.86913088170192 - 92.160865134863741 - 147.52064131879024 - 16.10773730651772 - 99.443083231115622 - -117.64340089550609 - 31.791713066080177 - - - 9 - 70.535843012407312 - -12.913960383936107 - -71.002562801141949 - -25.4614211584476 - 132.79474651115487 - 49.912000682648731 - -18.915377312923233 - -99.21579562065719 - -93.41662759409158 - - - 9 - -137.81219155290859 - -270.52611638440578 - -4.9177423672470262 - -109.39818723263446 - 78.202512280834114 - -56.368724642750863 - 41.836966344200128 - -61.765709427318583 - 63.196234058815804 - - - 9 - 95.71803428988315 - -146.68382720396653 - 121.75204137987734 - -94.825717707153942 - 46.993640996205691 - 171.31526794671083 - -95.826292103411461 - -57.056817800871507 - -0.19397483120351922 - - - 9 - -66.714126302558228 - -25.810599002217099 - 29.393924067872003 - -151.37572573631348 - 7.8342439632777641 - -94.377367003221309 - -70.206125724087329 - 93.005166103691664 - 139.59644081347116 - - - 9 - 115.71963314444717 - 4.6312103100194264 - 114.15415792126656 - 37.107727028258068 - 50.143704822468365 - -78.143218736964982 - -203.63187718820055 - 224.71637955775333 - 156.08119214541438 - - - 9 - 4.9039043456949472 - -94.431714276078111 - -169.81582884793104 - 224.33382652559737 - -107.83029995230413 - 30.179776667693119 - -187.17508761498954 - -133.83218721565669 - -80.841981050451608 - - - 9 - 24.096997814169889 - 20.671627746028825 - 190.05899316235499 - -44.652508355281228 - -190.77298632613235 - 59.908926306609914 - 11.267766578037357 - 8.8392202928189789 - -34.897733181241406 - - - 9 - 158.84687786413161 - 217.99492781212811 - -138.82594738474563 - -175.85858202022641 - 76.223652279684131 - -42.485785703038268 - 77.096637856218706 - 153.11954350023521 - 34.678306060552622 - - - 9 - 371.39502526136897 - -111.49279195570283 - 158.19081873733262 - -58.925671119530691 - -144.71988972800506 - -333.32217656126909 - 99.971615267290659 - -46.656629850947049 - -26.605886688390541 - - - 9 - 71.148192038040435 - -259.92390868152563 - 247.14795354500208 - -74.934844862088667 - -143.74464625132174 - -90.704177181511653 - 40.167190056658185 - -47.017923206913665 - -61.723971656076479 - - - 9 - 311.41576839866417 - -101.38744207132891 - -65.574456247279457 - 198.43164083349166 - -59.146570193629515 - -211.97035720241863 - 65.043048483196671 - 374.99115856435526 - 77.087652023803656 - - - 9 - 46.436607452085013 - -131.21786925466827 - -106.86294041413136 - -100.89493849076261 - 91.341349703918169 - 104.86826899066472 - 108.13578235939831 - 85.995586072325651 - 138.09948488445932 - - - 9 - 276.46765016460154 - 102.77535901877457 - 31.422378980505727 - 24.277083589916394 - 209.28910333980451 - -83.071229481675232 - -55.993796282865638 - 6.6343662980513045 - -98.950954485113186 - - - 9 - -144.9876322750122 - 116.62967038347652 - 100.52890254175037 - -126.68456856175324 - 92.689569818525527 - -95.47849048693503 - 112.27134446448976 - 48.48880612928285 - -88.62648315644104 - - - 9 - 115.84696057532403 - -233.43089737239819 - -201.87341723455972 - -170.12507625363628 - -157.86760046735139 - 63.396270989245927 - 125.96015871207827 - -31.44381153076408 - -120.66509202543989 - - - 9 - -38.792339959068002 - -97.641243664242779 - -298.20365770657571 - 32.913086466936676 - 234.08951270294585 - -94.883245031360104 - 154.46039443373573 - -274.26533090021292 - 138.11097003299557 - - - 9 - 122.2610862532153 - -283.0427512466955 - 180.15241577538353 - -9.9141066752170133 - -68.225900518696875 - -123.08567974377479 - 58.107541809089128 - -150.73192370070763 - 97.533476397784881 - - - 9 - -29.801893874037276 - 170.03622913088341 - -10.118556706633502 - -205.43915382732803 - -272.59639172396476 - 8.7330959208887329 - 94.856369991786892 - 37.072909884061374 - -43.885312638696632 - - - 9 - -122.64627960454543 - -218.25300495630358 - -66.248934921215351 - 235.81218197593182 - 77.755741706503443 - 161.37957855282087 - -117.81520662551542 - 24.181871661022953 - 125.04696383150052 - - - 9 - 30.252945963789017 - -222.87322834137666 - 2.2397215783475062 - -245.52203618184382 - 193.95778011433887 - -126.31235607728593 - -249.54157466845032 - 236.5707782492016 - 125.66017916437173 - - - 9 - -8.0142315132093813 - 34.968683899269891 - -150.81461809558681 - 61.533078723587487 - -96.969594117006423 - -39.411025671588746 - 173.31918207192354 - -71.781263920425047 - 4.8455027677415465 - - - 9 - 92.297711890842834 - 240.88637294249287 - 10.566089284880015 - -15.062663835846205 - 54.062522273351675 - -59.442852705262901 - 49.417941891322926 - -186.06049257608359 - -118.7464771685228 - - diff --git a/src/gromacs/fft/tests/refdata/FFTTest3D_GpuReal5_6_9.xml b/src/gromacs/fft/tests/refdata/FFTTest3D_GpuReal5_6_9.xml new file mode 100644 index 0000000000..816c5310a4 --- /dev/null +++ b/src/gromacs/fft/tests/refdata/FFTTest3D_GpuReal5_6_9.xml @@ -0,0 +1,317 @@ + + + + + 5 + 6 + 10 + + + 5 + 6 + 5 + + + 300 + 136.09999 + 0 + 109.33089 + 144.01743 + 80.28215 + -30.151276 + 174.5 + -82.099213 + -73.063065 + -35.171608 + -53.849991 + 8.7468605 + 34.447918 + -46.679695 + 77.450844 + 99.232132 + -28.349995 + 66.250931 + -75.394905 + -63.045742 + -93.249992 + -38.191727 + 11.146183 + -39.325916 + -89.79834 + -124.42588 + -41.5 + 70.148056 + 13.130341 + -22.927174 + -12.300018 + 0 + 42.035843 + -41.135578 + 80.964828 + -8.4039288 + -3.2999973 + -11.085131 + -53.250679 + -70.411972 + -93.249992 + 38.191727 + -29.122549 + -55.548016 + -25.626528 + -34.453659 + 52.849998 + -2.3382683 + -106.97911 + 64.663254 + -53.849991 + -8.7468605 + -7.3610411 + -30.547455 + -48.153027 + 47.717995 + -3.2999983 + -72.572922 + -38.139801 + -30.521713 + 6.1046782 + -9.692791 + 110.98911 + -75.428078 + 46.266464 + -2.5678482 + -1.0211296 + -80.952118 + 22.705467 + 46.342243 + -37.527981 + -76.662758 + 47.08432 + 53.226368 + 25.6031 + -41.980274 + 41.767311 + 141.31783 + 58.365734 + 39.770599 + 71.020485 + -1.7414665 + -44.096264 + -54.376839 + -177.69962 + -86.9702 + 92.677132 + 12.237498 + 116.1211 + -45.76075 + -105.67236 + -26.742617 + 101.09538 + 13.41419 + -131.61905 + -28.451714 + -22.328371 + 9.1879501 + 41.788376 + 32.6409 + 83.066856 + 10.854151 + -91.848518 + 25.068546 + 40.635841 + 152.67975 + -19.914082 + -59.78373 + 45.356178 + 34.173023 + 82.167252 + 68.644402 + -18.733931 + -18.102921 + -22.17901 + 5.6175013 + -11.154749 + 123.56158 + -107.60902 + -90.941872 + -156.90469 + -44.500271 + -28.957687 + -35.773396 + -79.20179 + -57.924294 + 115.1449 + -67.412949 + -37.809608 + -14.488893 + -46.050011 + 82.151398 + -39.940063 + -56.889717 + -63.660892 + 0.38755035 + -98.53241 + -56.132343 + -89.180298 + -54.385841 + -45.144741 + 136.9101 + 38.091484 + -10.091549 + 93.179642 + -17.907486 + 63.75 + -69.490211 + -29.881189 + 24.907822 + 23.572371 + -22.442316 + -72.121185 + -60.285027 + -9.7116699 + -28.127995 + -85.659286 + -7.1290541 + -34.654629 + 137.86853 + 76.807381 + 61.008018 + 7.3661022 + -19.84164 + 91.784836 + 79.680069 + 32.573555 + 39.669312 + -39.799622 + -13.642996 + 93.26075 + -71.729401 + -62.820633 + 30.062822 + -9.6620827 + -2.8341637 + 4.3919802 + -61.963036 + 59.289169 + -85.926285 + -156.90469 + 44.500271 + 12.909737 + -51.326603 + 82.000694 + -94.147453 + 65.004913 + 16.143177 + -79.566307 + 40.132591 + 93.26075 + 71.729401 + -54.133568 + 162.86279 + -14.140621 + -109.47665 + -26.039165 + -32.616673 + -23.894932 + 99.576469 + 76.807381 + -61.008018 + 28.417313 + 104.61455 + 21.200081 + -170.35042 + 59.724304 + 16.675398 + -39.485001 + -8.2658739 + 23.572371 + 22.442316 + -4.2385178 + -12.733873 + -10.749865 + -19.317474 + -68.632401 + -26.374466 + 22.242615 + 81.31839 + -45.144741 + -136.9101 + -54.161346 + 32.336605 + -91.79631 + 60.323013 + 31.658646 + -44.218285 + 44.499374 + 33.891602 + -46.050011 + -82.151398 + 25.151779 + -44.495792 + -79.862991 + 28.256498 + -18.307243 + 116.70643 + -4.1465816 + 162.1201 + 6.1046782 + 9.692791 + -17.828434 + -51.168427 + 79.405762 + -57.639107 + -55.628658 + -81.859589 + 171.53659 + -43.288349 + 82.167252 + -68.644402 + 0.13977623 + -83.154434 + -1.8193827 + -50.783756 + 43.404274 + 74.736938 + 1.8243904 + 79.398506 + 83.066856 + -10.854151 + -132.63257 + 13.42399 + -56.001003 + -18.570007 + -41.651451 + 8.5343847 + 60.512642 + 100.43935 + -105.67236 + 26.742617 + -2.2031364 + -5.9043312 + 20.460499 + 99.431366 + -61.079948 + -80.646698 + -23.038826 + -59.640953 + 71.020485 + 1.7414665 + 48.259361 + -110.07063 + -163.82187 + 25.244911 + -33.918114 + -63.66584 + -140.20068 + -124.76439 + -37.527981 + 76.662758 + -26.734808 + 62.413918 + 53.788704 + -29.917919 + 0.37000275 + -218.31534 + 102.17184 + 60.231632 + + diff --git a/src/gromacs/fft/tests/refdata/FFTTest3D_Real5_6_9.xml b/src/gromacs/fft/tests/refdata/FFTTest3D_Real5_6_9.xml new file mode 100644 index 0000000000..840a0bd64e --- /dev/null +++ b/src/gromacs/fft/tests/refdata/FFTTest3D_Real5_6_9.xml @@ -0,0 +1,317 @@ + + + + + 5 + 6 + 10 + + + 5 + 6 + 5 + + + 300 + 136.09999999999999 + 0 + 6.1046777798673304 + -9.6927915189833804 + -156.90467777986734 + -44.500278567325005 + -156.90467777986734 + 44.500278567325005 + 6.1046777798673304 + 9.6927915189833804 + 109.33089836200777 + 144.01741474136767 + 110.98910420129506 + -75.428066165741697 + -28.9576804599293 + -35.773394870359979 + 12.909729603318882 + -51.326604840195373 + -17.828427811489235 + -51.168418460828057 + 80.282164734026082 + -30.151275351195409 + 46.266467708046093 + -2.5678489670789659 + -79.201790713534393 + -57.924296703634646 + 82.000686192249006 + -94.147447732293045 + 79.405763443152878 + -57.63909910410591 + 174.5 + -82.099208278764777 + -1.0211355262417676 + -80.952112737709001 + 115.14489096295333 + -67.412953751874568 + 65.004908445660561 + 16.143174029504738 + -55.628663882372095 + -81.859587355434371 + -73.063063096033858 + -35.17161278516069 + 22.705466420779416 + 46.34223324162695 + -37.809610613745875 + -14.488888242266809 + -79.566298372895233 + 40.132587632371767 + 171.53659040275275 + -43.288340582509534 + -53.850000000000001 + 8.7468565782228254 + -37.527983739057433 + -76.662755634952319 + -46.050013953392011 + 82.151413216948384 + 93.260753040454404 + 71.729394279046062 + 82.167244651995048 + -68.644400363576196 + 34.447925708729784 + -46.679698485304343 + 47.084315355518257 + 53.226361938057238 + -39.940061988556415 + -56.889712822841616 + -54.133563551261453 + 162.86277437335798 + 0.13978000683670544 + -83.154435988355075 + 77.450843683464541 + 99.232127419610464 + 25.603100973672952 + -41.980268634661584 + -63.660910025502289 + 0.38754591548313932 + -14.140629179993454 + -109.47665317045926 + -1.819372817068146 + -50.783752164257912 + -28.349999999999991 + 66.250943389509558 + 41.767316918315899 + 141.3178171547479 + -98.532415917009473 + -56.132356053022612 + -26.039172227730649 + -32.616671442082982 + 43.404271226424243 + 74.73694469667015 + -75.394910708698077 + -63.045733778267945 + 58.365744569582304 + 39.770614495173604 + -89.180292566745905 + -54.385841985238351 + -23.89493156322942 + 99.576471973869374 + 1.824395310965258 + 79.398509308323057 + -93.25 + -38.191720306893735 + 71.020497976742121 + -1.7414685014859943 + -45.144746631885752 + 136.91007840098462 + 76.807385747829002 + -61.008015162243645 + 83.066862907314629 + -10.854137720612524 + 11.146194900875905 + -39.325905869819671 + -44.096266736330762 + -54.376841765161174 + 38.091494194864985 + -10.091555063687235 + 28.417313488040527 + 104.61453969853025 + -132.63257919812122 + 13.423985690353135 + -89.798336147192941 + -124.42587252332865 + -177.69961189145363 + -86.970199597566364 + 93.179637327066956 + -17.907496809528642 + 21.200096591640929 + -170.35040828979743 + -56.000998352042323 + -18.570020938665991 + -41.5 + 70.148057706539518 + 92.677142033179152 + 12.23749431695725 + 63.749995048043729 + -69.490209658536315 + 59.724306187452846 + 16.675397899553762 + -41.651443268675749 + 8.5343775020010852 + 13.130336383741557 + -22.927176864452125 + 116.12111228365768 + -45.760745866170758 + -29.881200055227175 + 24.907824000483256 + -39.485004753366788 + -8.2658722859129039 + 60.512645744111353 + 100.43935627235197 + -12.299999999999997 + 0 + -105.67236454974395 + -26.742612718204111 + 23.572364549743916 + -22.442318619165608 + 23.572364549743916 + 22.442318619165608 + -105.67236454974395 + 26.742612718204111 + 42.035849450475908 + -41.135575070858067 + 101.09538167141042 + 13.414183590793723 + -72.121180894777183 + -60.28502949226403 + -4.2385225536985178 + -12.733879099379088 + -2.2031334820560637 + -5.9043348756324505 + 80.964834850820353 + -8.4039231702524546 + -131.61904089627436 + -28.45172299445861 + -9.7116784144650836 + -28.127997000734691 + -10.749861458489534 + -19.317475675829904 + 20.460493103348522 + 99.431367993784619 + -3.3000000000000043 + -11.085125168440822 + -22.328371106147358 + 9.187944729381897 + -85.659284275876232 + -7.1290511976147215 + -68.632393167495422 + -26.374469875305898 + -61.079951450480984 + -80.646702595135253 + -53.250684301296232 + -70.41197369012103 + 41.788374988548 + 32.640898630438166 + -34.654631341454191 + 137.86853343714668 + 22.242615745077437 + 81.318379495452191 + -23.038816467169443 + -59.640953773067181 + -93.25 + 38.191720306893735 + 83.066862907314629 + 10.854137720612524 + 76.807385747829002 + 61.008015162243645 + -45.144746631885752 + -136.91007840098462 + 71.020497976742121 + 1.7414685014859943 + -29.12254931950897 + -55.548007164359511 + -91.848515147247383 + 25.068542228822352 + 7.3660985224634832 + -19.841635066202368 + -54.161343304004355 + 32.3365991372645 + 48.259353160853053 + -110.07063552157035 + -25.626531284617528 + -34.453667272791314 + 40.635846175667027 + 152.67975355881092 + 91.784846278662059 + 79.680065800736799 + -91.796318858791764 + 60.323017825477706 + -163.82188856316591 + 25.244915999312568 + 52.850000000000009 + -2.3382685902179645 + -19.91408137475328 + -59.783730527586329 + 32.573560897852502 + 39.669307866057082 + 31.658633708141942 + -44.218290841443263 + -33.918113231241179 + -63.665841176367543 + -106.97911453329806 + 64.663251904591306 + 45.356186666024996 + 34.173035237197176 + -39.79960647690492 + -13.643005636820892 + 44.499372603779499 + 33.891599639990183 + -140.20066970017635 + -124.76439777461135 + -53.850000000000001 + -8.7468565782228254 + 82.167244651995048 + 68.644400363576196 + 93.260753040454404 + -71.729394279046062 + -46.050013953392011 + -82.151413216948384 + -37.527983739057433 + 76.662755634952319 + -7.3610436092305136 + -30.547454539791165 + -18.73392872733908 + -18.10292380515591 + -62.820635540187361 + 30.062829944591893 + 25.151783100728075 + -44.495797289734995 + -26.734819466231212 + 62.413919808452086 + -48.153015000031722 + 47.717986144438648 + -22.179018783043063 + 5.6175083821953571 + -9.6620741626321376 + -2.8341625358714371 + -79.862998875491698 + 28.256495771921948 + 53.788706248057593 + -29.91791939154006 + -3.3000000000000007 + -72.572928837135976 + -11.154757375936294 + 123.5615857327648 + 4.3919891208326618 + -61.963046850842439 + -18.307236705082499 + 116.70643860522506 + 0.37000496018613305 + -218.31535114198851 + -38.13980007423406 + -30.52172028109797 + -107.60901341744066 + -90.941870214929978 + 59.289174146567873 + -85.926292155263994 + -4.1465872345488588 + 162.1201044783071 + 102.1718381873421 + 60.231632931236973 + +