Closed Tongdongq closed 3 years ago
The cuda backend uses CUSPARSE for the SPMV operations, and CUSPARSE does not support block-valued matrices, which is the reason for the static assert you hit. You could use VexCL AMGCL backend with CUDA VexCL backend (this is probably hard to understand: VexCL is the backend that AMGCL should use, with the CUDA backend for VexCL). Or you could use the CUDA backend, but with scalar value type, see here for an example (vs the block version below).
A better example would be examples/cpr_drs.cpp, which is compiled for CUDA backend among others, but explicitly checks that compile-time block size Is 1.
I've made a blocked ilu0-bicgstab solver in cusparse that worked. In particular the cusparseXbsrmv()
and cusparseXbsrilu02()
were used.
It probably doesn't matter, since I need to use amg anyway, so I'll try the VexCL-CUDA solution.
Thanks for pointing the block versions out. It does look like extending the cuda backend to support block values should be possible. I am not sure when (or if) that would be available, so using VexCL-CUDA should be the easiest option for now.
I got that working now, thanks!
Does the CUDA backend support CPR? I've tried to adapt
tutorials/1.poisson3Db/poisson3Db_cuda.cu
to use CPR with the definitions inexamples/cpr.cpp
. This is the errorThe cuda backend appears the only one that has that
static_assert(std::is_same<real, float>::value || std::is_same<real, double>::value, "Unsupported value type for cuda backend");
I'd like to try it in opm-simulators.