Skip to content

Commit

Permalink
runtime: Add initial Xilinx Runtime Library (XRT) support
Browse files Browse the repository at this point in the history
  • Loading branch information
xerpi committed Jul 1, 2023
1 parent 9755e3d commit 519489e
Show file tree
Hide file tree
Showing 6 changed files with 2,167 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ set(RUNTIME_CPP
windows_yield
write_debug_image
x86_cpu_features
xrt
)

set(RUNTIME_LL
Expand Down Expand Up @@ -139,6 +140,7 @@ set(RUNTIME_HEADER_FILES
HalideRuntimeQurt.h
HalideRuntimeVulkan.h
HalideRuntimeWebGPU.h
HalideRuntimeXRT.h
)

# Need to create an object library for this because CMake
Expand Down
41 changes: 41 additions & 0 deletions src/runtime/HalideRuntimeXRT.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#ifndef HALIDE_HALIDERUNTIMEXRT_H
#define HALIDE_HALIDERUNTIMEXRT_H

// Don't include HalideRuntime.h if the contents of it were already pasted into a generated header above this one
#ifndef HALIDE_HALIDERUNTIME_H

#include "HalideRuntime.h"

#endif

#ifdef __cplusplus
extern "C" {
#endif

/** \file
* Routines specific to the Halide XRT runtime.
*/

#define HALIDE_RUNTIME_XRT

extern const struct halide_device_interface_t *halide_xrt_device_interface();

/** These are forward declared here to allow clients to override the
* Halide XRT runtime. Do not call them. */
// @{
extern int halide_xrt_initialize_kernels(void *user_context, void **state_ptr,
const char *kernel_name);
extern int halide_xrt_run(void *user_context,
void *state_ptr,
const char *entry_name,
halide_type_t arg_types[],
void *args[],
int8_t arg_is_buffer[]);
extern void halide_xrt_finalize_kernels(void *user_context, void *state_ptr);
// @}

#ifdef __cplusplus
} // End extern "C"
#endif

#endif // HALIDE_HALIDERUNTIMEXRT_H
Loading

0 comments on commit 519489e

Please sign in to comment.