native 0.0.1
Vectors, masks and wide register packs for C++26
Loading...
Searching...
No Matches
polyfill_feature_chunk.h
1// SPDX-FileCopyrightText: 2026 Edward Kmett <ekmett@gmail.com>
2// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0
3#pragma once
4namespace native::detail {
5 template<class T,std::size_t N,isa<> A> struct polyfill_feature_chunk;
6}
7#if NATIVE_HOST_NEON
8#define NATIVE_POLYFILL_FEATURE_CHUNK(T,N,A) (polyfill_element_traits<T>::kind==polyfill_element_kind::binary16 && N==8 && neon_fp16<=A)
9#pragma clang attribute push(__attribute__((target("neon,fullfp16"))), apply_to=function)
10#include "native/simd/polyfill_feature_chunk_body.h"
11#pragma clang attribute pop
12#undef NATIVE_POLYFILL_FEATURE_CHUNK
13#define NATIVE_POLYFILL_FEATURE_CHUNK(T,N,A) (polyfill_element_traits<T>::kind==polyfill_element_kind::bfloat16 && N==8 && neon_bf16<=A)
14#pragma clang attribute push(__attribute__((target("neon,bf16"))), apply_to=function)
15#include "native/simd/polyfill_feature_chunk_body.h"
16#pragma clang attribute pop
17#undef NATIVE_POLYFILL_FEATURE_CHUNK
18#elif NATIVE_HOST_X86
19#define NATIVE_POLYFILL_FEATURE_CHUNK(T,N,A) (polyfill_element_traits<T>::kind==polyfill_element_kind::binary16 && N==32 && avx512_fp16<=A)
20#pragma clang attribute push(__attribute__((target("avx2,fma,avx512f,avx512dq,avx512bw,avx512vl,avx512fp16"))), apply_to=function)
21#include "native/simd/polyfill_feature_chunk_body.h"
22#pragma clang attribute pop
23#undef NATIVE_POLYFILL_FEATURE_CHUNK
24#define NATIVE_POLYFILL_FEATURE_CHUNK(T,N,A) (polyfill_element_traits<T>::kind==polyfill_element_kind::bfloat16 && (N==8 || N==16 || N==32) && avx512_bf16<=A)
25#pragma clang attribute push(__attribute__((target("avx2,fma,avx512f,avx512dq,avx512bw,avx512vl,avx512bf16"))), apply_to=function)
26#include "native/simd/polyfill_feature_chunk_body.h"
27#pragma clang attribute pop
28#undef NATIVE_POLYFILL_FEATURE_CHUNK
29#endif