TVM  0.9.4
IdProvider.h
Go to the documentation of this file.
1 
3 #pragma once
4 
5 #include <tvm/api.h>
6 
7 #include <mutex>
8 
9 namespace tvm
10 {
11 
12 namespace internal
13 {
16 {
17 public:
18  int makeId();
19 
20 private:
21  std::mutex mutex_;
22  int id_ = 0;
23 };
24 
25 inline int IdProvider::makeId()
26 {
27  std::lock_guard<std::mutex> lock(mutex_);
28  return id_++;
29 }
30 } // namespace internal
31 
32 } // namespace tvm
#define TVM_DLLAPI
Definition: api.h:35
Definition: IdProvider.h:16
int makeId()
Definition: IdProvider.h:25
Definition: Clock.h:12