Skip to content

Commit

Permalink
Format files
Browse files Browse the repository at this point in the history
Co-authored-by: Pratik Nayak <[email protected]>
  • Loading branch information
ginkgo-bot and pratikvn committed Jul 20, 2023
1 parent ba8e47a commit 8d5acab
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 52 deletions.
34 changes: 15 additions & 19 deletions common/cuda_hip/base/batch_multi_vector_kernels.hpp.inc
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ __device__ __forceinline__ void scale(

template <typename ValueType>
__global__
__launch_bounds__(default_block_size, sm_multiplier) void scale_kernel(
const gko::batch_multi_vector::UniformBatch<const ValueType> alpha,
const gko::batch_multi_vector::UniformBatch<ValueType> x)
__launch_bounds__(default_block_size, sm_multiplier) void scale_kernel(
const gko::batch_multi_vector::UniformBatch<const ValueType> alpha,
const gko::batch_multi_vector::UniformBatch<ValueType> x)
{
for (size_type ibatch = blockIdx.x; ibatch < x.num_batch_entries;
ibatch += gridDim.x) {
Expand Down Expand Up @@ -93,10 +93,10 @@ __device__ __forceinline__ void add_scaled(

template <typename ValueType>
__global__
__launch_bounds__(default_block_size, sm_multiplier) void add_scaled_kernel(
const gko::batch_multi_vector::UniformBatch<const ValueType> alpha,
const gko::batch_multi_vector::UniformBatch<const ValueType> x,
const gko::batch_multi_vector::UniformBatch<ValueType> y)
__launch_bounds__(default_block_size, sm_multiplier) void add_scaled_kernel(
const gko::batch_multi_vector::UniformBatch<const ValueType> alpha,
const gko::batch_multi_vector::UniformBatch<const ValueType> x,
const gko::batch_multi_vector::UniformBatch<ValueType> y)
{
for (size_type ibatch = blockIdx.x; ibatch < x.num_batch_entries;
ibatch += gridDim.x) {
Expand Down Expand Up @@ -243,15 +243,11 @@ __device__ __forceinline__ void compute_norm2(


template <typename ValueType>
__global__ __launch_bounds__(
default_block_size,
sm_multiplier) void compute_norm2_kernel(const gko::batch_multi_vector::
UniformBatch<const ValueType>
x,
const gko::batch_multi_vector::
UniformBatch<
remove_complex<ValueType>>
result)
__global__
__launch_bounds__(default_block_size, sm_multiplier) void compute_norm2_kernel(
const gko::batch_multi_vector::UniformBatch<const ValueType> x,
const gko::batch_multi_vector::UniformBatch<remove_complex<ValueType>>
result)
{
for (size_type ibatch = blockIdx.x; ibatch < x.num_batch_entries;
ibatch += gridDim.x) {
Expand Down Expand Up @@ -284,9 +280,9 @@ __device__ __forceinline__ void copy(

template <typename ValueType>
__global__
__launch_bounds__(default_block_size, sm_multiplier) void copy_kernel(
const gko::batch_multi_vector::UniformBatch<const ValueType> src,
const gko::batch_multi_vector::UniformBatch<ValueType> dst)
__launch_bounds__(default_block_size, sm_multiplier) void copy_kernel(
const gko::batch_multi_vector::UniformBatch<const ValueType> src,
const gko::batch_multi_vector::UniformBatch<ValueType> dst)
{
for (size_type ibatch = blockIdx.x; ibatch < src.num_batch_entries;
ibatch += gridDim.x) {
Expand Down
6 changes: 3 additions & 3 deletions core/base/batch_multi_vector_kernels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************<GINKGO LICENSE>*******************************/

#ifndef GKO_CORE_MATRIX_BATCH_MULTI_VECTOR_KERNELS_HPP_
#define GKO_CORE_MATRIX_BATCH_MULTI_VECTOR_KERNELS_HPP_
#ifndef GKO_CORE_BASE_BATCH_MULTI_VECTOR_KERNELS_HPP_
#define GKO_CORE_BASE_BATCH_MULTI_VECTOR_KERNELS_HPP_


#include <ginkgo/core/base/batch_multi_vector.hpp>
Expand Down Expand Up @@ -101,4 +101,4 @@ GKO_DECLARE_FOR_ALL_EXECUTOR_NAMESPACES(batch_multi_vector,
} // namespace gko


#endif // GKO_CORE_MATRIX_BATCH_MULTI_VECTOR_KERNELS_HPP_
#endif // GKO_CORE_BASE_BATCH_MULTI_VECTOR_KERNELS_HPP_
6 changes: 3 additions & 3 deletions core/test/base/batch_dim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************<GINKGO LICENSE>*******************************/

#include <memory>
#include <ginkgo/core/base/batch_dim.hpp>


#include <gtest/gtest.h>
#include <memory>


#include <ginkgo/core/base/batch_dim.hpp>
#include <gtest/gtest.h>


TEST(BatchDim, ConstructsCorrectUniformObject)
Expand Down
10 changes: 4 additions & 6 deletions cuda/base/batch_struct.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,15 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************<GINKGO LICENSE>*******************************/

#ifndef GKO_CUDA_MATRIX_BATCH_STRUCT_HPP_
#define GKO_CUDA_MATRIX_BATCH_STRUCT_HPP_


#include "core/base/batch_struct.hpp"
#ifndef GKO_CUDA_BASE_BATCH_STRUCT_HPP_
#define GKO_CUDA_BASE_BATCH_STRUCT_HPP_


#include <ginkgo/core/base/batch_multi_vector.hpp>
#include <ginkgo/core/base/math.hpp>


#include "core/base/batch_struct.hpp"
#include "cuda/base/config.hpp"
#include "cuda/base/types.hpp"

Expand Down Expand Up @@ -111,4 +109,4 @@ maybe_null_batch_struct(const BatchMultiVector<ValueType>* const op)
} // namespace gko


#endif // GKO_CUDA_MATRIX_BATCH_STRUCT_HPP_
#endif // GKO_CUDA_BASE_BATCH_STRUCT_HPP_
2 changes: 1 addition & 1 deletion dpcpp/base/batch_multi_vector_kernels.dp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include <algorithm>
#include <dpcpp/matrix/batch_struct.hpp>


#include <ginkgo/core/base/array.hpp>
Expand All @@ -42,7 +43,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include "core/components/prefix_sum_kernels.hpp"
#include "dpcpp/matrix/batch_struct.hpp"


namespace gko {
Expand Down
1 change: 0 additions & 1 deletion dpcpp/base/batch_multi_vector_kernels.hpp.inc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************<GINKGO LICENSE>*******************************/


template <typename ValueType>
__dpct_inline__ void scale_kernel(
const gko::batch_dense::BatchEntry<const ValueType>& alpha,
Expand Down
6 changes: 2 additions & 4 deletions dpcpp/base/batch_struct.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define GKO_DPCPP_BASE_BATCH_STRUCT_HPP_


#include "core/base/batch_struct.hpp"


#include <ginkgo/core/base/math.hpp>
#include <ginkgo/core/matrix/batch_multi_vector.hpp>


#include "core/base/batch_struct.hpp"
#include "dpcpp/base/config.hpp"


Expand Down Expand Up @@ -111,4 +109,4 @@ maybe_null_batch_struct(const BatchMultiVector<ValueType>* const op)
} // namespace gko


#endif // GKO_DPCPP_MATRIX_BATCH_STRUCT_HPP_
#endif // GKO_DPCPP_BASE_BATCH_STRUCT_HPP_
10 changes: 4 additions & 6 deletions hip/base/batch_struct.hip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,15 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************<GINKGO LICENSE>*******************************/

#ifndef GKO_HIP_MATRIX_BATCH_STRUCT_HIP_HPP_
#define GKO_HIP_MATRIX_BATCH_STRUCT_HIP_HPP_


#include "core/base/batch_struct.hpp"
#ifndef GKO_HIP_BASE_BATCH_STRUCT_HIP_HPP_
#define GKO_HIP_BASE_BATCH_STRUCT_HIP_HPP_


#include <ginkgo/core/base/batch_multi_vector.hpp>
#include <ginkgo/core/base/math.hpp>


#include "core/base/batch_struct.hpp"
#include "hip/base/config.hip.hpp"
#include "hip/base/types.hip.hpp"

Expand Down Expand Up @@ -111,4 +109,4 @@ maybe_null_batch_struct(const BatchMultiVector<ValueType>* const op)
} // namespace gko


#endif // GKO_HIP_MATRIX_BATCH_STRUCT_HIP_HPP_
#endif // GKO_HIP_BASE_BATCH_STRUCT_HIP_HPP_
1 change: 1 addition & 0 deletions include/ginkgo/ginkgo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <ginkgo/core/base/abstract_factory.hpp>
#include <ginkgo/core/base/array.hpp>
#include <ginkgo/core/base/batch_dim.hpp>
#include <ginkgo/core/base/batch_lin_op_helpers.hpp>
#include <ginkgo/core/base/batch_multi_vector.hpp>
#include <ginkgo/core/base/combination.hpp>
Expand Down
1 change: 0 additions & 1 deletion reference/base/batch_multi_vector_kernels.hpp.inc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************<GINKGO LICENSE>*******************************/


template <typename ValueType>
inline void scale_kernel(
const gko::batch_multi_vector::BatchEntry<const ValueType>& alpha,
Expand Down
12 changes: 6 additions & 6 deletions reference/base/batch_struct.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************<GINKGO LICENSE>*******************************/

#ifndef GKO_REFERENCE_MATRIX_BATCH_STRUCT_HPP_
#define GKO_REFERENCE_MATRIX_BATCH_STRUCT_HPP_


#include "core/base/batch_struct.hpp"
#ifndef GKO_REFERENCE_BASE_BATCH_STRUCT_HPP_
#define GKO_REFERENCE_BASE_BATCH_STRUCT_HPP_


#include <ginkgo/core/base/batch_multi_vector.hpp>
#include <ginkgo/core/base/math.hpp>


#include "core/base/batch_struct.hpp"


namespace gko {
namespace kernels {
/**
Expand Down Expand Up @@ -111,4 +111,4 @@ maybe_null_batch_struct(const BatchMultiVector<ValueType>* const op)
} // namespace gko


#endif // GKO_REFERENCE_MATRIX_BATCH_STRUCT_HPP_
#endif // GKO_REFERENCE_BASE_BATCH_STRUCT_HPP_
4 changes: 2 additions & 2 deletions test/base/batch_multi_vector_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************<GINKGO LICENSE>*******************************/

#include "core/base/batch_multi_vector_kernels.hpp"
#include <ginkgo/core/base/batch_multi_vector.hpp>


#include <random>
Expand All @@ -40,10 +40,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include <ginkgo/core/base/array.hpp>
#include <ginkgo/core/base/batch_multi_vector.hpp>
#include <ginkgo/core/base/math.hpp>


#include "core/base/batch_multi_vector_kernels.hpp"
#include "core/test/utils.hpp"
#include "core/test/utils/batch_helpers.hpp"
#include "test/utils/executor.hpp"
Expand Down

0 comments on commit 8d5acab

Please sign in to comment.