<commit_before>#include <math.h>
#include <stdio.h>
#include <ratio>

#include "pyramid.h"
#include "HalideBuffer.h"

#include <vector>
using std::vector;
using namespace Halide;

template<bool B, typename T>
struct cond {
    static constexpr bool value = B;
    using type = T;
};

template <typename First, typename... Rest>
struct select : std::conditional<First::value, First, typename select<Rest...>::type> { };

template<typename First>
struct select<First> {
    //static_assert(T::value, "No case of select was chosen");
    using type = std::conditional<First::value, typename First::type, void>;
};

template<int a>
struct tester : public select<cond<a == 0, std::ratio<1, 2>>,
                              cond<a == 1, std::ratio<3, 2>>,
                              cond<a == 2, std::ratio<7, 2>>>::type {};


int main(int argc, char **argv) {
    Image<float> input(1024, 1024);

    using T0 = tester<0>::type; printf("t0 %d %d\n", (int)T0::num, (int)T0::den);
    using T1 = tester<1>::type; printf("t0 %d %d\n", (int)T1::num, (int)T1::den);
    using T2 = tester<2>::type; printf("t0 %d %d\n", (int)T2::num, (int)T2::den);
    //using T3 = tester<3>::type; printf("t0 %d %d\n", (int)T3::num, (int)T3::den);

    // Put some junk in the input. Keep it to small integers so the float averaging stays exact.
    for (int y = 0; y < input.height(); y++) {
        for (int x = 0; x < input.width(); x++) {
            input(x, y) = ((x * 17 + y)/8) % 32;
        }
    }

    vector<Image<float>> levels(10);

    for (int l = 0; l < 10; l++) {
        levels[l] = Image<float>(1024 >> l, 1024 >> l);
    }

    // Will throw a compiler error if we didn't compile the generator with 10 levels.
    pyramid(input,<commit_msg>remove scalpel left in patient<commit_after>#include <math.h>
#include <stdio.h>

#include "pyramid.h"
#include "HalideBuffer.h"

#include <vector>
using std::vector;
using namespace Halide;

int main(int argc, char **argv) {
    Image<float> input(1024, 1024);

    // Put some junk in the input. Keep it to small integers so the float averaging stays exact.
    for (int y = 0; y < input.height(); y++) {
        for (int x = 0; x < input.width(); x++) {
            input(x, y) = ((x * 17 + y)/8) % 32;
        }
    }

    vector<Image<float>> levels(10);

    for (int l = 0; l < 10; l++) {
        levels[l] = Image<float>(1024 >> l, 1024 >> l);
    }

    // Will throw a compiler error if we didn't compile the generator with 10 levels.
    pyramid(input,
{'fraction_non_alphanumeric': 0.17618857371154614, 'fraction_numerical': 0.035557331202556934, 'mean_word_length': 2.943307086614173, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 45, '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': '2345350', 'n_tokens_mistral': 946, 'n_tokens_neox': 857, 'n_words': 274}