nnpack_utils.h 626 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/*!
 *  Copyright (c) 2017 by Contributors
 * \file Use external nnpack library call.
 */
#ifndef TVM_CONTRIB_NNPACK_NNPACK_UTILS_H_
#define TVM_CONTRIB_NNPACK_NNPACK_UTILS_H_
#include <tvm/runtime/registry.h>
#include <tvm/runtime/util.h>
#include <dmlc/thread_local.h>
#include <dmlc/logging.h>
#include <nnpack.h>

namespace tvm {
namespace contrib {
using namespace runtime;

struct NNPackThreadLocalEntry {
  pthreadpool_t threadpool{NULL};
  static NNPackThreadLocalEntry* ThreadLocal();
};
21 22

bool NNPackConfig(uint64_t nthreads);
23 24 25
}  // namespace contrib
}  // namespace tvm
#endif  // TVM_CONTRIB_NNPACK_NNPACK_UTILS_H_