Caffe2 - C++ API
A deep learning, cross platform ML framework
libshm.h
1 #pragma once
2 
3 #include <TH/TH.h>
4 
5 #ifdef __cplusplus
6 
7 #ifdef SHM_EXPORTS
8 # define SHM_API __declspec(dllexport)
9 #else
10 # define SHM_API __declspec(dllimport)
11 #endif
12 
13 SHM_API void libshm_init(const char *manager_exec_path);
14 
15 class SHM_API THManagedMapAllocator : public THRefcountedMapAllocator {
16 public:
17  THManagedMapAllocator(const char* manager_handle, const char* filename, int flags, ptrdiff_t size)
18  : THRefcountedMapAllocator(filename, flags, size) {}
19 
20  static at::DataPtr makeDataPtr(const char* manager_handle, const char* filename, int flags, ptrdiff_t size);
21  static THManagedMapAllocator* fromDataPtr(const at::DataPtr&);
22 
23  const char* manager_handle() const { return "no_manager"; }
24 };
25 
26 #endif