MNN
1.0
|
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
类 | |
struct | halide_type_t |
struct | halide_device_interface_t |
struct | halide_dimension_t |
struct | halide_buffer_t |
宏定义 | |
#define | HALIDE_ALWAYS_INLINE __attribute__((always_inline)) inline |
#define | HALIDE_NEVER_INLINE __attribute__((noinline)) |
#define | HALIDE_ATTRIBUTE_ALIGN(x) __attribute__((aligned(x))) |
类型定义 | |
typedef enum halide_type_code_t | halide_type_code_t |
typedef struct halide_dimension_t | halide_dimension_t |
typedef struct halide_buffer_t | halide_buffer_t |
枚举 | |
enum | halide_type_code_t { halide_type_int = 0, halide_type_uint = 1, halide_type_float = 2, halide_type_handle = 3 } |
enum | halide_buffer_flags { halide_buffer_flag_host_dirty = 1, halide_buffer_flag_device_dirty = 2 } |
This file declares the routines used by Halide internally in its runtime. On platforms that support weak linking, these can be replaced with user-defined versions by defining an extern "C" function with the same name and signature.
When doing Just In Time (JIT) compilation methods on the Func being compiled must be called instead. The corresponding methods are documented below.
All of these functions take a "void *user_context" parameter as their first argument; if the Halide kernel that calls back to any of these functions has been compiled with the UserContext feature set on its Target, then the value of that pointer passed from the code that calls the Halide kernel is piped through to the function.
Some of these are also useful to call when using the default implementation. E.g. halide_shutdown_thread_pool.
Note that even on platforms with weak linking, some linker setups may not respect the override you provide. E.g. if the override is in a shared library and the halide object files are linked directly into the output, the builtin versions of the runtime functions will be called. See your linker documentation for more details. On Linux, LD_DYNAMIC_WEAK=1 may help.
#define HALIDE_ALWAYS_INLINE __attribute__((always_inline)) inline |
#define HALIDE_ATTRIBUTE_ALIGN | ( | x | ) | __attribute__((aligned(x))) |
#define HALIDE_NEVER_INLINE __attribute__((noinline)) |
typedef struct halide_buffer_t halide_buffer_t |
The raw representation of an image passed around by generated Halide code. It includes some stuff to track whether the image is not actually in main memory, but instead on a device (like a GPU). For a more convenient C++ wrapper, use Halide::Buffer<T>.
typedef struct halide_dimension_t halide_dimension_t |
typedef enum halide_type_code_t halide_type_code_t |
Types in the halide type system. They can be ints, unsigned ints, or floats (of various bit-widths), or a handle (which is always 64-bits). Note that the int/uint/float values do not imply a specific bit width (the bit width is expected to be encoded in a separate value).
enum halide_buffer_flags |
enum halide_type_code_t |
Types in the halide type system. They can be ints, unsigned ints, or floats (of various bit-widths), or a handle (which is always 64-bits). Note that the int/uint/float values do not imply a specific bit width (the bit width is expected to be encoded in a separate value).
枚举值 | |
---|---|
halide_type_int | signed integers |
halide_type_uint | unsigned integers |
halide_type_float | floating point numbers |
halide_type_handle | opaque pointer type (void *) |