Skip to content

Commit

Permalink
Applying clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
lucbv committed Nov 21, 2023
1 parent 3aa5d2f commit 894293e
Showing 1 changed file with 34 additions and 30 deletions.
64 changes: 34 additions & 30 deletions blas/tpls/KokkosBlas1_nrm1_tpl_spec_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,30 +167,31 @@ void cublasAsumWrapper(const ExecutionSpace& space, RViewType& R,
KOKKOS_CUBLAS_SAFE_CALL_IMPL(cublasSetStream(s.handle, NULL));
}

#define KOKKOSBLAS1_NRM1_TPL_SPEC_DECL_CUBLAS(SCALAR, LAYOUT, MEMSPACE) \
#define KOKKOSBLAS1_NRM1_TPL_SPEC_DECL_CUBLAS(SCALAR, LAYOUT, MEMSPACE) \
template <> \
struct Nrm1< \
Kokkos::Cuda, \
Kokkos::Cuda, \
Kokkos::View<typename Kokkos::ArithTraits<SCALAR>::mag_type, LAYOUT, \
Kokkos::HostSpace, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
Kokkos::View<const SCALAR*, LAYOUT, Kokkos::Device<Kokkos::Cuda, MEMSPACE>, \
Kokkos::View<const SCALAR*, LAYOUT, \
Kokkos::Device<Kokkos::Cuda, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
1, true, \
nrm1_eti_spec_avail< \
Kokkos::Cuda, \
Kokkos::Cuda, \
Kokkos::View<typename Kokkos::ArithTraits<SCALAR>::mag_type, LAYOUT, \
Kokkos::HostSpace, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
Kokkos::View<const SCALAR*, LAYOUT, \
Kokkos::Device<Kokkos::Cuda, MEMSPACE>, \
Kokkos::Device<Kokkos::Cuda, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>>::value> { \
using execution_space = Kokkos::Cuda; \
using execution_space = Kokkos::Cuda; \
using RV = Kokkos::View<typename Kokkos::ArithTraits<SCALAR>::mag_type, \
LAYOUT, Kokkos::HostSpace, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>; \
using XV = Kokkos::View<const SCALAR*, LAYOUT, \
Kokkos::Device<Kokkos::Cuda, MEMSPACE>, \
Kokkos::Device<Kokkos::Cuda, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>; \
using size_type = typename XV::size_type; \
\
Expand All @@ -202,8 +203,8 @@ void cublasAsumWrapper(const ExecutionSpace& space, RViewType& R,
cublasAsumWrapper(space, R, X); \
} else { \
Nrm1<execution_space, RV, XV, 1, false, \
nrm1_eti_spec_avail<Kokkos::Cuda, RV, XV>::value>::nrm1(space, R, \
X); \
nrm1_eti_spec_avail<Kokkos::Cuda, RV, XV>::value>::nrm1(space, R, \
X); \
} \
Kokkos::Profiling::popRegion(); \
} \
Expand Down Expand Up @@ -278,42 +279,43 @@ void rocblasAsumWrapper(const ExecutionSpace& space, RViewType& R,
KOKKOS_ROCBLAS_SAFE_CALL_IMPL(rocblas_set_stream(s.handle, NULL));
}

