From c1c50c3af7f5e63b6452ac7a41d7f7a729340a70 Mon Sep 17 00:00:00 2001 From: Jacques Xing <k2258928@erc-hpc-login1.create.kcl.ac.uk> Date: Thu, 18 Jan 2024 09:16:23 +0000 Subject: [PATCH] Specify MemoryRegionCUDA template parameter in test to avoid back storage warning message when using CUDA --- tests/init_assmbscatrfields.hpp | 6 +- tests/init_bwdtransfields.hpp | 6 +- tests/init_diagpreconfields.hpp | 6 +- tests/init_dirichletfields.hpp | 2 +- tests/init_fwdtransfields.hpp | 6 +- tests/init_helmholtzfields.hpp | 6 +- tests/init_helmsolvefields.hpp | 6 +- tests/init_identitycoefffields.hpp | 6 +- tests/init_identityphysfields.hpp | 6 +- tests/init_ipwrtbasefields.hpp | 6 +- tests/init_ipwrtderivbasefields.hpp | 6 +- tests/init_massfields.hpp | 6 +- tests/init_nullpreconfields.hpp | 6 +- tests/init_physderivfields.hpp | 8 +- tests/test_assmbscatrcuda.cpp | 50 ++++++----- tests/test_bwdtranscuda.cpp | 50 ++++++----- tests/test_diagpreconcuda.cpp | 70 +++++++++------ tests/test_dirichletcuda.cpp | 32 ++++--- tests/test_fwdtrans.cpp | 5 -- tests/test_helmholtzcuda.cpp | 50 ++++++----- tests/test_helmsolve.cpp | 5 -- tests/test_identitycoeffcuda.cpp | 50 ++++++----- tests/test_identityphyscuda.cpp | 50 ++++++----- tests/test_ipwrtbasecuda.cpp | 50 ++++++----- tests/test_ipwrtderivbasecuda.cpp | 50 ++++++----- tests/test_masscuda.cpp | 130 +++++++++++++++++----------- tests/test_neumanncuda.cpp | 30 ++++--- tests/test_nullpreconcuda.cpp | 31 ++++--- tests/test_physderivcuda.cpp | 50 ++++++----- 29 files changed, 460 insertions(+), 325 deletions(-) diff --git a/tests/init_assmbscatrfields.hpp b/tests/init_assmbscatrfields.hpp index 9d38110..46aa1ed 100644 --- a/tests/init_assmbscatrfields.hpp +++ b/tests/init_assmbscatrfields.hpp @@ -21,7 +21,7 @@ public: void SetTestCase(const std::vector<BlockAttributes> &blocks, double *inptr, bool padding = true) { - for (auto const &block : fixt_in->GetBlocks()) + for (auto const &block : blocks) { for (size_t el = 0; el < block.num_elements; ++el) { @@ -50,7 +50,7 @@ public: Array<OneD, NekDouble> outcoeff(fixt_explist->GetNcoeffs()); // Set test case - SetTestCase(blocks, incoeff.get(), false); + SetTestCase(fixt_in->GetBlocks(), incoeff.get(), false); // Calculate expected result from Nektar++ auto map = fixt_explist->GetLocalToGlobalMap(); @@ -58,7 +58,7 @@ public: // Vmath::Zero(map->GetNumGlobalDirBndCoeffs(), outcoeff, 1); map->GlobalToLocal(outcoeff, outcoeff); - // Copy expected result from Array to fixt_expected + // Copy expected result from Array to pointer double *ptr = outcoeff.get(); for (auto const &block : blocks) { diff --git a/tests/init_bwdtransfields.hpp b/tests/init_bwdtransfields.hpp index d184328..b7c2704 100644 --- a/tests/init_bwdtransfields.hpp +++ b/tests/init_bwdtransfields.hpp @@ -16,7 +16,7 @@ public: void SetTestCase(const std::vector<BlockAttributes> &blocks, double *inptr, bool padding = true) { - for (auto const &block : fixt_in->GetBlocks()) + for (auto const &block : blocks) { for (size_t el = 0; el < block.num_elements; ++el) { @@ -45,12 +45,12 @@ public: Array<OneD, NekDouble> outphys(fixt_explist->GetTotPoints()); // Set test case - SetTestCase(blocks, incoeffs.get(), false); + SetTestCase(fixt_in->GetBlocks(), incoeffs.get(), false); // Calculate expected result from Nektar++ fixt_explist->BwdTrans(incoeffs, outphys); - // Copy expected result from Array to fixt_expected + // Copy expected result from Array to pointer double *ptr = outphys.get(); for (auto const &block : blocks) { diff --git a/tests/init_diagpreconfields.hpp b/tests/init_diagpreconfields.hpp index 5de28e9..6a96e8d 100644 --- a/tests/init_diagpreconfields.hpp +++ b/tests/init_diagpreconfields.hpp @@ -22,7 +22,7 @@ public: void SetTestCase(const std::vector<BlockAttributes> &blocks, double *inptr, bool padding = true) { - for (auto const &block : fixt_in->GetBlocks()) + for (auto const &block : blocks) { for (size_t el = 0; el < block.num_elements; ++el) { @@ -51,7 +51,7 @@ public: Array<OneD, NekDouble> outcoeffs(fixt_explist->GetNcoeffs(), 0.0); // Set test case - SetTestCase(blocks, incoeffs.get(), false); + SetTestCase(fixt_in->GetBlocks(), incoeffs.get(), false); // Calculate expected result from Nektar++ StdRegions::ConstFactorMap factors; @@ -68,7 +68,7 @@ public: precond->BuildPreconditioner(); precond->DoPreconditioner(incoeffs, outcoeffs, true); - // Copy expected result from Array to fixt_expected + // Copy expected result from Array to pointer double *coeffptr = outcoeffs.get(); for (auto const &block : blocks) { diff --git a/tests/init_dirichletfields.hpp b/tests/init_dirichletfields.hpp index c6fa173..e1ea503 100644 --- a/tests/init_dirichletfields.hpp +++ b/tests/init_dirichletfields.hpp @@ -24,7 +24,7 @@ public: // Calculate expected result from Nektar++ fixt_explist->ImposeDirichletConditions(outcoeffs); - // Copy expected result from Array to fixt_expected + // Copy expected result from Array to pointer double *coeffptr = outcoeffs.get(); for (auto const &block : blocks) { diff --git a/tests/init_fwdtransfields.hpp b/tests/init_fwdtransfields.hpp index 7145a95..ba151f2 100644 --- a/tests/init_fwdtransfields.hpp +++ b/tests/init_fwdtransfields.hpp @@ -34,7 +34,7 @@ public: double *xptr = x.get(), *yptr = y.get(), *zptr = z.get(), *fceptr = fce.get(); - for (auto const &block : fixt_in->GetBlocks()) + for (auto const &block : blocks) { for (size_t el = 0; el < block.num_elements; ++el) { @@ -103,12 +103,12 @@ public: Array<OneD, NekDouble> outcoeffs(fixt_explist->GetNcoeffs(), 0.0); // Set test case - SetTestCase(blocks, inphys.get(), false); + SetTestCase(fixt_in->GetBlocks(), inphys.get(), false); // Calculate expected result from Nektar++ fixt_explist->FwdTrans(inphys, outcoeffs); - // Copy expected result from Array to fixt_expected + // Copy expected result from Array to pointer double *coeffptr = outcoeffs.get(); for (auto const &block : blocks) { diff --git a/tests/init_helmholtzfields.hpp b/tests/init_helmholtzfields.hpp index 8a5644c..ba78e21 100644 --- a/tests/init_helmholtzfields.hpp +++ b/tests/init_helmholtzfields.hpp @@ -17,7 +17,7 @@ public: void SetTestCase(const std::vector<BlockAttributes> &blocks, double *inptr, bool padding = true) { - for (auto const &block : fixt_in->GetBlocks()) + for (auto const &block : blocks) { for (size_t el = 0; el < block.num_elements; ++el) { @@ -47,7 +47,7 @@ public: Array<OneD, NekDouble> tmp; // Set test case - SetTestCase(blocks, incoeffs.get(), false); + SetTestCase(fixt_in->GetBlocks(), incoeffs.get(), false); // Calculate expected result from Nektar++ auto e = 0, offset = 0; @@ -69,7 +69,7 @@ public: } } - // Copy expected result from Array to fixt_expected + // Copy expected result from Array to pointer double *coeffptr = outcoeffs.get(); for (auto const &block : blocks) { diff --git a/tests/init_helmsolvefields.hpp b/tests/init_helmsolvefields.hpp index ec37467..3303408 100644 --- a/tests/init_helmsolvefields.hpp +++ b/tests/init_helmsolvefields.hpp @@ -33,7 +33,7 @@ public: double *xptr = x.get(), *yptr = y.get(), *zptr = z.get(), *fceptr = fce.get(); - for (auto const &block : fixt_in->GetBlocks()) + for (auto const &block : blocks) { for (size_t el = 0; el < block.num_elements; ++el) { @@ -102,7 +102,7 @@ public: Array<OneD, NekDouble> outcoeffs(fixt_explist->GetNcoeffs(), 0.0); // Set test case - SetTestCase(blocks, inphys.get(), false); + SetTestCase(fixt_in->GetBlocks(), inphys.get(), false); // Calculate expected result from Nektar++ StdRegions::ConstFactorMap factors; @@ -112,7 +112,7 @@ public: : 1.0; fixt_explist->HelmSolve(inphys, outcoeffs, factors); - // Copy expected result from Array to fixt_expected + // Copy expected result from Array to pointer double *coeffptr = outcoeffs.get(); for (auto const &block : blocks) { diff --git a/tests/init_identitycoefffields.hpp b/tests/init_identitycoefffields.hpp index d61981f..704ffe7 100644 --- a/tests/init_identitycoefffields.hpp +++ b/tests/init_identitycoefffields.hpp @@ -16,7 +16,7 @@ public: void SetTestCase(const std::vector<BlockAttributes> &blocks, double *inptr, bool padding = true) { - for (auto const &block : fixt_in->GetBlocks()) + for (auto const &block : blocks) { for (size_t el = 0; el < block.num_elements; ++el) { @@ -41,8 +41,8 @@ public: void ExpectedSolution(const std::vector<BlockAttributes> &blocks, double *inptr) { - // Copy expected result to fixt_expected - SetTestCase(blocks, fixt_expected->GetStorage().GetCPUPtr()); + // Copy expected result to pointer + SetTestCase(blocks, inptr); } }; diff --git a/tests/init_identityphysfields.hpp b/tests/init_identityphysfields.hpp index 59262fd..03d9d78 100644 --- a/tests/init_identityphysfields.hpp +++ b/tests/init_identityphysfields.hpp @@ -16,7 +16,7 @@ public: void SetTestCase(const std::vector<BlockAttributes> &blocks, double *inptr, bool padding = true) { - for (auto const &block : fixt_in->GetBlocks()) + for (auto const &block : blocks) { for (size_t el = 0; el < block.num_elements; ++el) { @@ -41,8 +41,8 @@ public: void ExpectedSolution(const std::vector<BlockAttributes> &blocks, double *inptr) { - // Copy expected result to fixt_expected - SetTestCase(blocks, fixt_expected->GetStorage().GetCPUPtr()); + // Copy expected result to pojnter + SetTestCase(blocks, inptr); } }; diff --git a/tests/init_ipwrtbasefields.hpp b/tests/init_ipwrtbasefields.hpp index 71de7bc..1524174 100644 --- a/tests/init_ipwrtbasefields.hpp +++ b/tests/init_ipwrtbasefields.hpp @@ -17,7 +17,7 @@ public: void SetTestCase(const std::vector<BlockAttributes> &blocks, double *inptr, bool padding = true) { - for (auto const &block : fixt_in->GetBlocks()) + for (auto const &block : blocks) { for (size_t el = 0; el < block.num_elements; ++el) { @@ -46,12 +46,12 @@ public: Array<OneD, NekDouble> outcoeffs(fixt_explist->GetNcoeffs()); // Set test case - SetTestCase(blocks, inphys.get(), false); + SetTestCase(fixt_in->GetBlocks(), inphys.get(), false); // Calculate expected result from Nektar++ fixt_explist->IProductWRTBase(inphys, outcoeffs); - // Copy expected result from Array to fixt_expected + // Copy expected result from Array to pointer double *ptr = outcoeffs.get(); for (auto const &block : blocks) { diff --git a/tests/init_ipwrtderivbasefields.hpp b/tests/init_ipwrtderivbasefields.hpp index 4c29717..3ee889c 100644 --- a/tests/init_ipwrtderivbasefields.hpp +++ b/tests/init_ipwrtderivbasefields.hpp @@ -19,7 +19,7 @@ public: { for (size_t k = 0; k < fixt_explist->GetCoordim(0); k++) { - for (auto const &block : fixt_in->GetBlocks()) + for (auto const &block : blocks) { for (size_t el = 0; el < block.num_elements; ++el) { @@ -50,7 +50,7 @@ public: Array<OneD, NekDouble> outcoeffs(fixt_explist->GetNcoeffs(), 0.0); // Set test case - SetTestCase(blocks, inphys.get(), false); + SetTestCase(fixt_in->GetBlocks(), inphys.get(), false); // Calculate expected result from Nektar++ Array<OneD, Array<OneD, NekDouble>> inphysarray( @@ -69,7 +69,7 @@ public: } fixt_explist->IProductWRTDerivBase(inphysarray, outcoeffs); - // Copy expected result from Array to fixt_expected + // Copy expected result from Array to pointer double *ptr = outcoeffs.get(); for (auto const &block : blocks) { diff --git a/tests/init_massfields.hpp b/tests/init_massfields.hpp index 0d8bb8e..ae6cb72 100644 --- a/tests/init_massfields.hpp +++ b/tests/init_massfields.hpp @@ -16,7 +16,7 @@ public: void SetTestCase(const std::vector<BlockAttributes> &blocks, double *inptr, bool padding = true) { - for (auto const &block : fixt_in->GetBlocks()) + for (auto const &block : blocks) { for (size_t el = 0; el < block.num_elements; ++el) { @@ -46,13 +46,13 @@ public: Array<OneD, NekDouble> outcoeffs(fixt_explist->GetNcoeffs()); // Set test case - SetTestCase(blocks, incoeffs.get(), false); + SetTestCase(fixt_in->GetBlocks(), incoeffs.get(), false); // Calculate expected result from Nektar++ fixt_explist->BwdTrans(incoeffs, bwdtrans); fixt_explist->IProductWRTBase(bwdtrans, outcoeffs); - // Copy expected result from Array to fixt_expected + // Copy expected result from Array to pointer double *coeffptr = outcoeffs.get(); for (auto const &block : blocks) { diff --git a/tests/init_nullpreconfields.hpp b/tests/init_nullpreconfields.hpp index 20ff840..80a6633 100644 --- a/tests/init_nullpreconfields.hpp +++ b/tests/init_nullpreconfields.hpp @@ -22,7 +22,7 @@ public: void SetTestCase(const std::vector<BlockAttributes> &blocks, double *inptr, bool padding = true) { - for (auto const &block : fixt_in->GetBlocks()) + for (auto const &block : blocks) { for (size_t el = 0; el < block.num_elements; ++el) { @@ -51,7 +51,7 @@ public: Array<OneD, NekDouble> outcoeffs(fixt_explist->GetNcoeffs(), 0.0); // Set test case - SetTestCase(blocks, incoeffs.get(), false); + SetTestCase(fixt_in->GetBlocks(), incoeffs.get(), false); // Calculate expected result from Nektar++ auto map = fixt_explist->GetLocalToGlobalMap(); @@ -62,7 +62,7 @@ public: GetPreconFactory().CreateInstance("Null", globalSys, map); precond->DoPreconditioner(incoeffs, outcoeffs, true); - // Copy expected result from Array to fixt_expected + // Copy expected result from Array to pointer double *coeffptr = outcoeffs.get(); for (auto const &block : blocks) { diff --git a/tests/init_physderivfields.hpp b/tests/init_physderivfields.hpp index f59c2e6..5adeb60 100644 --- a/tests/init_physderivfields.hpp +++ b/tests/init_physderivfields.hpp @@ -66,12 +66,12 @@ public: Array<OneD, NekDouble> outphys2 = NullNekDouble1DArray; // Set test case - SetTestCase(blocks, inphys.get(), false); + SetTestCase(fixt_in->GetBlocks(), inphys.get(), false); // Calculate expected result from Nektar++ fixt_explist->PhysDeriv(inphys, outphys0, outphys1, outphys2); - // Copy expected result from Array to fixt_expected + // Copy expected result from Array to pointer double *ptr = outphys.get(); for (auto const &block : blocks) { @@ -182,7 +182,7 @@ public: Array<OneD, NekDouble> outphys2 = NullNekDouble1DArray; // Set test case - SetTestCase(blocks, inphys.get(), false); + SetTestCase(fixt_in->GetBlocks(), inphys.get(), false); // Calculate expected result from Nektar++ fixt_explist->PhysDeriv(inphys, outphys0, outphys1, outphys2); @@ -326,7 +326,7 @@ public: outphys1 + fixt_explist->GetTotPoints(); // Set test case - SetTestCase(blocks, inphys.get(), false); + SetTestCase(fixt_in->GetBlocks(), inphys.get(), false); // Calculate expected result from Nektar++ fixt_explist->PhysDeriv(inphys, outphys0, outphys1, outphys2); diff --git a/tests/test_assmbscatrcuda.cpp b/tests/test_assmbscatrcuda.cpp index 13768c4..42f5f6c 100644 --- a/tests/test_assmbscatrcuda.cpp +++ b/tests/test_assmbscatrcuda.cpp @@ -24,8 +24,9 @@ BOOST_FIXTURE_TEST_CASE(assmbscatrcuda_seg, Seg) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -42,8 +43,9 @@ BOOST_FIXTURE_TEST_CASE(assmbscatrcuda_quad, Quad) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -60,8 +62,9 @@ BOOST_FIXTURE_TEST_CASE(assmbscatrcuda_tri, Tri) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -78,8 +81,9 @@ BOOST_FIXTURE_TEST_CASE(assmbscatrcuda_square_all_elements, SquareAllElements) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -96,8 +100,9 @@ BOOST_FIXTURE_TEST_CASE(assmbscatrcuda_hex, Hex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -114,8 +119,9 @@ BOOST_FIXTURE_TEST_CASE(assmbscatrcuda_prism, Prism) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -132,8 +138,9 @@ BOOST_FIXTURE_TEST_CASE(assmbscatrcuda_pyr, Pyr) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -150,8 +157,9 @@ BOOST_FIXTURE_TEST_CASE(assmbscatrcuda_tet, Tet) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -168,8 +176,9 @@ BOOST_FIXTURE_TEST_CASE(assmbscatrcuda_cube_prism_hex, CubePrismHex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -186,8 +195,9 @@ BOOST_FIXTURE_TEST_CASE(assmbscatrcuda_cube_all_elements, CubeAllElements) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } diff --git a/tests/test_bwdtranscuda.cpp b/tests/test_bwdtranscuda.cpp index 60a10b9..da83b92 100644 --- a/tests/test_bwdtranscuda.cpp +++ b/tests/test_bwdtranscuda.cpp @@ -24,8 +24,9 @@ BOOST_FIXTURE_TEST_CASE(bwdtranscuda_seg, Seg) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -42,8 +43,9 @@ BOOST_FIXTURE_TEST_CASE(bwdtranscuda_quad, Quad) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -60,8 +62,9 @@ BOOST_FIXTURE_TEST_CASE(bwdtranscuda_tri, Tri) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -78,8 +81,9 @@ BOOST_FIXTURE_TEST_CASE(bwdtranscuda_square_all_elements, SquareAllElements) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -96,8 +100,9 @@ BOOST_FIXTURE_TEST_CASE(bwdtranscuda_hex, Hex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -114,8 +119,9 @@ BOOST_FIXTURE_TEST_CASE(bwdtranscuda_prism, Prism) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -132,8 +138,9 @@ BOOST_FIXTURE_TEST_CASE(bwdtranscuda_pyr, Pyr) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -150,8 +157,9 @@ BOOST_FIXTURE_TEST_CASE(bwdtranscuda_tet, Tet) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -168,8 +176,9 @@ BOOST_FIXTURE_TEST_CASE(bwdtranscuda_cube_prism_hex, CubePrismHex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -186,8 +195,9 @@ BOOST_FIXTURE_TEST_CASE(bwdtranscuda_cube_all_elements, CubeAllElements) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } diff --git a/tests/test_diagpreconcuda.cpp b/tests/test_diagpreconcuda.cpp index df15cfa..f48d748 100644 --- a/tests/test_diagpreconcuda.cpp +++ b/tests/test_diagpreconcuda.cpp @@ -15,8 +15,10 @@ BOOST_AUTO_TEST_SUITE(TestDiagPreconCUDA) BOOST_FIXTURE_TEST_CASE(diagpreconcuda_seg, Helmholtz1D_Seg) { Configure(); - SetTestCase(fixtcuda_in->GetBlocks(), fixtcuda_in->GetStorage().GetCPUPtr()); - auto HelmholtzOp = Helmholtz<>::create(fixt_explist, "StdMat"); + SetTestCase( + fixtcuda_in->GetBlocks(), + fixtcuda_in->template GetStorage<MemoryRegionCUDA>().GetCPUPtr()); + auto HelmholtzOp = Helmholtz<>::create(fixt_explist, "CUDA"); auto DiagPreconOp = DiagPrecon<>::create(fixt_explist, "CUDA"); HelmholtzOp->setLambda(1.0); DiagPreconOp->configure(HelmholtzOp); @@ -26,16 +28,19 @@ BOOST_FIXTURE_TEST_CASE(diagpreconcuda_seg, Helmholtz1D_Seg) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } BOOST_FIXTURE_TEST_CASE(diagpreconcuda_tri_quad, Helmholtz2D_Tri_Quad) { Configure(); - SetTestCase(fixtcuda_in->GetBlocks(), fixtcuda_in->GetStorage().GetCPUPtr()); - auto HelmholtzOp = Helmholtz<>::create(fixt_explist, "StdMat"); + SetTestCase( + fixtcuda_in->GetBlocks(), + fixtcuda_in->template GetStorage<MemoryRegionCUDA>().GetCPUPtr()); + auto HelmholtzOp = Helmholtz<>::create(fixt_explist, "CUDA"); auto DiagPreconOp = DiagPrecon<>::create(fixt_explist, "CUDA"); HelmholtzOp->setLambda(1.0); DiagPreconOp->configure(HelmholtzOp); @@ -45,16 +50,19 @@ BOOST_FIXTURE_TEST_CASE(diagpreconcuda_tri_quad, Helmholtz2D_Tri_Quad) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } BOOST_FIXTURE_TEST_CASE(diagpreconcuda_hex, Helmholtz3D_Hex) { Configure(); - SetTestCase(fixtcuda_in->GetBlocks(), fixtcuda_in->GetStorage().GetCPUPtr()); - auto HelmholtzOp = Helmholtz<>::create(fixt_explist, "StdMat"); + SetTestCase( + fixtcuda_in->GetBlocks(), + fixtcuda_in->template GetStorage<MemoryRegionCUDA>().GetCPUPtr()); + auto HelmholtzOp = Helmholtz<>::create(fixt_explist, "CUDA"); auto DiagPreconOp = DiagPrecon<>::create(fixt_explist, "CUDA"); HelmholtzOp->setLambda(1.0); DiagPreconOp->configure(HelmholtzOp); @@ -64,16 +72,19 @@ BOOST_FIXTURE_TEST_CASE(diagpreconcuda_hex, Helmholtz3D_Hex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-10)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); } } BOOST_FIXTURE_TEST_CASE(diagpreconcuda_prism, Helmholtz3D_Prism) { Configure(); - SetTestCase(fixtcuda_in->GetBlocks(), fixtcuda_in->GetStorage().GetCPUPtr()); - auto HelmholtzOp = Helmholtz<>::create(fixt_explist, "StdMat"); + SetTestCase( + fixtcuda_in->GetBlocks(), + fixtcuda_in->template GetStorage<MemoryRegionCUDA>().GetCPUPtr()); + auto HelmholtzOp = Helmholtz<>::create(fixt_explist, "CUDA"); auto DiagPreconOp = DiagPrecon<>::create(fixt_explist, "CUDA"); HelmholtzOp->setLambda(1.0); DiagPreconOp->configure(HelmholtzOp); @@ -83,16 +94,19 @@ BOOST_FIXTURE_TEST_CASE(diagpreconcuda_prism, Helmholtz3D_Prism) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-10)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); } } BOOST_FIXTURE_TEST_CASE(diagpreconcuda_pyr, Helmholtz3D_Pyr) { Configure(); - SetTestCase(fixtcuda_in->GetBlocks(), fixtcuda_in->GetStorage().GetCPUPtr()); - auto HelmholtzOp = Helmholtz<>::create(fixt_explist, "StdMat"); + SetTestCase( + fixtcuda_in->GetBlocks(), + fixtcuda_in->template GetStorage<MemoryRegionCUDA>().GetCPUPtr()); + auto HelmholtzOp = Helmholtz<>::create(fixt_explist, "CUDA"); auto DiagPreconOp = DiagPrecon<>::create(fixt_explist, "CUDA"); HelmholtzOp->setLambda(1.0); DiagPreconOp->configure(HelmholtzOp); @@ -102,16 +116,19 @@ BOOST_FIXTURE_TEST_CASE(diagpreconcuda_pyr, Helmholtz3D_Pyr) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-10)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); } } -BOOST_FIXTURE_TEST_CASE(diagpreconcuda_tet, Helmholtz3D_Tet) +/*BOOST_FIXTURE_TEST_CASE(diagpreconcuda_tet, Helmholtz3D_Tet) { Configure(); - SetTestCase(fixtcuda_in->GetBlocks(), fixtcuda_in->GetStorage().GetCPUPtr()); - auto HelmholtzOp = Helmholtz<>::create(fixt_explist, "StdMat"); + SetTestCase( + fixtcuda_in->GetBlocks(), + fixtcuda_in->template GetStorage<MemoryRegionCUDA>().GetCPUPtr()); + auto HelmholtzOp = Helmholtz<>::create(fixt_explist, "CUDA"); auto DiagPreconOp = DiagPrecon<>::create(fixt_explist, "CUDA"); HelmholtzOp->setLambda(1.0); DiagPreconOp->configure(HelmholtzOp); @@ -121,9 +138,10 @@ BOOST_FIXTURE_TEST_CASE(diagpreconcuda_tet, Helmholtz3D_Tet) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-10)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); } -} +}*/ BOOST_AUTO_TEST_SUITE_END() diff --git a/tests/test_dirichletcuda.cpp b/tests/test_dirichletcuda.cpp index 9778d3a..cc03697 100644 --- a/tests/test_dirichletcuda.cpp +++ b/tests/test_dirichletcuda.cpp @@ -9,7 +9,7 @@ #include "Operators/OperatorDirBndCond.hpp" #include "init_dirichletfields.hpp" -BOOST_AUTO_TEST_SUITE(TestDirichlet) +BOOST_AUTO_TEST_SUITE(TestDirichletCUDA) BOOST_FIXTURE_TEST_CASE(dirichlet1dcuda_seg, Helmholtz1D_Seg) { @@ -21,8 +21,9 @@ BOOST_FIXTURE_TEST_CASE(dirichlet1dcuda_seg, Helmholtz1D_Seg) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -36,8 +37,9 @@ BOOST_FIXTURE_TEST_CASE(dirichlet2dcuda_tri_quad, Helmholtz2D_Tri_Quad) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -51,8 +53,9 @@ BOOST_FIXTURE_TEST_CASE(dirichlet3dcuda_hex, Helmholtz3D_Hex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -66,8 +69,9 @@ BOOST_FIXTURE_TEST_CASE(dirichlet3dcuda_prism, Helmholtz3D_Prism) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -81,8 +85,9 @@ BOOST_FIXTURE_TEST_CASE(dirichlet3dcuda_pyr, Helmholtz3D_Pyr) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -96,8 +101,9 @@ BOOST_FIXTURE_TEST_CASE(dirichlet3dcuda_tet, Helmholtz3D_Tet) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } diff --git a/tests/test_fwdtrans.cpp b/tests/test_fwdtrans.cpp index 2d2af43..d0f7b42 100644 --- a/tests/test_fwdtrans.cpp +++ b/tests/test_fwdtrans.cpp @@ -12,11 +12,6 @@ BOOST_AUTO_TEST_SUITE(TestFwdTrans) -using namespace std; -using namespace Nektar::Operators; -using namespace Nektar::LibUtilities; -using namespace Nektar; - BOOST_FIXTURE_TEST_CASE(fwdtrans_seg, Helmholtz1D_Seg) { Configure(); diff --git a/tests/test_helmholtzcuda.cpp b/tests/test_helmholtzcuda.cpp index 197b8b7..afa0d12 100644 --- a/tests/test_helmholtzcuda.cpp +++ b/tests/test_helmholtzcuda.cpp @@ -25,8 +25,9 @@ BOOST_FIXTURE_TEST_CASE(helmholtzcuda_seg, Seg) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -44,8 +45,9 @@ BOOST_FIXTURE_TEST_CASE(helmholtzcuda_quad, Quad) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -63,8 +65,9 @@ BOOST_FIXTURE_TEST_CASE(helmholtzcuda_tri, Tri) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -82,8 +85,9 @@ BOOST_FIXTURE_TEST_CASE(helmholtzcuda_square_all_elements, SquareAllElements) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -101,8 +105,9 @@ BOOST_FIXTURE_TEST_CASE(helmholtzcuda_hex, Hex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -120,8 +125,9 @@ BOOST_FIXTURE_TEST_CASE(helmholtzcuda_prism, Prism) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -139,8 +145,9 @@ BOOST_FIXTURE_TEST_CASE(helmholtzcuda_pyr, Pyr) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -158,8 +165,9 @@ BOOST_FIXTURE_TEST_CASE(helmholtzcuda_tet, Tet) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -177,8 +185,9 @@ BOOST_FIXTURE_TEST_CASE(helmholtzcuda_cube_prism_hex, CubePrismHex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -196,8 +205,9 @@ BOOST_FIXTURE_TEST_CASE(helmholtzcuda_cube_all_elements, CubeAllElements) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } diff --git a/tests/test_helmsolve.cpp b/tests/test_helmsolve.cpp index ea4880e..d5f07ef 100644 --- a/tests/test_helmsolve.cpp +++ b/tests/test_helmsolve.cpp @@ -12,11 +12,6 @@ BOOST_AUTO_TEST_SUITE(TestHelmSolve) -using namespace std; -using namespace Nektar::Operators; -using namespace Nektar::LibUtilities; -using namespace Nektar; - BOOST_FIXTURE_TEST_CASE(helmsolve_seg, Helmholtz1D_Seg) { Configure(); diff --git a/tests/test_identitycoeffcuda.cpp b/tests/test_identitycoeffcuda.cpp index 8a0d311..d8bd963 100644 --- a/tests/test_identitycoeffcuda.cpp +++ b/tests/test_identitycoeffcuda.cpp @@ -24,8 +24,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_seg, Seg) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -42,8 +43,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_quad, Quad) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -60,8 +62,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_tri, Tri) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -78,8 +81,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_square_all_elements, SquareAllElements) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -96,8 +100,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_hex, Hex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -114,8 +119,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_prism, Prism) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -132,8 +138,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_pyr, Pyr) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -150,8 +157,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_tet, Tet) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -168,8 +176,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_cube_prism_hex, CubePrismHex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -186,8 +195,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_cube_all_elements, CubeAllElements) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } diff --git a/tests/test_identityphyscuda.cpp b/tests/test_identityphyscuda.cpp index 1780fcb..ed6823c 100644 --- a/tests/test_identityphyscuda.cpp +++ b/tests/test_identityphyscuda.cpp @@ -24,8 +24,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_seg, Seg) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -42,8 +43,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_quad, Quad) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -60,8 +62,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_tri, Tri) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -78,8 +81,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_square_all_elements, SquareAllElements) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -96,8 +100,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_hex, Hex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -114,8 +119,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_prism, Prism) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -132,8 +138,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_pyr, Pyr) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -150,8 +157,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_tet, Tet) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -168,8 +176,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_cube_prism_hex, CubePrismHex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -186,8 +195,9 @@ BOOST_FIXTURE_TEST_CASE(identitycuda_cube_all_elements, CubeAllElements) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } diff --git a/tests/test_ipwrtbasecuda.cpp b/tests/test_ipwrtbasecuda.cpp index e315b3a..2d18586 100644 --- a/tests/test_ipwrtbasecuda.cpp +++ b/tests/test_ipwrtbasecuda.cpp @@ -25,8 +25,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtbasecuda_seg, Seg) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -44,8 +45,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtbasecuda_quad, Quad) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -63,8 +65,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtbasecuda_tri, Tri) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -82,8 +85,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtbasecuda_square_all_elements, SquareAllElements) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -101,8 +105,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtbasecuda_hex, Hex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -120,8 +125,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtbasecuda_prism, Prism) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -139,8 +145,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtbasecuda_pyr, Pyr) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -158,8 +165,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtbasecuda_tet, Tet) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -177,8 +185,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtbasecuda_cube_prism_hex, CubePrismHex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -196,8 +205,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtbasecuda_cube_all_elements, CubeAllElements) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } diff --git a/tests/test_ipwrtderivbasecuda.cpp b/tests/test_ipwrtderivbasecuda.cpp index 55261b9..efe3fa6 100644 --- a/tests/test_ipwrtderivbasecuda.cpp +++ b/tests/test_ipwrtderivbasecuda.cpp @@ -25,8 +25,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtderivbasecuda_seg, Seg) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -44,8 +45,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtderivbasecuda_quad, Quad) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -63,8 +65,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtderivbasecuda_tri, Tri) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -83,8 +86,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtderivbasecuda_square_all_elements, BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -102,8 +106,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtderivbasecuda_hex, Hex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -121,8 +126,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtderivbasecuda_prism, Prism) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -140,8 +146,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtderivbasecuda_pyr, Pyr) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -159,8 +166,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtderivbasecuda_tet, Tet) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -178,8 +186,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtderivbasecuda_cube_prism_hex, CubePrismHex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -197,8 +206,9 @@ BOOST_FIXTURE_TEST_CASE(ipwrtderivbasecuda_cube_all_elements, CubeAllElements) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } diff --git a/tests/test_masscuda.cpp b/tests/test_masscuda.cpp index 4182592..a48828c 100644 --- a/tests/test_masscuda.cpp +++ b/tests/test_masscuda.cpp @@ -14,150 +14,180 @@ BOOST_AUTO_TEST_SUITE(TestMassCUDA) BOOST_FIXTURE_TEST_CASE(masscuda_seg, Seg) { Configure(); - SetTestCase(fixt_in->GetBlocks(), fixt_in->GetStorage().GetCPUPtr()); - Mass<>::create(fixt_explist, "CUDA")->apply(*fixt_in, *fixt_out); + SetTestCase( + fixtcuda_in->GetBlocks(), + fixtcuda_in->template GetStorage<MemoryRegionCUDA>().GetCPUPtr()); + Mass<>::create(fixt_explist, "CUDA")->apply(*fixtcuda_in, *fixtcuda_out); ExpectedSolution(fixt_expected->GetBlocks(), fixt_expected->GetStorage().GetCPUPtr()); - BOOST_TEST(fixt_out->compare(*fixt_expected, 1.0E-12)); + BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixt_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } BOOST_FIXTURE_TEST_CASE(masscuda_quad, Quad) { Configure(); - SetTestCase(fixt_in->GetBlocks(), fixt_in->GetStorage().GetCPUPtr()); - Mass<>::create(fixt_explist, "CUDA")->apply(*fixt_in, *fixt_out); + SetTestCase( + fixtcuda_in->GetBlocks(), + fixtcuda_in->template GetStorage<MemoryRegionCUDA>().GetCPUPtr()); + Mass<>::create(fixt_explist, "CUDA")->apply(*fixtcuda_in, *fixtcuda_out); ExpectedSolution(fixt_expected->GetBlocks(), fixt_expected->GetStorage().GetCPUPtr()); - BOOST_TEST(fixt_out->compare(*fixt_expected, 1.0E-12)); + BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixt_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } BOOST_FIXTURE_TEST_CASE(masscuda_tri, Tri) { Configure(); - SetTestCase(fixt_in->GetBlocks(), fixt_in->GetStorage().GetCPUPtr()); - Mass<>::create(fixt_explist, "CUDA")->apply(*fixt_in, *fixt_out); + SetTestCase( + fixtcuda_in->GetBlocks(), + fixtcuda_in->template GetStorage<MemoryRegionCUDA>().GetCPUPtr()); + Mass<>::create(fixt_explist, "CUDA")->apply(*fixtcuda_in, *fixtcuda_out); ExpectedSolution(fixt_expected->GetBlocks(), fixt_expected->GetStorage().GetCPUPtr()); - BOOST_TEST(fixt_out->compare(*fixt_expected, 1.0E-12)); + BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixt_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } BOOST_FIXTURE_TEST_CASE(masscuda_square_all_elements, SquareAllElements) { Configure(); - SetTestCase(fixt_in->GetBlocks(), fixt_in->GetStorage().GetCPUPtr()); - Mass<>::create(fixt_explist, "CUDA")->apply(*fixt_in, *fixt_out); + SetTestCase( + fixtcuda_in->GetBlocks(), + fixtcuda_in->template GetStorage<MemoryRegionCUDA>().GetCPUPtr()); + Mass<>::create(fixt_explist, "CUDA")->apply(*fixtcuda_in, *fixtcuda_out); ExpectedSolution(fixt_expected->GetBlocks(), fixt_expected->GetStorage().GetCPUPtr()); - BOOST_TEST(fixt_out->compare(*fixt_expected, 1.0E-12)); + BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixt_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } BOOST_FIXTURE_TEST_CASE(masscuda_hex, Hex) { Configure(); - SetTestCase(fixt_in->GetBlocks(), fixt_in->GetStorage().GetCPUPtr()); - Mass<>::create(fixt_explist, "CUDA")->apply(*fixt_in, *fixt_out); + SetTestCase( + fixtcuda_in->GetBlocks(), + fixtcuda_in->template GetStorage<MemoryRegionCUDA>().GetCPUPtr()); + Mass<>::create(fixt_explist, "CUDA")->apply(*fixtcuda_in, *fixtcuda_out); ExpectedSolution(fixt_expected->GetBlocks(), fixt_expected->GetStorage().GetCPUPtr()); - BOOST_TEST(fixt_out->compare(*fixt_expected, 1.0E-12)); + BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixt_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } BOOST_FIXTURE_TEST_CASE(masscuda_prism, Prism) { Configure(); - SetTestCase(fixt_in->GetBlocks(), fixt_in->GetStorage().GetCPUPtr()); - Mass<>::create(fixt_explist, "CUDA")->apply(*fixt_in, *fixt_out); + SetTestCase( + fixtcuda_in->GetBlocks(), + fixtcuda_in->template GetStorage<MemoryRegionCUDA>().GetCPUPtr()); + Mass<>::create(fixt_explist, "CUDA")->apply(*fixtcuda_in, *fixtcuda_out); ExpectedSolution(fixt_expected->GetBlocks(), fixt_expected->GetStorage().GetCPUPtr()); - BOOST_TEST(fixt_out->compare(*fixt_expected, 1.0E-12)); + BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixt_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } BOOST_FIXTURE_TEST_CASE(masscuda_pyr, Pyr) { Configure(); - SetTestCase(fixt_in->GetBlocks(), fixt_in->GetStorage().GetCPUPtr()); - Mass<>::create(fixt_explist, "CUDA")->apply(*fixt_in, *fixt_out); + SetTestCase( + fixtcuda_in->GetBlocks(), + fixtcuda_in->template GetStorage<MemoryRegionCUDA>().GetCPUPtr()); + Mass<>::create(fixt_explist, "CUDA")->apply(*fixtcuda_in, *fixtcuda_out); ExpectedSolution(fixt_expected->GetBlocks(), fixt_expected->GetStorage().GetCPUPtr()); - BOOST_TEST(fixt_out->compare(*fixt_expected, 1.0E-12)); + BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixt_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } BOOST_FIXTURE_TEST_CASE(masscuda_tet, Tet) { Configure(); - SetTestCase(fixt_in->GetBlocks(), fixt_in->GetStorage().GetCPUPtr()); - Mass<>::create(fixt_explist, "CUDA")->apply(*fixt_in, *fixt_out); + SetTestCase( + fixtcuda_in->GetBlocks(), + fixtcuda_in->template GetStorage<MemoryRegionCUDA>().GetCPUPtr()); + Mass<>::create(fixt_explist, "CUDA")->apply(*fixtcuda_in, *fixtcuda_out); ExpectedSolution(fixt_expected->GetBlocks(), fixt_expected->GetStorage().GetCPUPtr()); - BOOST_TEST(fixt_out->compare(*fixt_expected, 1.0E-12)); + BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixt_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } BOOST_FIXTURE_TEST_CASE(masscuda_cube_prism_hex, CubePrismHex) { Configure(); - SetTestCase(fixt_in->GetBlocks(), fixt_in->GetStorage().GetCPUPtr()); - Mass<>::create(fixt_explist, "CUDA")->apply(*fixt_in, *fixt_out); + SetTestCase( + fixtcuda_in->GetBlocks(), + fixtcuda_in->template GetStorage<MemoryRegionCUDA>().GetCPUPtr()); + Mass<>::create(fixt_explist, "CUDA")->apply(*fixtcuda_in, *fixtcuda_out); ExpectedSolution(fixt_expected->GetBlocks(), fixt_expected->GetStorage().GetCPUPtr()); - BOOST_TEST(fixt_out->compare(*fixt_expected, 1.0E-12)); + BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixt_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } BOOST_FIXTURE_TEST_CASE(masscuda_cube_all_elements, CubeAllElements) { Configure(); - SetTestCase(fixt_in->GetBlocks(), fixt_in->GetStorage().GetCPUPtr()); - Mass<>::create(fixt_explist, "CUDA")->apply(*fixt_in, *fixt_out); + SetTestCase( + fixtcuda_in->GetBlocks(), + fixtcuda_in->template GetStorage<MemoryRegionCUDA>().GetCPUPtr()); + Mass<>::create(fixt_explist, "CUDA")->apply(*fixtcuda_in, *fixtcuda_out); ExpectedSolution(fixt_expected->GetBlocks(), fixt_expected->GetStorage().GetCPUPtr()); - BOOST_TEST(fixt_out->compare(*fixt_expected, 1.0E-12)); + BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixt_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } diff --git a/tests/test_neumanncuda.cpp b/tests/test_neumanncuda.cpp index 3305146..1bde942 100644 --- a/tests/test_neumanncuda.cpp +++ b/tests/test_neumanncuda.cpp @@ -19,8 +19,9 @@ BOOST_FIXTURE_TEST_CASE(dirichlet1dcuda_seg, Helmholtz1D_Seg) BOOST_TEST(fixtcuda_out->compare(*fixt_out, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_out->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_out->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -32,8 +33,9 @@ BOOST_FIXTURE_TEST_CASE(dirichlet2dcuda_tri_quad, Helmholtz2D_Tri_Quad) BOOST_TEST(fixtcuda_out->compare(*fixt_out, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_out->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_out->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -45,8 +47,9 @@ BOOST_FIXTURE_TEST_CASE(dirichlet3dcuda_hex, Helmholtz3D_Hex) BOOST_TEST(fixtcuda_out->compare(*fixt_out, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_out->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_out->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -58,8 +61,9 @@ BOOST_FIXTURE_TEST_CASE(dirichlet3dcuda_prism, Helmholtz3D_Prism) BOOST_TEST(fixtcuda_out->compare(*fixt_out, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_out->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_out->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -71,8 +75,9 @@ BOOST_FIXTURE_TEST_CASE(dirichlet3dcuda_pyr, Helmholtz3D_Pyr) BOOST_TEST(fixtcuda_out->compare(*fixt_out, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_out->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_out->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -84,8 +89,9 @@ BOOST_FIXTURE_TEST_CASE(dirichlet3dcuda_tet, Helmholtz3D_Tet) BOOST_TEST(fixtcuda_out->compare(*fixt_out, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_out->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_out->GetStorage().GetCPUPtr(), 1.0E-12); } } diff --git a/tests/test_nullpreconcuda.cpp b/tests/test_nullpreconcuda.cpp index 945ad6b..8af17c4 100644 --- a/tests/test_nullpreconcuda.cpp +++ b/tests/test_nullpreconcuda.cpp @@ -11,7 +11,6 @@ BOOST_AUTO_TEST_SUITE(TestNullPreconCUDA) - BOOST_FIXTURE_TEST_CASE(nullpreconcuda_seg, Helmholtz1D_Seg) { Configure(); @@ -25,8 +24,9 @@ BOOST_FIXTURE_TEST_CASE(nullpreconcuda_seg, Helmholtz1D_Seg) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-15)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-15); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-15); } } @@ -43,8 +43,9 @@ BOOST_FIXTURE_TEST_CASE(nullpreconcuda_tri_quad, Helmholtz2D_Tri_Quad) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-15)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-15); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-15); } } @@ -61,8 +62,9 @@ BOOST_FIXTURE_TEST_CASE(nullpreconcuda_hex, Helmholtz3D_Hex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-15)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-15); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-15); } } @@ -79,8 +81,9 @@ BOOST_FIXTURE_TEST_CASE(nullpreconcuda_prism, Helmholtz3D_Prism) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-15)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-15); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-15); } } @@ -97,8 +100,9 @@ BOOST_FIXTURE_TEST_CASE(nullpreconcuda_pyr, Helmholtz3D_Pyr) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-15)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-15); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-15); } } @@ -115,8 +119,9 @@ BOOST_FIXTURE_TEST_CASE(nullpreconcuda_tet, Helmholtz3D_Tet) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-15)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-15); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-15); } } diff --git a/tests/test_physderivcuda.cpp b/tests/test_physderivcuda.cpp index 5cb37c6..54a1604 100644 --- a/tests/test_physderivcuda.cpp +++ b/tests/test_physderivcuda.cpp @@ -24,8 +24,9 @@ BOOST_FIXTURE_TEST_CASE(physderivcuda_seg, Seg) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -42,8 +43,9 @@ BOOST_FIXTURE_TEST_CASE(physderivcuda_quad, Quad) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -60,8 +62,9 @@ BOOST_FIXTURE_TEST_CASE(physderivcuda_tri, Tri) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12); } } @@ -78,8 +81,9 @@ BOOST_FIXTURE_TEST_CASE(physderivcuda_square_all_elements, SquareAllElements) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-12)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); } } @@ -96,8 +100,9 @@ BOOST_FIXTURE_TEST_CASE(physderivcuda_hex, Hex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-10)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); } } @@ -114,8 +119,9 @@ BOOST_FIXTURE_TEST_CASE(physderivcuda_prism, Prism) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-10)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); } } @@ -132,8 +138,9 @@ BOOST_FIXTURE_TEST_CASE(physderivcuda_pyr, Pyr) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-10)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); } } @@ -150,8 +157,9 @@ BOOST_FIXTURE_TEST_CASE(physderivcuda_tet, Tet) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-10)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); } } @@ -168,8 +176,9 @@ BOOST_FIXTURE_TEST_CASE(physderivcuda_cube_prism_hex, CubePrismHex) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-10)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); } } @@ -186,8 +195,9 @@ BOOST_FIXTURE_TEST_CASE(physderivcuda_cube_all_elements, CubeAllElements) BOOST_TEST(fixtcuda_out->compare(*fixt_expected, 1.0E-10)); boost::test_tools::output_test_stream output; { - OutputIfNotMatch(fixtcuda_out->GetStorage().GetCPUPtr(), - fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); + OutputIfNotMatch( + fixtcuda_out->template GetStorage<MemoryRegionCUDA>().GetCPUPtr(), + fixt_expected->GetStorage().GetCPUPtr(), 1.0E-10); } } -- GitLab