#ifndef __MACH__
#define _POSIX_C_SOURCE …
#endif
#include <assert.h>
#include <inttypes.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "xnnpack.h"
#include "xnnpack/allocation-type.h"
#include "xnnpack/allocator.h"
#include "xnnpack/cache.h"
#include "xnnpack/common.h"
#include "xnnpack/log.h"
#include "xnnpack/memory-planner.h"
#include "xnnpack/memory.h"
#include "xnnpack/microkernel-type.h"
#include "xnnpack/node-type.h"
#include "xnnpack/operator-type.h"
#include "xnnpack/operator.h"
#include "xnnpack/params.h"
#include "xnnpack/subgraph.h"
#include "pthreadpool.h"
#if defined(__EMSCRIPTEN__)
#include <emscripten/emscripten.h>
#elif XNN_PLATFORM_WINDOWS
#include <windows.h>
#else
#include <errno.h>
#include <time.h>
#endif
#ifndef XNN_ENABLE_JIT
#error "XNN_ENABLE_JIT is not defined"
#endif
enum xnn_status xnn_reshape_external_value(
xnn_runtime_t runtime,
uint32_t external_id,
size_t num_dims,
const size_t* dims) { … }
enum xnn_status
xnn_get_external_value_shape(xnn_runtime_t runtime, uint32_t external_id, size_t* num_dims, size_t* dims)
{ … }
enum xnn_status xnn_create_workspace(xnn_workspace_t* workspace_out)
{ … }
static inline void xnn_retain_workspace(xnn_workspace_t workspace)
{ … }
enum xnn_status xnn_release_workspace(xnn_workspace_t workspace)
{ … }
enum xnn_status xnn_create_weights_cache_with_size(size_t size, xnn_weights_cache_t* weights_cache_out)
{ … }
enum xnn_status xnn_create_weights_cache(xnn_weights_cache_t* weights_cache_out)
{ … }
enum xnn_status xnn_delete_weights_cache(xnn_weights_cache_t weights_cache)
{ … }
enum xnn_status xnn_create_runtime(
xnn_subgraph_t subgraph,
xnn_runtime_t* runtime_out)
{ … }
enum xnn_status xnn_create_runtime_v2(
xnn_subgraph_t subgraph,
pthreadpool_t threadpool,
uint32_t flags,
xnn_runtime_t* runtime_out)
{ … }
enum xnn_status xnn_create_runtime_v3(
xnn_subgraph_t subgraph,
xnn_weights_cache_t weights_cache,
pthreadpool_t threadpool,
uint32_t flags,
xnn_runtime_t* runtime_out)
{ … }
static enum xnn_status initialize_workspace_values(
xnn_runtime_t runtime,
struct xnn_value_allocation_tracker* mem_alloc_tracker,
size_t old_persistent_size)
{ … }
static bool input_memory_can_be_reused(const xnn_runtime_t runtime, size_t input_id, size_t output_id)
{ … }
static void optimize_tensor_allocation_for_in_place_operations(
struct xnn_value_allocation_tracker* tracker,
const xnn_runtime_t runtime)
{ … }
enum xnn_status xnn_create_runtime_v4(
xnn_subgraph_t subgraph,
xnn_weights_cache_t weights_cache,
xnn_workspace_t workspace,
pthreadpool_t threadpool,
uint32_t flags,
xnn_runtime_t* runtime_out)
{ … }
enum xnn_status xnn_plan_memory(
xnn_runtime_t runtime) { … }
enum xnn_status xnn_reshape_runtime(
xnn_runtime_t runtime)
{ … }
enum xnn_status xnn_setup_runtime(
xnn_runtime_t runtime,
size_t num_external_values,
const struct xnn_external_value* external_values)
{ … }
enum xnn_status xnn_setup_runtime_v2(
xnn_runtime_t runtime,
size_t num_external_values,
const struct xnn_external_value* external_values)
{ … }
static xnn_timestamp xnn_read_timer() { … }
static inline uint64_t xnn_get_elapsed_time(const xnn_timestamp* start, const xnn_timestamp* end) { … }
enum xnn_status xnn_get_runtime_profiling_info(xnn_runtime_t runtime,
enum xnn_profile_info param_name,
size_t param_value_size,
void* param_value,
size_t* param_value_size_ret)
{ … }
enum xnn_status xnn_invoke_runtime(
xnn_runtime_t runtime)
{ … }
enum xnn_status xnn_delete_runtime(
xnn_runtime_t runtime)
{ … }