Halide 17.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
vulkan_interface.h
Go to the documentation of this file.
1#ifndef HALIDE_RUNTIME_VULKAN_INTERFACE_H
2#define HALIDE_RUNTIME_VULKAN_INTERFACE_H
3
4#include "runtime_internal.h"
5
6// --------------------------------------------------------------------------
7// Vulkan Specific Definitions
8// --------------------------------------------------------------------------
9
10// Vulkan API version identifier macro
11#define VK_MAKE_API_VERSION(variant, major, minor, patch) \
12 ((((uint32_t)(variant)) << 29) | (((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch)))
13
14// Vulkan API version 1.0.0
15#define VK_API_VERSION_1_0 VK_MAKE_API_VERSION(0, 1, 0, 0) // Patch version should always be set to 0
16
17// Environment variable string delimiter
18#ifdef WINDOWS
19#define HL_VK_ENV_DELIM ";"
20#else
21#define HL_VK_ENV_DELIM ":"
22#endif
23
24// Prototypes for the subset of the Vulkan API we need
25#define VK_NO_PROTOTYPES
26// NOLINTNEXTLINE
27#include "mini_vulkan.h"
28
29// --------------------------------------------------------------------------
30// Vulkan API Definition
31// --------------------------------------------------------------------------
32
33namespace Halide {
34namespace Runtime {
35namespace Internal {
36namespace Vulkan {
37
38// --------------------------------------------------------------------------
39
40// Halide device interface struct for runtime specific funtion table
42
43// --------------------------------------------------------------------------
44
45// clang-format off
46#define VULKAN_FN(fn) WEAK PFN_##fn fn;
47#include "vulkan_functions.h"
48#undef VULKAN_FN
49// clang-format on
50
52#define VULKAN_FN(fn) fn = (PFN_##fn)vkGetInstanceProcAddr(instance, #fn);
53#include "vulkan_functions.h"
54#undef VULKAN_FN
55}
56
57// --
58
59// --------------------------------------------------------------------------
60
61} // namespace Vulkan
62} // namespace Internal
63} // namespace Runtime
64} // namespace Halide
65
66#endif // HALIDE_RUNTIME_VULKAN_INTERFACE_H
WEAK halide_device_interface_t vulkan_device_interface
void WEAK vk_load_vulkan_functions(VkInstance instance)
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Expr cast(Expr a)
Cast an expression to the halide type corresponding to the C++ type T.
Definition IROperator.h:364
#define WEAK
Each GPU API provides a halide_device_interface_t struct pointing to the code that manages device all...