cuda_nvml.cpp 759 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
/*************************************************************************
 * Copyright (c) 2022-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 *
 * See LICENSE for license information.
 ************************************************************************/

#include "cuda_nvml.h"

#include "shared_lib_wrapper.h"

namespace transformer_engine {

namespace cuda_nvml {
yuguo's avatar
yuguo committed
14
#ifndef __HIP_PLATFORM_AMD__
15
16
17
18
19
20
21
22
23

/*! \brief Lazily-initialized shared library for CUDA NVML */
Library &cuda_nvml_lib() {
  constexpr char lib_name[] = "libnvidia-ml.so.1";
  static Library lib(lib_name);
  return lib;
}

void *get_symbol(const char *symbol) { return cuda_nvml_lib().get_symbol(symbol); }
yuguo's avatar
yuguo committed
24
#endif
25
26
27
}  // namespace cuda_nvml

}  // namespace transformer_engine