nvtx.h 680 Bytes
Newer Older
1
/*************************************************************************
2
 * Copyright (c) 2022-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3
4
5
6
7
8
9
 *
 * See LICENSE for license information.
 ************************************************************************/

#ifndef TRANSFORMER_ENGINE_COMMON_NVTX_H_
#define TRANSFORMER_ENGINE_COMMON_NVTX_H_

Reese Wang's avatar
Reese Wang committed
10
#include <nvtx3/nvToolsExt.h>
11

12
13
#include <string>

14
15
16
namespace transformer_engine::nvtx {

struct NVTXWrapper {
17
  explicit NVTXWrapper(const std::string &name) { nvtxRangePush(name.c_str()); }
18

19
  ~NVTXWrapper() { nvtxRangePop(); }
20
21
22
23
24
};

}  // namespace transformer_engine::nvtx

#endif  // TRANSFORMER_ENGINE_COMMON_NVTX_H_