Skip to content

Commit

Permalink
fix device issue, use new GKO_FACTORY_PARAMETER_*
Browse files Browse the repository at this point in the history
  • Loading branch information
yhmtsai committed Aug 18, 2021
1 parent 9f3ef86 commit 4a46c9f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion common/cuda_hip/multigrid/amgx_pgm_kernels.hpp.inc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ __global__ __launch_bounds__(default_block_size) void match_edge_kernel(
}
auto neighbor = strongest_neighbor_vals[tidx];
if (neighbor != -1 && strongest_neighbor_vals[neighbor] == tidx &&
tidx < neighbor) {
tidx <= neighbor) {
// Use the smaller index as agg point
agg_vals[tidx] = tidx;
agg_vals[neighbor] = tidx;
Expand Down
1 change: 0 additions & 1 deletion hip/preconditioner/jacobi_kernels.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ constexpr int default_num_warps = 32;
// current GPUs have at most 84 SMs)
constexpr int default_grid_size = 32 * 32 * 128;

constexpr int default_block_size = 512;

#include "common/cuda_hip/preconditioner/jacobi_kernels.hpp.inc"

Expand Down
6 changes: 3 additions & 3 deletions include/ginkgo/core/multigrid/amgx_pgm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ class AmgxPgm : public EnableLinOp<AmgxPgm<ValueType, IndexType>>,
* NVIDIA AMGX Reference Manual (October 2017, API Version 2,
* https://github.com/NVIDIA/AMGX/blob/main/doc/AMGX_Reference.pdf).
*/
unsigned GKO_FACTORY_PARAMETER(max_iterations, 15u);
unsigned GKO_FACTORY_PARAMETER_SCALAR(max_iterations, 15u);

/**
* The maximum ratio of unassigned number, which is valid in the
* interval 0.0 ~ 1.0. We use the same default value as NVIDIA AMGX
* Reference Manual (October 2017, API Version 2,
* https://github.com/NVIDIA/AMGX/blob/main/doc/AMGX_Reference.pdf).
*/
double GKO_FACTORY_PARAMETER(max_unassigned_ratio, 0.05);
double GKO_FACTORY_PARAMETER_SCALAR(max_unassigned_ratio, 0.05);

/**
* Use the deterministic assign_to_exist_agg method or not.
Expand All @@ -138,7 +138,7 @@ class AmgxPgm : public EnableLinOp<AmgxPgm<ValueType, IndexType>>,
* from the same matrix. Otherwise, the aggregated group might be
* different depending on the execution ordering.
*/
bool GKO_FACTORY_PARAMETER(deterministic, false);
bool GKO_FACTORY_PARAMETER_SCALAR(deterministic, false);
};
GKO_ENABLE_LIN_OP_FACTORY(AmgxPgm, parameters, Factory);
GKO_ENABLE_BUILD_METHOD(Factory);
Expand Down
2 changes: 1 addition & 1 deletion omp/multigrid/amgx_pgm_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void match_edge(std::shared_ptr<const OmpExecutor> exec,
if (agg_vals[i] == -1) {
auto neighbor = strongest_neighbor_vals[i];
if (neighbor != -1 && strongest_neighbor_vals[neighbor] == i &&
i < neighbor) {
i <= neighbor) {
// Use the smaller index as agg point
agg_vals[i] = i;
agg_vals[neighbor] = i;
Expand Down

0 comments on commit 4a46c9f

Please sign in to comment.