-
Notifications
You must be signed in to change notification settings - Fork 34
/
ArborX_DetailsKokkosExtScopedProfileRegion.hpp
47 lines (38 loc) · 1.51 KB
/
ArborX_DetailsKokkosExtScopedProfileRegion.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/****************************************************************************
* Copyright (c) 2017-2023 by the ArborX authors *
* All rights reserved. *
* *
* This file is part of the ArborX library. ArborX is *
* distributed under a BSD 3-clause license. For the licensing terms see *
* the LICENSE file in the top-level directory. *
* *
* SPDX-License-Identifier: BSD-3-Clause *
****************************************************************************/
#ifndef ARBORX_DETAILS_KOKKOS_EXT_SCOPED_PROFILE_REGION_HPP
#define ARBORX_DETAILS_KOKKOS_EXT_SCOPED_PROFILE_REGION_HPP
#include <Kokkos_Macros.hpp>
#if KOKKOS_VERSION >= 40099
#include <Kokkos_Profiling_ScopedRegion.hpp>
namespace KokkosExt
{
using ScopedProfileRegion = Kokkos::Profiling::ScopedRegion;
}
#else
#include <Kokkos_Core.hpp>
#include <string>
namespace KokkosExt
{
class ScopedProfileRegion
{
public:
ScopedProfileRegion(ScopedProfileRegion const &) = delete;
ScopedProfileRegion &operator=(ScopedProfileRegion const &) = delete;
explicit ScopedProfileRegion(std::string const &name)
{
Kokkos::Profiling::pushRegion(name);
}
~ScopedProfileRegion() { Kokkos::Profiling::popRegion(); }
};
} // namespace KokkosExt
#endif
#endif