From 0b73f91f95739d0af233330d42097c382cf2f408 Mon Sep 17 00:00:00 2001 From: Tobias Meyer Andersen Date: Mon, 13 Jan 2025 11:14:29 +0100 Subject: [PATCH] refactor move_to_gpu --- opm/material/common/UniformTabulated2DFunction.hpp | 2 +- opm/material/components/CO2Tables.hpp | 6 +++--- .../PiecewiseLinearTwoPhaseMaterialParams.hpp | 4 ++-- opm/material/fluidsystems/blackoilpvt/BrineCo2Pvt.hpp | 4 ++-- opm/material/fluidsystems/blackoilpvt/Co2GasPvt.hpp | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/opm/material/common/UniformTabulated2DFunction.hpp b/opm/material/common/UniformTabulated2DFunction.hpp index dc3e331c732..49af27519a3 100644 --- a/opm/material/common/UniformTabulated2DFunction.hpp +++ b/opm/material/common/UniformTabulated2DFunction.hpp @@ -326,7 +326,7 @@ class UniformTabulated2DFunction namespace Opm::gpuistl{ template UniformTabulated2DFunction - move_to_gpu(const UniformTabulated2DFunction& tab){ + copy_to_gpu(const UniformTabulated2DFunction& tab){ return UniformTabulated2DFunction(tab.xMin(), tab.xMax(), tab.numX(), tab.yMin(), tab.yMax(), tab.numY(), GPUContainer(tab.samples())); } diff --git a/opm/material/components/CO2Tables.hpp b/opm/material/components/CO2Tables.hpp index 90c33d3f6f8..d9dc5f7ca6c 100644 --- a/opm/material/components/CO2Tables.hpp +++ b/opm/material/components/CO2Tables.hpp @@ -94,10 +94,10 @@ namespace Opm::gpuistl { template CO2Tables - move_to_gpu(const CO2Tables& oldCO2Tables) { + copy_to_gpu(const CO2Tables& oldCO2Tables) { return CO2Tables( - move_to_gpu(oldCO2Tables.getTabulatedEnthalpy()), - move_to_gpu(oldCO2Tables.getTabulatedDensity()) + copy_to_gpu(oldCO2Tables.getTabulatedEnthalpy()), + copy_to_gpu(oldCO2Tables.getTabulatedDensity()) ); } } diff --git a/opm/material/fluidmatrixinteractions/PiecewiseLinearTwoPhaseMaterialParams.hpp b/opm/material/fluidmatrixinteractions/PiecewiseLinearTwoPhaseMaterialParams.hpp index 3ce19070990..eae94229aa4 100644 --- a/opm/material/fluidmatrixinteractions/PiecewiseLinearTwoPhaseMaterialParams.hpp +++ b/opm/material/fluidmatrixinteractions/PiecewiseLinearTwoPhaseMaterialParams.hpp @@ -77,7 +77,7 @@ class PiecewiseLinearTwoPhaseMaterialParams : public EnsureFinalized finalize(); } else{ - // safe if we have a GPU type instantiated by move_to_gpu or make_view + // safe if we have a GPU type instantiated by copy_to_gpu or make_view EnsureFinalized::finalize(); } } @@ -268,7 +268,7 @@ namespace Opm::gpuistl{ /// @param params the parameters object living on the CPU /// @return the GPU PiecewiseLinearTwoPhaseMaterialParams object template -PiecewiseLinearTwoPhaseMaterialParams move_to_gpu(const PiecewiseLinearTwoPhaseMaterialParams& params) { +PiecewiseLinearTwoPhaseMaterialParams copy_to_gpu(const PiecewiseLinearTwoPhaseMaterialParams& params) { // only create the GPU object if the CPU object is finalized params.checkFinalized(); diff --git a/opm/material/fluidsystems/blackoilpvt/BrineCo2Pvt.hpp b/opm/material/fluidsystems/blackoilpvt/BrineCo2Pvt.hpp index d06aa5694d4..e86b25903b7 100644 --- a/opm/material/fluidsystems/blackoilpvt/BrineCo2Pvt.hpp +++ b/opm/material/fluidsystems/blackoilpvt/BrineCo2Pvt.hpp @@ -798,7 +798,7 @@ namespace Opm::gpuistl template BrineCo2Pvt - move_to_gpu(const BrineCo2Pvt& cpuBrineCo2) + copy_to_gpu(const BrineCo2Pvt& cpuBrineCo2) { return BrineCo2Pvt( GPUContainer(cpuBrineCo2.getBrineReferenceDensity()), @@ -807,7 +807,7 @@ namespace Opm::gpuistl cpuBrineCo2.getActivityModel(), cpuBrineCo2.getThermalMixingModelSalt(), cpuBrineCo2.getThermalMixingModelLiquid(), - move_to_gpu, GPUContainer>(cpuBrineCo2.getParams()) + copy_to_gpu, GPUContainer>(cpuBrineCo2.getParams()) ); } diff --git a/opm/material/fluidsystems/blackoilpvt/Co2GasPvt.hpp b/opm/material/fluidsystems/blackoilpvt/Co2GasPvt.hpp index 43547b3a029..b956df25d85 100644 --- a/opm/material/fluidsystems/blackoilpvt/Co2GasPvt.hpp +++ b/opm/material/fluidsystems/blackoilpvt/Co2GasPvt.hpp @@ -451,10 +451,10 @@ class Co2GasPvt namespace Opm::gpuistl{ template Co2GasPvt - move_to_gpu(const Co2GasPvt& cpuCo2) + copy_to_gpu(const Co2GasPvt& cpuCo2) { return Co2GasPvt( - move_to_gpu, GPUContainer>(cpuCo2.getParams()), + copy_to_gpu, GPUContainer>(cpuCo2.getParams()), GPUContainer(cpuCo2.getBrineReferenceDensity()), GPUContainer(cpuCo2.getGasReferenceDensity()), GPUContainer(cpuCo2.getSalinity()),