Arcane
4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Cupti.h
1
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2
//-----------------------------------------------------------------------------
3
// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4
// See the top-level COPYRIGHT file for details.
5
// SPDX-License-Identifier: Apache-2.0
6
//-----------------------------------------------------------------------------
7
/*---------------------------------------------------------------------------*/
8
/* Cupti.h (C) 2000-2025 */
9
/* */
10
/* CUPTI Integration. */
11
/*---------------------------------------------------------------------------*/
12
#ifndef ARCCORE_ACCELERATOR_NATIVE_RUNTIME_CUPTI_H
13
#define ARCCORE_ACCELERATOR_NATIVE_RUNTIME_CUPTI_H
14
/*---------------------------------------------------------------------------*/
15
/*---------------------------------------------------------------------------*/
16
17
#include "arccore/base/FixedArray.h"
18
19
#include "arccore/accelerator_native/CudaAccelerator.h"
20
21
#ifdef ARCCORE_HAS_CUDA_CUPTI
22
#include <cuda.h>
23
#include <cupti.h>
24
#endif
25
26
/*---------------------------------------------------------------------------*/
27
/*---------------------------------------------------------------------------*/
28
29
namespace
Arcane::Accelerator::Cuda
30
{
31
32
/*---------------------------------------------------------------------------*/
33
/*---------------------------------------------------------------------------*/
34
38
class
CuptiInfo
39
{
40
public
:
41
42
void
init(
Int32
level,
bool
do_print)
43
{
44
m_profiling_level = level;
45
m_do_print = do_print;
46
}
47
bool
isActive()
const
{
return
m_is_active; }
48
49
public
:
50
51
#ifdef ARCCORE_HAS_CUDA_CUPTI
52
void
start();
53
void
stop();
54
void
flush();
55
#else
56
void
start() {}
57
void
stop() {}
58
void
flush() {}
59
#endif
60
61
private
:
62
63
#ifdef ARCCORE_HAS_CUDA_CUPTI
64
FixedArray<CUpti_ActivityUnifiedMemoryCounterConfig, 4>
config;
65
CUpti_ActivityPCSamplingConfig configPC;
66
#endif
67
bool
m_is_active =
false
;
68
bool
m_do_print =
true
;
69
int
m_profiling_level = 0;
70
};
71
72
/*---------------------------------------------------------------------------*/
73
/*---------------------------------------------------------------------------*/
74
75
}
// namespace Arcane::Accelerator::Cuda
76
77
/*---------------------------------------------------------------------------*/
78
/*---------------------------------------------------------------------------*/
79
80
#endif
Arcane::Accelerator::Cuda::CuptiInfo
Singleton class to manage CUPTI.
Definition
Cupti.h:39
Arcane::FixedArray
Fixed-size 1D array.
Definition
arccore/src/base/arccore/base/FixedArray.h:46
Arcane::Int32
std::int32_t Int32
Signed integer type of 32 bits.
Definition
ArccoreGlobal.h:233
arccore
src
accelerator_native
arccore
accelerator_native
runtime
Cupti.h
Generated on
for Arcane by
1.16.1