Skip to content
Discussion options

You must be logged in to vote

That is fine. There are other ways to do it as well, such as pulling the V128/V256/V512 code into their own methods. i.e.

if (Vector512.IsHardwareAccelerated)
{
    if (remainder >= Vector512<T>.Count)
    {
        Vectorized512(...)
    }
    else
    {
        VectorizedSmall(...);
    }
}
else if (Vector256.IsHardwareAccelerated)
{
    if (remainder >= Vector256<T>.Count)
    {
        Vectorized256(...)
    }
    else
    {
        VectorizedSmall(...);
    }
}
else if (Vector128.IsHardwareAccelerated)
{
    if (remainder >= Vector128<T>.Count)
    {
        Vectorized128(...)
    }
    else
    {
        VectorizedSmall(...);
    }
}
else
{
    SoftwareFallback(...);
}

This makes it…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@DrkWzrd
Comment options

@tannergooding
Comment options

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