blob: 0c1f39f8883a24752c92c3fda490c5c94fa9d907 [file] [log] [blame]
XNNPACK Teamb455b122019-09-27 18:10:33 -07001// Copyright (c) Facebook, Inc. and its affiliates.
2// All rights reserved.
3//
4// Copyright 2019 Google LLC
5//
6// This source code is licensed under the BSD-style license found in the
7// LICENSE file in the root directory of this source tree.
8
9#pragma once
10
11#include <inttypes.h>
12
13#include <clog.h>
14
Marat Dukhan3b59de22020-06-03 20:15:19 -070015#include <xnnpack/operator.h>
16#include <xnnpack/subgraph.h>
17
XNNPACK Teamb455b122019-09-27 18:10:33 -070018#ifndef XNN_LOG_LEVEL
Marat Dukhanc8e00eb2019-10-04 14:55:26 -070019 #error "Undefined XNN_LOG_LEVEL"
XNNPACK Teamb455b122019-09-27 18:10:33 -070020#endif
21
22CLOG_DEFINE_LOG_DEBUG(xnn_log_debug, "XNNPACK", XNN_LOG_LEVEL);
23CLOG_DEFINE_LOG_INFO(xnn_log_info, "XNNPACK", XNN_LOG_LEVEL);
24CLOG_DEFINE_LOG_WARNING(xnn_log_warning, "XNNPACK", XNN_LOG_LEVEL);
25CLOG_DEFINE_LOG_ERROR(xnn_log_error, "XNNPACK", XNN_LOG_LEVEL);
26CLOG_DEFINE_LOG_FATAL(xnn_log_fatal, "XNNPACK", XNN_LOG_LEVEL);
Marat Dukhan3b59de22020-06-03 20:15:19 -070027
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#if XNN_LOG_LEVEL == 0
33 inline static const char* xnn_operator_type_to_string(enum xnn_operator_type type) {
34 return "Unknown";
35 }
36
37 inline static const char* xnn_node_type_to_string(enum xnn_node_type type) {
38 return "Unknown";
39 }
40#else
41 const char* xnn_operator_type_to_string(enum xnn_operator_type type);
42 const char* xnn_node_type_to_string(enum xnn_node_type type);
43#endif
44
45#ifdef __cplusplus
46} // extern "C"
47#endif