#define KOKKOSBLAS1_NRM1_TPL_SPEC_DECL_ROCBLAS(SCALAR, LAYOUT, MEMSPACE) \
#define KOKKOSBLAS1_NRM1_TPL_SPEC_DECL_ROCBLAS(SCALAR, LAYOUT, MEMSPACE) \
template <> \
struct Nrm1< \
Kokkos::HIP, \
Kokkos::HIP, \
Kokkos::View<typename Kokkos::ArithTraits<SCALAR>::mag_type, LAYOUT, \
Kokkos::HostSpace, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
Kokkos::View<const SCALAR*, LAYOUT, Kokkos::Device<Kokkos::HIP, MEMSPACE>, \
Kokkos::View<const SCALAR*, LAYOUT, \
Kokkos::Device<Kokkos::HIP, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
1, true, \
nrm1_eti_spec_avail< \
Kokkos::HIP, \
Kokkos::HIP, \
Kokkos::View<typename Kokkos::ArithTraits<SCALAR>::mag_type, LAYOUT, \
Kokkos::HostSpace, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
Kokkos::View<const SCALAR*, LAYOUT, \
Kokkos::Device<Kokkos::HIP, MEMSPACE>, \
Kokkos::Device<Kokkos::HIP, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>>::value> { \
using RV = Kokkos::View<typename Kokkos::ArithTraits<SCALAR>::mag_type, \
LAYOUT, Kokkos::HostSpace, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>; \
using XV = Kokkos::View<const SCALAR*, LAYOUT, \
Kokkos::Device<Kokkos::HIP, MEMSPACE>, \
Kokkos::Device<Kokkos::HIP, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>; \
using size_type = typename XV::size_type; \
\
static void nrm1(const Kokkos::HIP& space, RV& R, const XV& X) { \
static void nrm1(const Kokkos::HIP& space, RV& R, const XV& X) { \
Kokkos::Profiling::pushRegion("KokkosBlas::nrm1[TPL_ROCBLAS," #SCALAR \
"]"); \
const size_type numElems = X.extent(0); \
if (numElems < static_cast<size_type>(INT_MAX)) { \
rocblasAsumWrapper(space, R, X); \
} else { \
Nrm1<Kokkos::HIP, RV, XV, 1, false, \
nrm1_eti_spec_avail<Kokkos::HIP, RV, XV>::value>::nrm1(space, R, \
X); \
Nrm1<Kokkos::HIP, RV, XV, 1, false, \
nrm1_eti_spec_avail<Kokkos::HIP, RV, XV>::value>::nrm1(space, R, \
X); \
} \
Kokkos::Profiling::popRegion(); \
} \
Expand Down Expand Up @@ -387,31 +389,33 @@ void onemklAsumWrapper(const ExecutionSpace& space, RViewType& R,
Kokkos::deep_copy(space, R, res);
}

#define KOKKOSBLAS1_NRM1_ONEMKL(SCALAR, LAYOUT, MEMSPACE) \
#define KOKKOSBLAS1_NRM1_ONEMKL(SCALAR, LAYOUT, MEMSPACE) \
template <> \
struct Nrm1< \
Kokkos::Experimental::SYCL, \
Kokkos::Experimental::SYCL, \
Kokkos::View<typename Kokkos::ArithTraits<SCALAR>::mag_type, LAYOUT, \
Kokkos::HostSpace, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
Kokkos::View<const SCALAR*, LAYOUT, Kokkos::Device<Kokkos::Experimental::SYCL, MEMSPACE>, \
Kokkos::View<const SCALAR*, LAYOUT, \
Kokkos::Device<Kokkos::Experimental::SYCL, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
1, true, \
nrm1_eti_spec_avail< \
Kokkos::Experimental::SYCL, \
Kokkos::Experimental::SYCL, \
Kokkos::View<typename Kokkos::ArithTraits<SCALAR>::mag_type, LAYOUT, \
Kokkos::HostSpace, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
Kokkos::View<const SCALAR*, LAYOUT, \
Kokkos::Device<Kokkos::Experimental::SYCL, MEMSPACE>, \
Kokkos::Device<Kokkos::Experimental::SYCL, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>>::value> { \
using execution_space = Kokkos::Experimental::SYCL; \
using execution_space = Kokkos::Experimental::SYCL; \
using RV = Kokkos::View<typename Kokkos::ArithTraits<SCALAR>::mag_type, \
LAYOUT, Kokkos::HostSpace, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>; \
using XV = Kokkos::View<const SCALAR*, LAYOUT, \
Kokkos::Device<Kokkos::Experimental::SYCL, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>; \
using XV = \
Kokkos::View<const SCALAR*, LAYOUT, \
Kokkos::Device<Kokkos::Experimental::SYCL, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>; \
using size_type = typename XV::size_type; \
\
static void nrm1(const execution_space& space, RV& R, const XV& X) { \
Expand All @@ -422,8 +426,8 @@ void onemklAsumWrapper(const ExecutionSpace& space, RViewType& R,
onemklAsumWrapper(space, R, X); \
} else { \
Nrm1<execution_space, RV, XV, 1, false, \
nrm1_eti_spec_avail<Kokkos::Experimental::SYCL, RV, XV>::value>::nrm1(space, R, \
X); \
nrm1_eti_spec_avail<Kokkos::Experimental::SYCL, RV, \
XV>::value>::nrm1(space, R, X); \
} \
Kokkos::Profiling::popRegion(); \
} \
Expand Down

0 comments on commit 894293e

Please sign in to comment.