mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
rocsparseCPR: add support for float Scalars
This commit is contained in:
parent
6bcdad6ceb
commit
3ff678b58a
@ -35,6 +35,8 @@
|
|||||||
|
|
||||||
#include <opm/simulators/linalg/bda/Misc.hpp>
|
#include <opm/simulators/linalg/bda/Misc.hpp>
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
namespace Opm::Accelerator {
|
namespace Opm::Accelerator {
|
||||||
|
|
||||||
using Opm::OpmLog;
|
using Opm::OpmLog;
|
||||||
@ -235,8 +237,13 @@ amg_cycle_gpu(const int level,
|
|||||||
|
|
||||||
HIP_CHECK(hipMemcpyAsync(h_y.data(), &y, sizeof(Scalar) * Ncur, hipMemcpyDeviceToHost, this->stream));
|
HIP_CHECK(hipMemcpyAsync(h_y.data(), &y, sizeof(Scalar) * Ncur, hipMemcpyDeviceToHost, this->stream));
|
||||||
|
|
||||||
// solve coarsest level using umfpack
|
// The if constexpr is needed to make the code compile
|
||||||
this->umfpack.apply(h_x.data(), h_y.data());
|
// since the umfpack member is an 'int' with float Scalar.
|
||||||
|
// We will never get here with float Scalar as we throw earlier.
|
||||||
|
// Solve coarsest level using umfpack
|
||||||
|
if constexpr (std::is_same_v<Scalar,double>) {
|
||||||
|
this->umfpack.apply(h_x.data(), h_y.data());
|
||||||
|
}
|
||||||
|
|
||||||
HIP_CHECK(hipMemcpyAsync(&x, h_x.data(), sizeof(Scalar) * Ncur, hipMemcpyHostToDevice, this->stream));
|
HIP_CHECK(hipMemcpyAsync(&x, h_x.data(), sizeof(Scalar) * Ncur, hipMemcpyHostToDevice, this->stream));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user