fixed ads (#418)

This PR fixes an issue with ADS on GPUs
This commit is contained in:
Ruipeng Li 2021-06-25 13:47:47 -07:00 committed by GitHub
parent b7d4ce9d53
commit e7e2ab36a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1215,10 +1215,21 @@ HYPRE_Int hypre_ADSSetup(void *solver,
if (!hypre_ParCSRMatrixCommPkg(ads_data -> Pix))
hypre_MatvecCommPkgCreate(ads_data -> Pix);
P_owned_col_starts = hypre_ParCSRMatrixOwnsRowStarts(ads_data -> Pix);
hypre_BoomerAMGBuildCoarseOperator(ads_data -> Pix,
ads_data -> A,
ads_data -> Pix,
&ads_data -> A_Pix);
#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)
if (exec == HYPRE_EXEC_DEVICE)
{
ads_data -> A_Pix = hypre_ParCSRMatrixRAPKT(ads_data -> Pix, ads_data -> A, ads_data -> Pix, 1);
}
else
#endif
{
hypre_BoomerAMGBuildCoarseOperator(ads_data -> Pix,
ads_data -> A,
ads_data -> Pix,
&ads_data -> A_Pix);
}
if (!P_owned_col_starts)
{
hypre_ParCSRMatrixOwnsRowStarts(ads_data -> A_Pix) = 0;