Skip to content

Types

cpu_name function

static const char *cpu_name(cpu_t set)

Returns name of the cpu instruction set

Source code
CMT_UNUSED static const char* cpu_name(cpu_t set)
{
#ifdef CMT_ARCH_X86
    static const char* names[] = { "generic", "sse2", "sse3", "ssse3", "sse41",
                                   "sse42",   "avx",  "avx2", "avx512" };
#endif
#ifdef CMT_ARCH_ARM
    static const char* names[] = { "generic", "neon", "neon64" };
#endif
    if (CMT_LIKELY(set >= cpu_t::lowest && set <= cpu_t::highest))
        return names[static_cast<size_t>(set)];
    return "-";
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/platform.hpp#L97

cpu_t

cpu_t enum

enum class cpu_t : int

An enumeration representing cpu instruction set

Source code
enum class cpu_t : int
{
    generic = 0,
#ifdef CMT_ARCH_X86
    sse2    = 1,
    sse3    = 2,
    ssse3   = 3,
    sse41   = 4,
    sse42   = 5,
    avx1    = 6,
    avx2    = 7,
    avx512  = 8, // F, CD, VL, DQ and BW
    avx     = static_cast<int>(avx1),
    lowest  = static_cast<int>(sse2),
    highest = static_cast<int>(avx512),
#endif
#ifdef CMT_ARCH_ARM
    neon    = 1,
    neon64  = 2,
    lowest  = static_cast<int>(neon),
    highest = static_cast<int>(neon64),
#endif
    native = static_cast<int>(CMT_ARCH_NAME),

#ifdef CMT_ARCH_AVX
#define KFR_HAS_SECONDARY_PLATFORM
    secondary = static_cast<int>(sse42),
#else
    secondary = static_cast<int>(native),
#endif

    common  = generic, // For compatibility
    runtime = -1,
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/platform.hpp#L34

get_first typedef

get_first = cometa::fn_get_first

Function that returns its first argument and ignores all other arguments

Source code
using get_first = cometa::fn_get_first

https://github.com/kfrlib/kfr/blob//include/kfr/simd/types.hpp#L305

get_second typedef

get_second = cometa::fn_get_second

Function that returns its second argument and ignores all other arguments

Source code
using get_second = cometa::fn_get_second

https://github.com/kfrlib/kfr/blob//include/kfr/simd/types.hpp#L308

get_third typedef

get_third = cometa::fn_get_third

Function that returns its third argument and ignores all other arguments

Source code
using get_third = cometa::fn_get_third

https://github.com/kfrlib/kfr/blob//include/kfr/simd/types.hpp#L311

initialvalue

initialvalue class

template <typename T> initialvalue

Used to determine the initial value for reduce functions

Source code
template <typename T>
struct initialvalue
{
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/types.hpp#L354

make_vector function

template <
    typename Type = void, typename Arg, typename... Args,
    size_t N = (sizeof...(Args) + 1),
    typename SubType =
        fix_type<typename internal::conditional_common<
            std::is_void_v<Type>, Type, Arg,
            Args...>::type>>
constexpr vec<SubType, N> make_vector(const Arg &x,
                                      const Args &...rest)

Create vector from scalar values

CHECK( make_vector( 1, 2, 3, 4 ) == i32x4{1, 2, 3, 4} );

Source code
template <typename Type = void, typename Arg, typename... Args, size_t N = (sizeof...(Args) + 1),
          typename SubType =
              fix_type<typename internal::conditional_common<std::is_void_v<Type>, Type, Arg, Args...>::type>>
constexpr KFR_INTRINSIC vec<SubType, N> make_vector(const Arg& x, const Args&... rest)
{
    return internal::make_vector_impl<SubType>(cvalseq_t<size_t, N>(), static_cast<SubType>(x),
                                               static_cast<SubType>(rest)...);
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/vec.hpp#L924

noop typedef

noop = cometa::fn_noop

Function that returns void and ignores all its arguments

Source code
using noop = cometa::fn_noop

https://github.com/kfrlib/kfr/blob//include/kfr/simd/types.hpp#L302

pass_through typedef

pass_through = cometa::fn_pass_through

Function that returns its first argument

Source code
using pass_through = cometa::fn_pass_through

https://github.com/kfrlib/kfr/blob//include/kfr/simd/types.hpp#L299

returns typedef

template <typename T> returns = cometa::fn_returns<T>

Function that returns value-initialization of type T and ignores all its arguments

Source code
template <typename T>
using returns = cometa::fn_returns<T>

https://github.com/kfrlib/kfr/blob//include/kfr/simd/types.hpp#L315

returns = cometa::fn_returns<T>

Function that returns value-initialization of type T and ignores all its arguments

Source code
using returns = cometa::fn_returns<T>

https://github.com/kfrlib/kfr/blob//include/kfr/simd/types.hpp#L315

vector_width variable

template <typename T>
constexpr static size_t vector_width = (const_max(
    size_t(1),
    typeclass<T> == datatype::f
        ? platform<>::native_float_vector_size / sizeof(T)
        : platform<>::native_int_vector_size / sizeof(T)))

SIMD vector width for the given cpu instruction set

Source code
template <typename T>
constexpr static size_t vector_width =
    (const_max(size_t(1), typeclass<T> == datatype::f ? platform<>::native_float_vector_size / sizeof(T)
                                                      : platform<>::native_int_vector_size / sizeof(T)))

https://github.com/kfrlib/kfr/blob//include/kfr/simd/platform.hpp#L258

zeroize function

template <typename T1> void zeroize(T1 &value)

Fills a value with zeros

Source code
template <typename T1>
KFR_INTRINSIC void zeroize(T1& value)
{
    builtin_memset(static_cast<void*>(builtin_addressof(value)), 0, sizeof(T1));
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/types.hpp#L347


Auto-generated from sources, Revision , https://github.com/kfrlib/kfr/blob//include/kfr/