Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: Tobias Ribizel <ribizel@kit.edu>
Co-Authored-By: Pratik Nayak <pratik.nayak4@gmail.com>
  • Loading branch information
3 people committed Nov 14, 2019
1 parent dc7befb commit 55c88eb
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 12 deletions.
5 changes: 3 additions & 2 deletions cuda/components/atomic.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace cuda {
/**
* @internal
*
* @note It is not 'real' complex<float> atomic add opeartion
* @note It is not 'real' complex<float> atomic add operation
*/
__forceinline__ __device__ void atomic_add(
thrust::complex<float> *__restrict__ address, thrust::complex<float> val)
Expand All @@ -56,10 +56,11 @@ __forceinline__ __device__ void atomic_add(
atomic_add(&(cuaddr->y), val.imag());
}


/**
* @internal
*
* @note It is not 'real' complex<double> atomic add opeartion
* @note It is not 'real' complex<double> atomic add operation
*/
__forceinline__ __device__ void atomic_add(
thrust::complex<double> *__restrict__ address, thrust::complex<double> val)
Expand Down
2 changes: 1 addition & 1 deletion cuda/components/format_conversion.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ __host__ size_type calculate_nwarps(std::shared_ptr<const CudaExecutor> exec,
multiple = 32;
}
return std::min(multiple * nwarps_in_cuda,
static_cast<size_type>(ceildiv(nnz, config::warp_size)));
size_type(ceildiv(nnz, config::warp_size)));
}


Expand Down
2 changes: 1 addition & 1 deletion cuda/components/uninitialized_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ namespace cuda {
} // namespace gko


#endif // GKO_CUDA_BASE_COMPONENTS_ARRAY_HPP_
#endif // GKO_CUDA_COMPONENTS_UNINITIALIZED_ARRAY_HPP_
4 changes: 2 additions & 2 deletions hip/components/atomic.hip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace hip {
/**
* @internal
*
* @note It is not 'real' complex<float> atomic add opeartion
* @note It is not 'real' complex<float> atomic add operation
*/
__forceinline__ __device__ void atomic_add(
thrust::complex<float> *__restrict__ address, thrust::complex<float> val)
Expand All @@ -63,7 +63,7 @@ __forceinline__ __device__ void atomic_add(
/**
* @internal
*
* @note It is not 'real' complex<double> atomic add opeartion
* @note It is not 'real' complex<double> atomic add operation
*/
__forceinline__ __device__ void atomic_add(
thrust::complex<double> *__restrict__ address, thrust::complex<double> val)
Expand Down
2 changes: 1 addition & 1 deletion hip/components/format_conversion.hip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ __host__ size_type calculate_nwarps(std::shared_ptr<const HipExecutor> exec,
}
#endif // GINKGO_HIP_PLATFORM_NVCC
return std::min(multiple * nwarps_in_hip,
static_cast<size_type>(ceildiv(nnz, config::warp_size)));
size_type(ceildiv(nnz, config::warp_size)));
}


Expand Down
2 changes: 1 addition & 1 deletion hip/matrix/coo_kernels.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,4 @@ GKO_INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(
} // namespace coo
} // namespace hip
} // namespace kernels
} // namespace gko
} // namespace gko
22 changes: 22 additions & 0 deletions hip/test/matrix/coo_kernels.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,17 @@ TEST_F(Coo, SimpleApplyAddToDenseMatrixIsEquivalentToRef)
}


TEST_F(Coo, SimpleApplyAddToLargeDenseMatrixIsEquivalentToRef)
{
set_up_apply_data(33);

mtx->apply2(y.get(), expected.get());
dmtx->apply2(dy.get(), dresult.get());

GKO_ASSERT_MTX_NEAR(dresult, expected, 1e-14);
}


TEST_F(Coo, AdvancedApplyAddToDenseMatrixIsEquivalentToRef)
{
set_up_apply_data(3);
Expand All @@ -211,6 +222,17 @@ TEST_F(Coo, AdvancedApplyAddToDenseMatrixIsEquivalentToRef)
}


TEST_F(Coo, AdvancedApplyAddToLargeDenseMatrixIsEquivalentToRef)
{
set_up_apply_data(33);

mtx->apply2(y.get(), expected.get());
dmtx->apply2(dy.get(), dresult.get());

GKO_ASSERT_MTX_NEAR(dresult, expected, 1e-14);
}


TEST_F(Coo, ConvertToDenseIsEquivalentToRef)
{
set_up_apply_data();
Expand Down
6 changes: 2 additions & 4 deletions include/ginkgo/core/preconditioner/ilu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,7 @@ class Ilu : public EnableLinOp<Ilu<LSolverType, USolverType, ReverseApply>> {
*
*/
template <typename SolverType, typename = void>
struct has_with_criteria : std::false_type {
};
struct has_with_criteria : std::false_type {};

/**
* @copydoc has_with_criteria
Expand All @@ -291,8 +290,7 @@ class Ilu : public EnableLinOp<Ilu<LSolverType, USolverType, ReverseApply>> {
SolverType,
xstd::void_t<decltype(std::declval<factory_type_t<SolverType>>()
.with_criteria(with_criteria_param_type()))>>
: std::true_type {
};
: std::true_type {};


/**
Expand Down

0 comments on commit 55c88eb

Please sign in to comment.