<commit_before>#include "HalideRuntime.h"


namespace Halide { namespace Runtime { namespace Internal {

extern "C" void x86_cpuid_halide(int32_t *);

static inline void cpuid(int32_t fn_id, int32_t *info) {
    info[0] = fn_id;
    x86_cpuid_halide(info);
}

WEAK CpuFeatures halide_get_cpu_features() {
    const uint64_t known = (1ULL << halide_target_feature_sse41) |
                           (1ULL << halide_target_feature_avx) |
                           (1ULL << halide_target_feature_f16c) |
                           (1ULL << halide_target_feature_fma) |
                           (1ULL << halide_target_feature_avx2) |
                           (1ULL << halide_target_feature_avx512);

    uint64_t available = 0;

    int32_t info[4];
    cpuid(1, info);

    const bool have_sse41  = (info[2] & (1 << 19)) != 0;
    const bool have_avx    = (info[2] & (1 << 28)) != 0;
    const bool have_f16c   = (info[2] & (1 << 29)) != 0;
    const bool have_rdrand = (info[2] & (1 << 30)) != 0;
    const bool have_fma    = (info[2] & (1 << 12)) != 0;
    if (have_sse41) {
        available |= (1ULL << halide_target_feature_sse41);
    }
    if (have_avx) {
        available |= (1ULL << halide_target_feature_avx);
    }
    if (have_f16c) {
        available |= (1ULL << halide_target_feature_f16c);<commit_msg>Fix known features<commit_after>#include "HalideRuntime.h"


namespace Halide { namespace Runtime { namespace Internal {

extern "C" void x86_cpuid_halide(int32_t *);

static inline void cpuid(int32_t fn_id, int32_t *info) {
    info[0] = fn_id;
    x86_cpuid_halide(info);
}

WEAK CpuFeatures halide_get_cpu_features() {
    const uint64_t known = ((1ULL << halide_target_feature_sse41) |
                            (1ULL << halide_target_feature_avx) |
                            (1ULL << halide_target_feature_f16c) |
                            (1ULL << halide_target_feature_fma) |
                            (1ULL << halide_target_feature_avx2) |
                            (1ULL << halide_target_feature_avx512) |
                            (1ULL << halide_target_feature_avx512_knl) |
                            (1ULL << halide_target_feature_avx512_skl) |
                            (1ULL << halide_target_feature_avx512_cnl));                            

    uint64_t available = 0;

    int32_t info[4];
    cpuid(1, info);

    const bool have_sse41  = (info[2] & (1 << 19)) != 0;
    const bool have_avx    = (info[2] & (1 << 28)) != 0;
    const bool have_f16c   = (info[2] & (1 << 29)) != 0;
    const bool have_rdrand = (info[2] & (1 << 30)) != 0;
    const bool have_fma    = (info[2] & (1 << 12)) != 0;
    if (have_sse41) {
        available |= (1ULL << halide_target_feature_sse41);
    }
    if (have_avx) {
        available |= (1ULL << halide_target_feature_avx);
    }
    if (have_f16c) {
        available |= (1ULL << halide_target_feature_f16c);
{'fraction_non_alphanumeric': 0.12237159600137884, 'fraction_numerical': 0.055153395380903136, 'mean_word_length': 2.1890109890109892, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5195054', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1028, 'n_words': 201}