Skip to content

The C++ backend needs a better solution for Halide runtime #5338

@steven-johnson

Description

@steven-johnson

At present, if you want to use the C++ backend in real code, you don't have a good solution for the Halide runtime:

  • the "normal" Halide runtime will link and work properly with this backend, but if you are using the C++ backend it may be because you have an unusual target that isn't supported well (or at all) by LLVM (e.g., an OS or architecture with bespoke compilers), so this may not be an option.
  • write your own runtime stubs based on what you need. This can be error prone and is a big barrier to experimentation on such systems.

Surely we can do better. Random thoughts:

  • Provide a "bare-bones" plain-posix C++ runtime example that can serve as a decent starting point for new platforms (with the assumption that it will be customized).
  • Provide a way to selectively embed the existing runtime C++ source code in our C++ output. We already do this for some inlined stuff, eg HalideRuntime.h, buffer accessors, so maybe we could do it for arbitrary runtime code as well?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew user-visible features or improvements to existing features.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions