GPU Properties POC - #5131
GPU Properties POC#5131
Conversation
6bdb8bd to
9144153
Compare
44bedbb to
fae5869
Compare
fae5869 to
677f6fd
Compare
c781110 to
ad74c33
Compare
ad74c33 to
73c44de
Compare
GPU portability: add OPM_HOST_DEVICE/OPM_THROW and refresh BlackOilFluidSystem singleton - Add OPM_HOST_DEVICE annotations and convert raw `throw` sites to OPM_THROW in Evaluation, DynamicEvaluation, BlackOilFluidState, BlackOilFluidSystem and the BrineCo2/Co2Gas/NullOil PVT classes. - Refresh BlackOilFluidSystem_macrotemplate's getNonStaticInstance() so the non-static singleton mirrors the current static state after every getInstance() call (fixes stale PVT/density tables seen by the GPU intensive-quantities path). - Add a small `mixingEnergy()` constexpr probe and an `inverseFormationVolumeFactorAndViscosity` helper used by GPU code. - Update bin/genEvalSpecializations.py so generated Evaluation*.hpp pick up ErrorMacros.hpp. CopyablePtr: GPU-friendly storage and host/device decorations Extends `CopyablePtr` so it can be used both as a plain CPU smart pointer and as a GPU-side handle (host/device-decorated accessors, allocator-aware construction, explicit raw-pointer access for kernels). The behaviour on the host is unchanged. Add missing decorator Add polymorphism check to enforce commented warning remove unneeded header remove diff improve robustness and formatting remove checks per cell add todo finish rebasing add more rebasing stuff GPU assembly support on AMD and CUDA minor fix fix rebasing issues remove duplicate include remove unneeded templated struct re-add removed comment make the gpueclmateriallawmanager store tables per region avoid simulators includes remove unneeded gpu decorators
73c44de to
8c1ec0c
Compare
There was a problem hiding this comment.
🟡 Changes recommended
CPU-only compilation, bounds safety, unsupported curve handling, API compatibility, and avoidable GPU-copy issues remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds GPU-compatible material and thermal-law infrastructure for SPE11 simulations.
Changes:
- Adds GPU-owning/view managers for material and thermal properties.
- Makes SPECROCK, THCONR, and tabulated interpolation GPU-compatible.
- Exposes CPU manager data and registers new public headers.
File summaries
| File | Description |
|---|---|
CMakeLists_files.cmake |
Registers GPU manager headers. |
BlackOilFluidSystem_macrotemplate.hpp |
Adjusts storage construction. |
GpuEclMaterialLawManager.hpp |
Adds GPU material-law manager. |
PiecewiseLinearTwoPhaseMaterial.hpp |
Makes errors GPU-compatible. |
Tabulated1DFunction.cpp |
Updates templated instantiations. |
Tabulated1DFunction.hpp |
Adds configurable GPU storage. |
EclSpecrockLaw.hpp |
Enables device-side evaluation. |
EclSpecrockLawParams.hpp |
Adds GPU-backed SPECROCK parameters. |
EclThconrLaw.hpp |
Enables device-side conductivity evaluation. |
EclThermalLawManager.hpp |
Exposes thermal-manager configuration. |
GpuEclThermalLawManager.hpp |
Adds GPU thermal-law manager. |
Review details
Suppressed comments (2)
opm/material/thermal/GpuEclThermalLawManager.hpp:386
- The namespace is opened outside
#if HAVE_CUDA, but its closing brace is removed when CUDA is disabled. Including this public header in a CPU-only build therefore leavesOpm::gpuistlunclosed and breaks parsing of the including translation unit.
} // namespace Opm::gpuistl
#endif // HAVE_CUDA
opm/material/fluidmatrixinteractions/GpuEclMaterialLawManager.hpp:531
- The namespace is opened before the CUDA guard but closed inside it. With
HAVE_CUDA == 0, preprocessing removes the closing brace and this public header leaves the including source insideOpm::gpuistl.
} // namespace Opm::gpuistl
#endif // HAVE_CUDA
- Files reviewed: 11/11 changed files
- Comments generated: 6
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| , referenceDensity_(Storage<std::array<Scalar, 3>>(_referenceDensity_)) | ||
| , molarMass_(Storage<std::array<Scalar, 3>>(_molarMass_)) | ||
| , diffusionCoefficients_(Storage<std::array<Scalar, 3 * 3>>(_diffusionCoefficients_)) |
|
jenkins build this opm-simulators=7018 serial rocm hipify please |
|
jenkins build this opm-simulators=7018 serial rocm hipify please |
|
jenkins build this opm-simulators=7018 serial rocm hipify please |
1 similar comment
|
jenkins build this opm-simulators=7018 serial rocm hipify please |
Contains code changes in OPM-common to support SPE11 types simulations with property and assembly computations on GPU. Main PR: OPM/opm-simulators#7018