blob: 62c44b0b38b3e19d9dafa7780b2a6052e9ea4bab [file] [log] [blame]
#include "caffe2/onnx/onnxifi_init.h"
#include <mutex>
#include "caffe2/core/logging.h"
namespace caffe2 {
namespace onnx {
onnxifi_library* initOnnxifiLibrary() {
static std::once_flag once;
static onnxifi_library core{};
std::call_once(once, []() {
auto ret =
onnxifi_load(ONNXIFI_LOADER_FLAG_VERSION_1_0, nullptr, &core);
if (!ret) {
CAFFE_THROW("Cannot load onnxifi lib");
}
});
return &core;
}
} // namespace onnx
} // namespace caffe2