Files
pytorch/torch/csrc/jit/fuser/cpu/dynamic_library.h
Zachary DeVito 356a94b64e Lazily load libcuda libnvrtc from c++ (#17317)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/16860
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17317

Differential Revision: D14157877

Pulled By: zdevito

fbshipit-source-id: c37aec2d77c2e637d4fc6ceffe2bd32901c70317
2019-02-22 13:51:45 -08:00

30 lines
490 B
C++

#pragma once
#include <c10/util/Exception.h>
#include <torch/csrc/utils/disallow_copy.h>
namespace torch {
namespace jit {
namespace fuser {
namespace cpu {
struct DynamicLibrary {
TH_DISALLOW_COPY_AND_ASSIGN(DynamicLibrary);
DynamicLibrary(const char* name);
void* sym(const char* name);
~DynamicLibrary();
static std::string directoryOf(void* addr);
private:
void* handle = nullptr;
};
} // namespace cpu
} // namespace fuser
} // namespace jit
} // namespace torch