fixed nan (#436)
This PR fixes nan issues in corner cases in hypre_BoomerAMGInterpTruncationDevice.
This commit is contained in:
parent
ffe4f7384b
commit
9117fc20f2
@ -1497,25 +1497,31 @@ hypre_BoomerAMGSetup( void *amg_vdata,
|
||||
num_functions, dof_func_array[level], debug_flag,
|
||||
agg_P12_trunc_factor, agg_P12_max_elmts, &P1);
|
||||
}
|
||||
|
||||
else if (agg_interp_type == 5)
|
||||
{
|
||||
hypre_BoomerAMGBuildModExtInterp(A_array[level],
|
||||
CF_marker, S, coarse_pnts_global1,
|
||||
num_functions, dof_func_array[level],
|
||||
debug_flag,
|
||||
agg_P12_trunc_factor, agg_P12_max_elmts, &P1);
|
||||
}
|
||||
else if (agg_interp_type == 6)
|
||||
{
|
||||
hypre_BoomerAMGBuildModExtPIInterp(A_array[level],
|
||||
CF_marker, S, coarse_pnts_global1,
|
||||
num_functions, dof_func_array[level],
|
||||
debug_flag,
|
||||
agg_P12_trunc_factor, agg_P12_max_elmts, &P1);
|
||||
}
|
||||
else if (agg_interp_type == 7)
|
||||
{
|
||||
hypre_BoomerAMGBuildModExtPEInterp(A_array[level],
|
||||
CF_marker, S, coarse_pnts_global1,
|
||||
num_functions, dof_func_array[level],
|
||||
debug_flag,
|
||||
agg_P12_trunc_factor, agg_P12_max_elmts, &P1);
|
||||
}
|
||||
|
||||
if (agg_interp_type == 4)
|
||||
{
|
||||
hypre_BoomerAMGCorrectCFMarker (CF_marker, local_num_vars,
|
||||
|
||||
@ -79,7 +79,16 @@ hypreCUDAKernel_InterpTruncation( HYPRE_Int nrows,
|
||||
}
|
||||
}
|
||||
|
||||
row_scal = row_sum / warp_allreduce_sum(row_scal);
|
||||
row_scal = warp_allreduce_sum(row_scal);
|
||||
|
||||
if (row_scal)
|
||||
{
|
||||
row_scal = row_sum / row_scal;
|
||||
}
|
||||
else
|
||||
{
|
||||
row_scal = 1.0;
|
||||
}
|
||||
|
||||
/* 3. scale the row */
|
||||
for (HYPRE_Int i = p + lane; i <= last_pos; i += HYPRE_WARP_SIZE)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user