<commit_before>#include <stdio.h>
#include <Halide.h>

using namespace Halide;

int main(int argc, char **argv) {
    Target t1, t2;
    std::string ts;

    // parse_target_string("") should be exactly like get_host_target().
    t1 = get_host_target();
    t2 = parse_target_string("");
    if (t2 != t1){
       printf("parse_from_string failure: %s\n", ts.c_str());
       return -1;
    }

    t1 = Target();
    ts = t1.to_string();
    if (ts != "arch_unknown-0-os_unknown") {
       printf("to_string failure: %s\n", ts.c_str());
       return -1;
    }
    // We expect from_string() to fail, since it doesn't know about 'unknown'
    if (t2.from_string(ts)) {
       printf("from_string failure: %s\n", ts.c_str());
       return -1;
    }
    if (t2 != t1) {
       printf("compare failure: %s %s\n", t1.to_string().c_str(), t2.to_string().c_str());
       return -1;
    }

    // Full specification round-trip:
    t1 = Target(Target::Linux, Target::X86, 32, Target::SSE41);
    ts = t1.to_string();
    if (ts != "x86-32-linux-sse41") {
       printf("to_string failure: %s\n", ts.c_str());
       return -1;
    }
    if (!t2.from_string(ts)) {
       printf("from_string failure: %s\n", ts.c_str());
       return -1;
    }
    if (t2 != t1) {
       printf("compare failure: %s %s\n", t1.to_string().c_str(), t2.to_string().c_str());
       return -1;
    }

    // Full specification round-trip, crazy features
    int64_t features = Target::JIT | Target::SSE41 | Target::AVX |
            Target::AVX2 | Target::CUDA | Target::OpenCL | Target::OpenGL |
            Target::GPUDebug;
    t1 = Target(Target::Android, Target::ARM, 32, features);
    ts = t1.to_string();
    if (ts != "arm-32-android-jit-sse41-avx-avx2-cuda-opencl-gpu_debug-opengl") {
       printf("to_string failure: %s\n", ts.c_str());
       return -1;
    }
    if (!t2.from_string(ts)) {
       printf("from_string failure: %s\n", ts.c_str());<commit_msg>Updated for target feature enumeration changes.<commit_after>#include <stdio.h>
#include <Halide.h>

using namespace Halide;

int main(int argc, char **argv) {
    Target t1, t2;
    std::string ts;

    // parse_target_string("") should be exactly like get_host_target().
    t1 = get_host_target();
    t2 = parse_target_string("");
    if (t2 != t1){
       printf("parse_from_string failure: %s\n", ts.c_str());
       return -1;
    }

    t1 = Target();
    ts = t1.to_string();
    if (ts != "arch_unknown-0-os_unknown") {
       printf("to_string failure: %s\n", ts.c_str());
       return -1;
    }
    // We expect from_string() to fail, since it doesn't know about 'unknown'
    if (t2.from_string(ts)) {
       printf("from_string failure: %s\n", ts.c_str());
       return -1;
    }
    if (t2 != t1) {
       printf("compare failure: %s %s\n", t1.to_string().c_str(), t2.to_string().c_str());
       return -1;
    }

    // Full specification round-trip:
    t1 = Target(Target::Linux, Target::X86, 32, Target::SSE41);
    ts = t1.to_string();
    if (ts != "x86-32-linux-sse41") {
       printf("to_string failure: %s\n", ts.c_str());
       return -1;
    }
    if (!t2.from_string(ts)) {
       printf("from_string failure: %s\n", ts.c_str());
       return -1;
    }
    if (t2 != t1) {
       printf("compare failure: %s %s\n", t1.to_string().c_str(), t2.to_string().c_str());
       return -1;
    }

    // Full specification round-trip, crazy features
    int64_t features = Target::JIT | Target::SSE41 | Target::AVX |
            Target::AVX2 | Target::CUDA | Target::OpenCL | Target::OpenGL |
            Target::GPUDebug;
    t1 = Target(Target::Android, Target::ARM, 32, features);
    ts = t1.to_string();
    if (ts != "arm-32-android-jit-sse41-avx-avx2-cuda-opencl-opengl-gpu_debug") {
       printf("to_string failure: %s\n", ts.c_str());
       return -1;
    }
    if (!t2.from_string(ts)) {
       printf("from_string failure: %s\n", ts.c_str());
{'fraction_non_alphanumeric': 0.17906265919510952, 'fraction_numerical': 0.028527763627101375, 'mean_word_length': 2.6193548387096772, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5871913', 'n_tokens_mistral': 1493, 'n_tokens_neox': 1449, 'n_words': 312}