Skip to content

Targeting unknown systems/targets. #7640

Answered by ashishUthama
Doubl3MD asked this question in Q&A
Discussion options

You must be logged in to vote

Search for 'multi target' with Halide for more info on this. Halide supports runtime dynamic dispatch based on target capability (in this case SIMD family).

In short:

  1. Make your code SIMD width reactive by using native_vector_size
  2. At generation time, specify multi-targets like so: "linux-x86-64-sse41-avx,linux-x86-64-sse41,linux-x86-64". At runtime this causes the code to search in the order specified (left to right), stopping at the first subtarget that is determined to be safe to use.
  3. Create the runtime separately ensuring to pick the common denominator

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@steven-johnson
Comment options

Answer selected by steven-johnson
Comment options

You must be logged in to vote
0 replies
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