Skip to content
Discussion options

You must be logged in to vote

USE_RUNTIME my_runtime needs to be applied to every add_halide_library() target that should share the same Halide runtime, not just one of them

If any of the AOT libraries is still built without USE_RUNTIME, Halide will generate a separate <target>.runtime for that library. That can leave you with multiple copies of the runtime/device-interface state in the same process, which is a common way to get errors like:

halide_copy_to_device does not support switching interfaces

So the important part is that all GPU-using AOT libraries share the same runtime target:

add_halide_runtime(my_runtime TARGETS ${Halide_TARGET})

add_halide_library(func1 FROM func1.generator
    GENERATOR func1
    TARGETS

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@alexreinking
Comment options

@felipegb94
Comment options

@alexreinking
Comment options

Answer selected by alexreinking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants