mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
remove unnecessary template argument
This commit is contained in:
@@ -92,17 +92,17 @@ __global__ void gpuEvaluateUniformTabulated2DFunction(GpuTab gpuTab, Evaluation*
|
||||
|
||||
// Kernel using a CO2 object on the GPU
|
||||
__global__ void gpuCO2GasViscosity(GpuViewCO2Tables gpuViewCo2Tables, Evaluation* temp, Evaluation* pressure, double* result) {
|
||||
*result = GpuCO2::gasViscosity<Evaluation>(gpuViewCo2Tables, *temp, *pressure, true).value();
|
||||
*result = GpuCO2::gasViscosity(gpuViewCo2Tables, *temp, *pressure, true).value();
|
||||
}
|
||||
|
||||
// Kernel using a SimpleHuDuanH20 object on a GPU
|
||||
__global__ void huDuanLiquidDensity(Evaluation* temp, Evaluation* pressure, double* result) {
|
||||
*result = HuDuan::liquidDensity<Evaluation>(*temp, *pressure, true).value();
|
||||
*result = HuDuan::liquidDensity(*temp, *pressure, true).value();
|
||||
}
|
||||
|
||||
// Kernel using a BrineDynamic object on a GPU
|
||||
__global__ void brineDynamicLiquidEnthalpy(Evaluation* temp, Evaluation* pressure, Evaluation* salinity, double* result) {
|
||||
*result = BrineDyn::liquidEnthalpy<Evaluation>(*temp, *pressure, *salinity).value();
|
||||
*result = BrineDyn::liquidEnthalpy(*temp, *pressure, *salinity).value();
|
||||
}
|
||||
|
||||
// Kernel using a Brine_CO2 object on a GPU
|
||||
@@ -112,12 +112,12 @@ __global__ void brineCO2GasDiffCoeff(GpuViewCO2Tables co2tables, Evaluation* tem
|
||||
|
||||
// Kernel using a Co2GasPvt object on a GPU
|
||||
__global__ void co2GasPvtInternalEnergy(GpuViewCo2Pvt gpuViewCo2Pvt, Evaluation* temp, Evaluation* pressure, double* result) {
|
||||
*result = gpuViewCo2Pvt.internalEnergy<Evaluation>(1, *temp, *pressure, Evaluation(0.4), Evaluation(0.0)).value();
|
||||
*result = gpuViewCo2Pvt.internalEnergy(1, *temp, *pressure, Evaluation(0.4), Evaluation(0.0)).value();
|
||||
}
|
||||
|
||||
// Kernel using a BrineCo2Pvt object on a GPU
|
||||
__global__ void brineCo2PvtInternalEnergy(GpuViewBrineCo2Pvt gpuViewBrineCo2Pvt, Evaluation* temp, Evaluation* pressure, Evaluation* rs, Evaluation* saltConcentration, double* result) {
|
||||
*result = gpuViewBrineCo2Pvt.internalEnergy<Evaluation>(1, *temp, *pressure, *rs, *saltConcentration).value();
|
||||
*result = gpuViewBrineCo2Pvt.internalEnergy(1, *temp, *pressure, *rs, *saltConcentration).value();
|
||||
}
|
||||
|
||||
// Helper function to launch a kernel and retrieve the result on the CPU to reduce code duplicatoin
|
||||
@@ -202,7 +202,7 @@ BOOST_FIXTURE_TEST_CASE(TestEvaluateUniformTabulated2DFunctionOnGpu, Fixture) {
|
||||
BOOST_FIXTURE_TEST_CASE(TestUseCO2OnGpu, Fixture) {
|
||||
|
||||
// use the CO2 tables to aquire the viscosity at 290[K] and 2e5[Pa]
|
||||
double viscosityReference = Opm::CO2<double, Opm::CO2Tables<double, std::vector<double>>>::gasViscosity<Evaluation>(co2Tables, temp, pressure, true).value();
|
||||
double viscosityReference = Opm::CO2<double, Opm::CO2Tables<double, std::vector<double>>>::gasViscosity(co2Tables, temp, pressure, true).value();
|
||||
|
||||
GpuBufCo2Tables gpuBufCo2Table = Opm::gpuistl::move_to_gpu<double, std::vector<double>, GpuB>(co2Tables);
|
||||
GpuViewCO2Tables gpuViewCo2Table = Opm::gpuistl::make_view<GpuV>(gpuBufCo2Table);
|
||||
@@ -217,7 +217,7 @@ BOOST_FIXTURE_TEST_CASE(TestUseCO2OnGpu, Fixture) {
|
||||
BOOST_FIXTURE_TEST_CASE(TestUseH2OOnGpu, Fixture) {
|
||||
|
||||
// use the CO2 tables to aquire the densityReference at 290[K] and 2e5[Pa]
|
||||
double densityReference = HuDuan::liquidDensity<Evaluation>(temp, pressure, true).value();
|
||||
double densityReference = HuDuan::liquidDensity(temp, pressure, true).value();
|
||||
|
||||
gpuComputedResultOnCpu = launchKernelAndRetrieveResult(huDuanLiquidDensity, gpuTemp, gpuPressure);
|
||||
|
||||
@@ -230,7 +230,7 @@ BOOST_FIXTURE_TEST_CASE(TestUseBrineDynamicOnGpu, Fixture) {
|
||||
Evaluation salinity(0.1); // [g/Kg]
|
||||
|
||||
// use the CO2 tables to aquire the enthalpyReference at 290[K] and 2e5[Pa]
|
||||
double enthalpyReference = BrineDyn::liquidEnthalpy<Evaluation>(temp, pressure, salinity).value();
|
||||
double enthalpyReference = BrineDyn::liquidEnthalpy(temp, pressure, salinity).value();
|
||||
|
||||
// Allocate GPU memory for the Evaluation inputs
|
||||
Evaluation* gpuSalinity = nullptr;
|
||||
@@ -247,10 +247,10 @@ BOOST_FIXTURE_TEST_CASE(TestUseBrineDynamicOnGpu, Fixture) {
|
||||
BOOST_FIXTURE_TEST_CASE(TestBrine_CO2OnGPU, Fixture) {
|
||||
|
||||
// use the CO2 tables to aquire the gasDiffCoeffReference at 290[K] and 2e5[Pa]
|
||||
double gasDiffCoeffReference = CpuBrine_CO2::gasDiffCoeff<Evaluation>(co2Tables, temp, pressure, true).value();
|
||||
double gasDiffCoeffReference = CpuBrine_CO2::gasDiffCoeff(co2Tables, temp, pressure, true).value();
|
||||
|
||||
// use the CO2 tables to aquire the viscosity at 290[K] and 2e5[Pa]
|
||||
double viscosity = Opm::CO2<double, Opm::CO2Tables<double, std::vector<double>>>::gasViscosity<Evaluation>(co2Tables, temp, pressure, true).value();
|
||||
double viscosity = Opm::CO2<double, Opm::CO2Tables<double, std::vector<double>>>::gasViscosity(co2Tables, temp, pressure, true).value();
|
||||
|
||||
GpuBufCo2Tables gpuBufCo2Table = Opm::gpuistl::move_to_gpu<double, std::vector<double>, GpuB>(co2Tables);
|
||||
GpuViewCO2Tables gpuViewCo2Table = Opm::gpuistl::make_view<GpuV>(gpuBufCo2Table);
|
||||
@@ -266,7 +266,7 @@ BOOST_FIXTURE_TEST_CASE(TestCo2GasPvt, Fixture) {
|
||||
std::vector<double> salinities = {0.2, 0.3, 0.4};
|
||||
|
||||
CpuCo2Pvt cpuCo2Pvt(salinities);
|
||||
double internalEnergyReference = cpuCo2Pvt.internalEnergy<Evaluation>(1, temp, pressure, Evaluation(0.4), Evaluation(0.0)).value();
|
||||
double internalEnergyReference = cpuCo2Pvt.internalEnergy(1, temp, pressure, Evaluation(0.4), Evaluation(0.0)).value();
|
||||
|
||||
const GpuBufCo2Pvt gpuBufCo2Pvt = Opm::gpuistl::move_to_gpu<double, GpuBufCo2Tables, GpuB>(cpuCo2Pvt);
|
||||
const auto brineReferenceDensityCPUCopy = gpuBufCo2Pvt.getBrineReferenceDensity().asStdVector();
|
||||
@@ -285,7 +285,7 @@ BOOST_FIXTURE_TEST_CASE(TestBrineCo2Pvt, Fixture) {
|
||||
std::vector<double> salinities = {0.2, 0.3, 0.4};
|
||||
|
||||
CpuBrineCo2Pvt cpuBrineCo2Pvt(salinities);
|
||||
double internalEnergyReference = cpuBrineCo2Pvt.internalEnergy<Evaluation>(1, temp, pressure, rs, saltConcentration).value();
|
||||
double internalEnergyReference = cpuBrineCo2Pvt.internalEnergy(1, temp, pressure, rs, saltConcentration).value();
|
||||
|
||||
const GpuBufBrineCo2Pvt gpuBufBrineCo2Pvt = Opm::gpuistl::move_to_gpu<double, GpuBufCo2Tables, GpuB>(cpuBrineCo2Pvt);
|
||||
const GpuViewBrineCo2Pvt gpuViewBrineCo2Pvt = Opm::gpuistl::make_view<GpuV, GpuViewCO2Tables>(gpuBufBrineCo2Pvt);
|
||||
|
||||
Reference in New Issue
Block a user