mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
BdaBridge lets cusparseSolver copy the resulting x vector from the GPU directly into the BlockVector from ISTLSolverEbos, this only works if the underlying data from BlockVector is contiguous
This commit is contained in:
parent
5cb6ec510c
commit
cf48650a5e
@ -203,9 +203,7 @@ template <class BridgeVector>
|
||||
void BdaBridge::get_result(BridgeVector &x){
|
||||
#if HAVE_CUDA
|
||||
if(use_gpu){
|
||||
double *h_x = backend->post_process();
|
||||
// convert flat array to blockvector
|
||||
memcpy(&(x[0]), h_x, sizeof(double) * x.N() * x[0].dim());
|
||||
backend->post_process(&(x[0][0]));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -427,7 +427,8 @@ namespace Opm
|
||||
|
||||
|
||||
// copy result to host memory
|
||||
double* cusparseSolverBackend::post_process(){
|
||||
// caller must be sure that x is a valid array
|
||||
void cusparseSolverBackend::post_process(double *x){
|
||||
|
||||
double t1, t2;
|
||||
if(verbosity > 2){
|
||||
@ -441,8 +442,6 @@ namespace Opm
|
||||
t2 = second();
|
||||
printf("cusparseSolver::post_process(): %f s\n", t2-t1);
|
||||
}
|
||||
|
||||
return x;
|
||||
} // end post_process()
|
||||
|
||||
|
||||
|
@ -94,7 +94,7 @@ public:
|
||||
// return true iff converged
|
||||
bool solve_system(BdaResult &res);
|
||||
|
||||
double* post_process();
|
||||
void post_process(double *x);
|
||||
|
||||
bool isInitialized();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user