Skip to content

Commit 6b656c8

Browse files
committed
Formatting
1 parent 9e1bdb2 commit 6b656c8

File tree

3 files changed

+33
-40
lines changed

3 files changed

+33
-40
lines changed

common/src/KokkosKernels_EagerInitialize.cpp

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
// Include the minimal set of headers that declare all TPL singletons
2222
#ifdef KOKKOSKERNELS_ENABLE_COMPONENT_BLAS
23-
#include "KokkosBlas_tpl_spec.hpp" //cuBLAS, rocBLAS
23+
#include "KokkosBlas_tpl_spec.hpp" //cuBLAS, rocBLAS
2424
#ifdef KOKKOSKERNELS_ENABLE_TPL_MAGMA
2525
#include "KokkosBlas_Magma_tpl.hpp"
2626
#endif
2727
#endif
2828

2929
#ifdef KOKKOSKERNELS_ENABLE_COMPONENT_SPARSE
30-
//note: this file declares both cuSPARSE and rocSPARSE singletons
30+
// note: this file declares both cuSPARSE and rocSPARSE singletons
3131
#include "KokkosKernels_tpl_handles_decl.hpp"
3232
#endif
3333

@@ -40,44 +40,40 @@
4040
#endif
4141
#endif
4242

43-
namespace KokkosKernels
44-
{
45-
void eager_initialize()
46-
{
47-
if(!Kokkos::is_initialized())
48-
{
49-
throw std::runtime_error("Kokkos::intialize must be called before KokkosKernels::eager_initialize");
50-
}
43+
namespace KokkosKernels {
44+
void eager_initialize() {
45+
if (!Kokkos::is_initialized()) {
46+
throw std::runtime_error("Kokkos::intialize must be called before KokkosKernels::eager_initialize");
47+
}
5148
#ifdef KOKKOSKERNELS_ENABLE_COMPONENT_BLAS
5249
#ifdef KOKKOSKERNELS_ENABLE_TPL_CUBLAS
53-
(void) KokkosBlas::Impl::CudaBlasSingleton::singleton();
50+
(void)KokkosBlas::Impl::CudaBlasSingleton::singleton();
5451
#endif
5552
#ifdef KOKKOSKERNELS_ENABLE_TPL_ROCBLAS
56-
(void) KokkosBlas::Impl::RocBlasSingleton::singleton();
53+
(void)KokkosBlas::Impl::RocBlasSingleton::singleton();
5754
#endif
5855
#ifdef KOKKOSKERNELS_ENABLE_TPL_MAGMA
5956
#include "KokkosBlas_Magma_tpl.hpp"
60-
(void) KokkosBlas::Impl::MagmaSingleton::singleton();
57+
(void)KokkosBlas::Impl::MagmaSingleton::singleton();
6158
#endif
6259
#endif
6360

6461
#ifdef KOKKOSKERNELS_ENABLE_COMPONENT_SPARSE
6562
#ifdef KOKKOSKERNELS_ENABLE_TPL_CUSPARSE
66-
(void) KokkosKernels::Impl::CusparseSingleton::singleton();
63+
(void)KokkosKernels::Impl::CusparseSingleton::singleton();
6764
#endif
6865
#ifdef KOKKOSKERNELS_ENABLE_TPL_ROCSPARSE
69-
(void) KokkosKernels::Impl::RocsparseSingleton::singleton();
66+
(void)KokkosKernels::Impl::RocsparseSingleton::singleton();
7067
#endif
7168
#endif
7269

7370
#ifdef KOKKOSKERNELS_ENABLE_COMPONENT_LAPACK
7471
#ifdef KOKKOSKERNELS_ENABLE_TPL_CUSOLVER
75-
(void) KokkosLapack::Impl::CudaLapackSingleton::singleton();
72+
(void)KokkosLapack::Impl::CudaLapackSingleton::singleton();
7673
#endif
7774
#ifdef KOKKOSKERNELS_ENABLE_TPL_MAGMA
78-
(void) KokkosLapack::Impl::MagmaSingleton::singleton();
75+
(void)KokkosLapack::Impl::MagmaSingleton::singleton();
7976
#endif
8077
#endif
81-
}
8278
}
83-
79+
} // namespace KokkosKernels

common/src/KokkosKernels_EagerInitialize.hpp

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,22 @@
1717
#ifndef KOKKOKERNELS_EAGER_INITIALIZE_HPP
1818
#define KOKKOKERNELS_EAGER_INITIALIZE_HPP
1919

20-
namespace KokkosKernels
21-
{
22-
// \brief Eagerly initialize handles for all enabled TPLs, as well
23-
// as any other globally shared resources that would otherwise be lazily initialized.
24-
//
25-
// Eagerly initializing a TPL means that it doesn't have to be
26-
// lazily initialized when first calling a kernel that uses it.
27-
// For example, \c eager_initialize() will call \c cusparseCreate() upfront
28-
// so that the first call to \c KokkosSparse::spmv doesn't have to.
29-
// This can add a significant amount of apparent runtime to that first kernel
30-
// call, even though the added time isn't really spent in the kernel.
31-
//
32-
// Calling this before using any kernels/TPLs is optional.
33-
// This function is idempotent (any calls after the first have no effect).
34-
//
35-
// \pre \c Kokkos::initialize() has been called.
36-
void eager_initialize();
37-
}
20+
namespace KokkosKernels {
21+
// \brief Eagerly initialize handles for all enabled TPLs, as well
22+
// as any other globally shared resources that would otherwise be lazily initialized.
23+
//
24+
// Eagerly initializing a TPL means that it doesn't have to be
25+
// lazily initialized when first calling a kernel that uses it.
26+
// For example, \c eager_initialize() will call \c cusparseCreate() upfront
27+
// so that the first call to \c KokkosSparse::spmv doesn't have to.
28+
// This can add a significant amount of apparent runtime to that first kernel
29+
// call, even though the added time isn't really spent in the kernel.
30+
//
31+
// Calling this before using any kernels/TPLs is optional.
32+
// This function is idempotent (any calls after the first have no effect).
33+
//
34+
// \pre \c Kokkos::initialize() has been called.
35+
void eager_initialize();
36+
} // namespace KokkosKernels
3837

3938
#endif
40-

common/unit_test/Test_Common_EagerInitialize.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919

2020
#include "KokkosKernels_EagerInitialize.hpp"
2121

22-
TEST_F(TestCategory, common_eager_initialize)
23-
{
22+
TEST_F(TestCategory, common_eager_initialize) {
2423
KokkosKernels::eager_initialize();
2524
KokkosKernels::eager_initialize();
2625
};

0 commit comments

Comments
 (0)