doc/API/html/structhalide__device__interface__t.html
| MNN 1.0 |
Public 属性 | [所有成员列表](structhalide device interface__t-members.html)
halide_device_interface_t结构体 参考
#include <HalideRuntime.h>
|
| | int(* | [device_malloc](structhalide device interface__t.html#aefe045212c1c0cc8993ad77b4c7d793b) )(void *user_context, struct halide_buffer_t *buf, const struct [halide_device_interface_t](structhalide__device interface t.html) *device_interface) | | | | int(* | [device_free](structhalide device interface__t.html#ab0bd6619c5acb90929eefa8c94488ebe) )(void *user_context, struct halide_buffer_t *buf) | | | | int(* | [device_sync](structhalide device interface__t.html#ac7e27bf4acf3d42a41bca1ca15088170) )(void *user_context, struct halide_buffer_t *buf) | | | | void(* | [device_release](structhalide device interface__t.html#a8d54f5cfdce5abfe5079e746ec6e9a32) )(void *user_context, const struct [halide_device_interface_t](structhalide__device interface t.html) *device_interface) | | | | int(* | [copy_to_host](structhalide device interface__t.html#a94496f4e1181af69213ee72ad4e2664a) )(void *user_context, struct halide_buffer_t *buf) | | | | int(* | [copy_to_device](structhalide device interface__t.html#aa7ec93c5a376610e3e7100e8b389591f) )(void *user_context, struct halide_buffer_t *buf, const struct [halide_device_interface_t](structhalide__device interface t.html) *device_interface) | | | | int(* | [device_and_host_malloc](structhalide device interface__t.html#a0caa167abc636a7c7af4c602496e61cd) )(void *user_context, struct halide_buffer_t *buf, const struct [halide_device_interface_t](structhalide__device interface t.html) *device_interface) | | | | int(* | [device_and_host_free](structhalide device interface__t.html#adfe1bff4d8a864c6450bfe10adbed304) )(void *user_context, struct halide_buffer_t *buf) | | | | int(* | [buffer_copy](structhalide device interface__t.html#af8cf3a57fb9d7b7e5906e5f5a5d87145) )(void *user_context, struct halide_buffer_t *src, const struct [halide_device_interface_t](structhalide__device interface t.html) *dst_device_interface, struct [halide_buffer_t](structhalide buffer t.html) *dst) | | | | int(* | [device_crop](structhalide device interface__t.html#a8a091d3679d588771f88172b8a867bd2) )(void *user_context, const struct halide_buffer_t *src, struct halide_buffer_t *dst) | | | | int(* | [device_release_crop](structhalide device interface__t.html#a3a61cbd45258f14821c95f9b62d38d29) )(void *user_context, struct halide_buffer_t *buf) | | | | int(* | [wrap_native](structhalide device interface__t.html#a165c8b301ca4f0013af7767a63afd753) )(void *user_context, struct halide_buffer_t *buf, uint64_t handle, const struct [halide_device_interface_t](structhalide__device interface t.html) *device_interface) | | | | int(* | [detach_native](structhalide device interface__t.html#ad22c6f186583b56c91652261e905038f) )(void *user_context, struct halide_buffer_t *buf) | | | | const struct halide_device_interface_impl_t * | [impl](structhalide device interface__t.html#a0fd396e5aa336a352d86cff51e6099dd) | | |
Each GPU API provides a [halide_device_interface_t](structhalide device interface__t.html) struct pointing to the code that manages device allocations. You can access these functions directly from the struct member function pointers, or by calling the functions declared below. Note that the global functions are not available when using Halide as a JIT compiler. If you are using raw halide_buffer_t in that context you must use the function pointers in the device_interface struct.
The function pointers below are currently the same for every GPU API; only the impl field varies. These top-level functions do the bookkeeping that is common across all GPU APIs, and then dispatch to more API-specific functions via another set of function pointers hidden inside the impl field.
| int(* halide_device_interface_t::buffer_copy) (void *user_context, struct [halide_buffer_t](structhalide buffer t.html) *src, const struct [halide_device_interface_t](structhalide device interface__t.html) *dst_device_interface, struct halide_buffer_t *dst) |
| int(* halide_device_interface_t::copy_to_device) (void *user_context, struct [halide_buffer_t](structhalide buffer t.html) *buf, const struct [halide_device_interface_t](structhalide device interface__t.html) *device_interface) |
| int(* halide_device_interface_t::copy_to_host) (void *user_context, struct [halide_buffer_t](structhalide buffer t.html) *buf) |
| int(* halide_device_interface_t::detach_native) (void *user_context, struct [halide_buffer_t](structhalide buffer t.html) *buf) |
| int(* halide_device_interface_t::device_and_host_free) (void *user_context, struct [halide_buffer_t](structhalide buffer t.html) *buf) |
| int(* halide_device_interface_t::device_and_host_malloc) (void *user_context, struct [halide_buffer_t](structhalide buffer t.html) *buf, const struct [halide_device_interface_t](structhalide device interface__t.html) *device_interface) |
| int(* halide_device_interface_t::device_crop) (void *user_context, const struct [halide_buffer_t](structhalide buffer t.html) *src, struct [halide_buffer_t](structhalide buffer t.html) *dst) |
| int(* halide_device_interface_t::device_free) (void *user_context, struct [halide_buffer_t](structhalide buffer t.html) *buf) |
| int(* halide_device_interface_t::device_malloc) (void *user_context, struct [halide_buffer_t](structhalide buffer t.html) *buf, const struct [halide_device_interface_t](structhalide device interface__t.html) *device_interface) |
| void(* halide_device_interface_t::device_release) (void *user_context, const struct [halide_device_interface_t](structhalide device interface__t.html) *device_interface) |
| int(* halide_device_interface_t::device_release_crop) (void *user_context, struct [halide_buffer_t](structhalide buffer t.html) *buf) |
| int(* halide_device_interface_t::device_sync) (void *user_context, struct [halide_buffer_t](structhalide buffer t.html) *buf) |
| const struct halide_device_interface_impl_t* halide_device_interface_t::impl |
| int(* halide_device_interface_t::wrap_native) (void *user_context, struct [halide_buffer_t](structhalide buffer t.html) *buf, uint64_t handle, const struct [halide_device_interface_t](structhalide device interface__t.html) *device_interface) |
该结构体的文档由以下文件生成: