mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/13065 - Open-source Caffe2 Int8 (quantized) operators Reviewed By: Yangqing Differential Revision: D10524381 fbshipit-source-id: 6daa153dc247572900c91e37262d033c368b382d
17 lines
402 B
C++
17 lines
402 B
C++
#include <mutex>
|
|
|
|
#include <qnnpack.h>
|
|
|
|
#include "caffe2/core/logging.h"
|
|
|
|
namespace caffe2 {
|
|
|
|
void initQNNPACK() {
|
|
static std::once_flag once;
|
|
static enum qnnp_status qnnpackStatus = qnnp_status_uninitialized;
|
|
std::call_once(once, []() { qnnpackStatus = qnnp_initialize(); });
|
|
CAFFE_ENFORCE(
|
|
qnnpackStatus == qnnp_status_success, "failed to initialize QNNPACK");
|
|
}
|
|
|
|
} // namespace caffe2
|