1#ifndef HALIDE_HALIDERUNTIMEVULKAN_H
2#define HALIDE_HALIDERUNTIMEVULKAN_H
5#ifndef HALIDE_HALIDERUNTIME_H
18#define HALIDE_RUNTIME_VULKAN
21#ifndef VK_DEFINE_HANDLE
23#define HALIDE_VULKAN_DEFINE_HANDLE(object) typedef struct object##_T *(object);
25#ifndef HALIDE_VULKAN_USE_64_BIT_PTR_DEFINES
26#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64) || defined(__ia64) || defined(_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) || (defined(__riscv) && __riscv_xlen == 64)
27#define HALIDE_VULKAN_USE_64_BIT_PTR_DEFINES 1
29#define HALIDE_VULKAN_USE_64_BIT_PTR_DEFINES 0
33#ifndef HALIDE_VULKAN_DEFINE_NON_DISPATCHABLE_HANDLE
34#if (HALIDE_VULKAN_USE_64_BIT_PTR_DEFINES == 1)
35#define HALIDE_VULKAN_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *(object);
37#define HALIDE_VULKAN_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t(object);
56 const char *src,
int size);
60 const char *entry_name,
61 int blocksX,
int blocksY,
int blocksZ,
62 int threadsX,
int threadsY,
int threadsZ,
92struct halide_vulkan_memory_allocator;
94 struct halide_vulkan_memory_allocator **
allocator,
97 VkPhysicalDevice *physical_device,
100 VkDebugUtilsMessengerEXT *messenger,
107 VkDebugUtilsMessengerEXT messenger);
This file declares the routines used by Halide internally in its runtime.
const char * halide_vulkan_get_layer_names(void *user_context)
#define HALIDE_VULKAN_DEFINE_NON_DISPATCHABLE_HANDLE(object)
int halide_vulkan_initialize_kernels(void *user_context, void **state_ptr, const char *src, int size)
These are forward declared here to allow clients to override the Halide Vulkan runtime.
void halide_vulkan_set_extension_names(const char *n)
int halide_vulkan_acquire_context(void *user_context, struct halide_vulkan_memory_allocator **allocator, VkInstance *instance, VkDevice *device, VkPhysicalDevice *physical_device, VkQueue *queue, uint32_t *queue_family_index, VkDebugUtilsMessengerEXT *messenger, bool create=true)
const struct VkAllocationCallbacks * halide_vulkan_get_allocation_callbacks(void *user_context)
void halide_vulkan_set_build_options(const char *n)
void halide_vulkan_set_layer_names(const char *n)
int halide_vulkan_release_context(void *user_context, VkInstance instance, VkDevice device, VkQueue queue, VkDebugUtilsMessengerEXT messenger)
void halide_vulkan_set_device_type(const char *n)
const char * halide_vulkan_get_extension_names(void *user_context)
const char * halide_vulkan_get_device_type(void *user_context)
int halide_vulkan_run(void *user_context, void *state_ptr, const char *entry_name, int blocksX, int blocksY, int blocksZ, int threadsX, int threadsY, int threadsZ, int shared_mem_bytes, size_t arg_sizes[], void *args[], int8_t arg_is_buffer[])
const struct halide_device_interface_t * halide_vulkan_device_interface()
void halide_vulkan_finalize_kernels(void *user_context, void *state_ptr)
#define HALIDE_VULKAN_DEFINE_HANDLE(object)
void halide_vulkan_set_allocation_callbacks(const struct VkAllocationCallbacks *callbacks)
const char * halide_vulkan_get_build_options(void *user_context)
unsigned __INT32_TYPE__ uint32_t
signed __INT8_TYPE__ int8_t
Each GPU API provides a halide_device_interface_t struct pointing to the code that manages device all...
VulkanMemoryAllocator * allocator