Skip to content

[Draft] runtime: Add initial Xilinx Runtime Library (XRT) support #7668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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