Skip to content

GpuBlackoilIntensiveQuantitiesDispatcher and FIBlackoilModel wiring#7030

Open
kjetilly wants to merge 5 commits into
OPM:masterfrom
kjetilly:intensive_quantities_5
Open

GpuBlackoilIntensiveQuantitiesDispatcher and FIBlackoilModel wiring#7030
kjetilly wants to merge 5 commits into
OPM:masterfrom
kjetilly:intensive_quantities_5

Conversation

@kjetilly
Copy link
Copy Markdown
Contributor

Needs OPM/opm-common#5138.

Adds the GPU intensive-quantities dispatcher (GpuBlackoilIntensiveQuantitiesDispatcher.{hpp,cu}) and the supporting GpuFlowGasWaterEnergyTypeTags.hpp. This adds the runtime keyword --experimental-compute-properties-on-gpu={true,false} which enables running the property calculation on the GPU (provided the input case is a CO2STORE case)

The .cu translation unit and the OPM_HAVE_GPU_BLACKOIL_INTENSIVE_QUANTITIES_DISPATCHER macro are gated on HIP or CUDA >= 13.1.

Adds host-side allocator helpers, host/device-decorated raw-pointer
accessors and small additions to MiniVector that the rest of the GPU
intensive-quantities work depends on.  Updates test_gpu_smart_pointers.cu
to cover the new behaviour.
…) use

Decorates inline helpers in blackoil*modules.hh, blackoilprimaryvariables.hh,
directionalmobility.hh, tpfalinearizer.hh, NewTranFluxModule.hpp,
TemperatureModel.hpp and BlackOilEnergyIntensiveQuantitiesGlobalIndex.hpp
with OPM_HOST_DEVICE, replaces a few raw `throw`s with OPM_THROW, and
switches static `FluidSystem::` accesses to instance-based
`fluidState.fluidSystem()` / `getFluidSystem()` so the same code works
when the fluid system lives on the device.  Test
test_gpu_linear_two_phase_material.cu picks up the matching template
adjustments.
Adds the GPU intensive-quantities dispatcher
(GpuBlackoilIntensiveQuantitiesDispatcher.{hpp,cu}) and the supporting
GpuFlowGasWaterEnergyTypeTags.hpp.  FIBlackoilModel is updated in this
branch (rather than earlier) to consume the dispatcher as the entry
point used to push BlackOilIntensiveQuantities updates to the device.

The .cu translation unit and the OPM_HAVE_GPU_BLACKOIL_INTENSIVE_QUANTITIES_DISPATCHER
macro are gated on HIP or CUDA >= 13.1.
@kjetilly kjetilly added the manual:irrelevant This PR is a minor fix and should not appear in the manual label May 1, 2026
kjetilly added 2 commits May 3, 2026 19:14
Adds the GPU-side problem and material/thermal law manager headers
(GpuFlowProblem, GpuEclMaterialLawManager, GpuEclThermalLawManager) plus
the matching GPU element-context header (fvbaseelementcontextgpu.hh) and
the FlowGasWaterEnergyTypeTag.hpp typetag.  Wires them through
FlowProblemParameters and adds a Boost test
(test_gpu_ecl_thermal_law_manager.cu) backed by tests/very_simple_deck.DATA.

The new test is gated on HIP or CUDA >= 13.1 in CMakeLists_files.cmake.
Reworks BlackOilIntensiveQuantities so its update path is fully usable
from device code (relaxed-constexpr-friendly storage, host/device-decorated
helpers, moved init helpers).  Adds tests/gpuistl/test_blackoilintensivequantities_gpu.cu
which exercises the GPU update path end-to-end and matches it against the
CPU reference, including derivatives.  The test is gated on HIP or
CUDA >= 13.1.
@kjetilly kjetilly force-pushed the intensive_quantities_5 branch from 3aa01ea to d17e801 Compare May 3, 2026 19:44
@kjetilly kjetilly marked this pull request as ready for review May 4, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:irrelevant This PR is a minor fix and should not appear in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant