You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
572 B
35 lines
572 B
5 months ago
|
#pragma once
|
||
|
|
||
|
#include <ATen/Utils.h>
|
||
|
#include <c10/macros/Export.h>
|
||
|
#include <c10/util/Exception.h>
|
||
|
|
||
|
namespace c10 {
|
||
|
|
||
|
class DynamicLibraryError : public Error {
|
||
|
using Error::Error;
|
||
|
};
|
||
|
|
||
|
} // namespace c10
|
||
|
|
||
|
namespace at {
|
||
|
|
||
|
struct DynamicLibrary {
|
||
|
AT_DISALLOW_COPY_AND_ASSIGN(DynamicLibrary);
|
||
|
|
||
|
TORCH_API DynamicLibrary(
|
||
|
const char* name,
|
||
|
const char* alt_name = nullptr,
|
||
|
bool leak_handle = false);
|
||
|
|
||
|
TORCH_API void* sym(const char* name);
|
||
|
|
||
|
TORCH_API ~DynamicLibrary();
|
||
|
|
||
|
private:
|
||
|
bool leak_handle;
|
||
|
void* handle = nullptr;
|
||
|
};
|
||
|
|
||
|
} // namespace at
|