From fa02d686d42338ff3a4144bf3a6667210b9f4e4e Mon Sep 17 00:00:00 2001 From: Tobias Meyer Andersen Date: Mon, 13 Jan 2025 11:15:00 +0100 Subject: [PATCH] refactor move_to_gpu --- tests/gpuistl/test_gpuPvt.cu | 10 +++++----- tests/gpuistl/test_gpu_linear_two_phase_material.cu | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/gpuistl/test_gpuPvt.cu b/tests/gpuistl/test_gpuPvt.cu index b1403190d..b830e92c7 100644 --- a/tests/gpuistl/test_gpuPvt.cu +++ b/tests/gpuistl/test_gpuPvt.cu @@ -172,7 +172,7 @@ BOOST_FIXTURE_TEST_CASE(TestEvaluateUniformTabulated2DFunctionOnGpu, Fixture) { Opm::UniformTabulated2DFunction cpuTab(1.0, 6.0, 3, 1.0, 6.0, 2, tabData); // Move data to GPU buffer and create a view for GPU operations - Opm::UniformTabulated2DFunction gpuBufTab = Opm::gpuistl::move_to_gpu(cpuTab); + Opm::UniformTabulated2DFunction gpuBufTab = Opm::gpuistl::copy_to_gpu(cpuTab); GpuTab gpuViewTab = Opm::gpuistl::make_view(gpuBufTab); // Evaluation points on the CPU @@ -204,7 +204,7 @@ BOOST_FIXTURE_TEST_CASE(TestUseCO2OnGpu, Fixture) { // use the CO2 tables to aquire the viscosity at 290[K] and 2e5[Pa] double viscosityReference = Opm::CO2>>::gasViscosity(co2Tables, temp, pressure, true).value(); - GpuBufCo2Tables gpuBufCo2Table = Opm::gpuistl::move_to_gpu, GpuB>(co2Tables); + GpuBufCo2Tables gpuBufCo2Table = Opm::gpuistl::copy_to_gpu, GpuB>(co2Tables); GpuViewCO2Tables gpuViewCo2Table = Opm::gpuistl::make_view(gpuBufCo2Table); gpuComputedResultOnCpu = launchKernelAndRetrieveResult(gpuCO2GasViscosity, gpuViewCo2Table, gpuTemp, gpuPressure); @@ -252,7 +252,7 @@ BOOST_FIXTURE_TEST_CASE(TestBrine_CO2OnGPU, Fixture) { // use the CO2 tables to aquire the viscosity at 290[K] and 2e5[Pa] double viscosity = Opm::CO2>>::gasViscosity(co2Tables, temp, pressure, true).value(); - GpuBufCo2Tables gpuBufCo2Table = Opm::gpuistl::move_to_gpu, GpuB>(co2Tables); + GpuBufCo2Tables gpuBufCo2Table = Opm::gpuistl::copy_to_gpu, GpuB>(co2Tables); GpuViewCO2Tables gpuViewCo2Table = Opm::gpuistl::make_view(gpuBufCo2Table); gpuComputedResultOnCpu = launchKernelAndRetrieveResult(brineCO2GasDiffCoeff, gpuViewCo2Table, gpuTemp, gpuPressure); @@ -268,7 +268,7 @@ BOOST_FIXTURE_TEST_CASE(TestCo2GasPvt, Fixture) { CpuCo2Pvt cpuCo2Pvt(salinities); double internalEnergyReference = cpuCo2Pvt.internalEnergy(1, temp, pressure, Evaluation(0.4), Evaluation(0.0)).value(); - const GpuBufCo2Pvt gpuBufCo2Pvt = Opm::gpuistl::move_to_gpu(cpuCo2Pvt); + const GpuBufCo2Pvt gpuBufCo2Pvt = Opm::gpuistl::copy_to_gpu(cpuCo2Pvt); const auto brineReferenceDensityCPUCopy = gpuBufCo2Pvt.getBrineReferenceDensity().asStdVector(); const GpuViewCo2Pvt gpuViewCo2Pvt = Opm::gpuistl::make_view(gpuBufCo2Pvt); @@ -287,7 +287,7 @@ BOOST_FIXTURE_TEST_CASE(TestBrineCo2Pvt, Fixture) { CpuBrineCo2Pvt cpuBrineCo2Pvt(salinities); double internalEnergyReference = cpuBrineCo2Pvt.internalEnergy(1, temp, pressure, rs, saltConcentration).value(); - const GpuBufBrineCo2Pvt gpuBufBrineCo2Pvt = Opm::gpuistl::move_to_gpu(cpuBrineCo2Pvt); + const GpuBufBrineCo2Pvt gpuBufBrineCo2Pvt = Opm::gpuistl::copy_to_gpu(cpuBrineCo2Pvt); const GpuViewBrineCo2Pvt gpuViewBrineCo2Pvt = Opm::gpuistl::make_view(gpuBufBrineCo2Pvt); // Allocate memory for the result on the GPU diff --git a/tests/gpuistl/test_gpu_linear_two_phase_material.cu b/tests/gpuistl/test_gpu_linear_two_phase_material.cu index ee581d748..5e4fe42af 100644 --- a/tests/gpuistl/test_gpu_linear_two_phase_material.cu +++ b/tests/gpuistl/test_gpu_linear_two_phase_material.cu @@ -73,7 +73,7 @@ BOOST_AUTO_TEST_CASE(TestSimpleInterpolation) cpuParams.setKrnSamples(cx, cy); cpuParams.finalize(); - constGPUBufferParams gpuBufferParams = Opm::gpuistl::move_to_gpu(cpuParams); + constGPUBufferParams gpuBufferParams = Opm::gpuistl::copy_to_gpu(cpuParams); GPUViewParams gpuViewParams = Opm::gpuistl::make_view(gpuBufferParams);