Skip to content

Commit 9e43db5

Browse files
committed
runtime: Add initial Xilinx Runtime Library (XRT) support
1 parent 9755e3d commit 9e43db5

File tree

6 files changed

+2039
-0
lines changed

6 files changed

+2039
-0
lines changed

src/runtime/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ set(RUNTIME_CPP
9898
windows_yield
9999
write_debug_image
100100
x86_cpu_features
101+
xrt
101102
)
102103

103104
set(RUNTIME_LL
@@ -139,6 +140,7 @@ set(RUNTIME_HEADER_FILES
139140
HalideRuntimeQurt.h
140141
HalideRuntimeVulkan.h
141142
HalideRuntimeWebGPU.h
143+
HalideRuntimeXRT.h
142144
)
143145

144146
# Need to create an object library for this because CMake

src/runtime/HalideRuntimeXRT.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#ifndef HALIDE_HALIDERUNTIMEXRT_H
2+
#define HALIDE_HALIDERUNTIMEXRT_H
3+
4+
// Don't include HalideRuntime.h if the contents of it were already pasted into a generated header above this one
5+
#ifndef HALIDE_HALIDERUNTIME_H
6+
7+
#include "HalideRuntime.h"
8+
9+
#endif
10+
11+
#ifdef __cplusplus
12+
extern "C" {
13+
#endif
14+
15+
/** \file
16+
* Routines specific to the Halide XRT runtime.
17+
*/
18+
19+
#define HALIDE_RUNTIME_XRT
20+
21+
extern const struct halide_device_interface_t *halide_xrt_device_interface();
22+
23+
/** These are forward declared here to allow clients to override the
24+
* Halide XRT runtime. Do not call them. */
25+
// @{
26+
extern int halide_xrt_initialize_kernels(void *user_context, void **state_ptr,
27+
const char *kernel_name);
28+
extern int halide_xrt_run(void *user_context,
29+
void *state_ptr,
30+
const char *entry_name,
31+
halide_type_t arg_types[],
32+
void *args[],
33+
int8_t arg_is_buffer[]);
34+
extern void halide_xrt_finalize_kernels(void *user_context, void *state_ptr);
35+
// @}
36+
37+
#ifdef __cplusplus
38+
} // End extern "C"
39+
#endif
40+
41+
#endif // HALIDE_HALIDERUNTIMEXRT_H

0 commit comments

Comments
 (0)