<commit_before>#include "Halide.h"
#include <tiramisu/utils.h>
#include <cstdlib>
#include <iostream>

#include "wrapper.h"

typedef std::chrono::duration<double,std::milli> duration_t;

int main(int argc, char *argv[])
{
    int testN = 1;
    int warmupN = 0;

    int feature_size = 512;
    int batch_size = 64;
    int num_layers = 4;
    int seq_length = 100;

    // Note that indices are flipped (see tutorial 2)
    Halide::Buffer<int32_t> buf_params(4);
    Halide::Buffer<float> buf_Weights(feature_size, 4 * feature_size, 2, num_layers);
    Halide::Buffer<float> buf_biases(feature_size, 4, num_layers);
    Halide::Buffer<float> buf_x(feature_size, batch_size, seq_length);
    Halide::Buffer<float> buf_y(feature_size, batch_size, seq_length);

    buf_params(0) = feature_size;
    buf_params(1) = batch_size;
    buf_params(2) = num_layers;
    buf_params(3) = seq_length;

    std::srand(0);
    for (int i = 0; i < num_layers; i++) {
        for (int j = 0; j < 2; j++) {
            for (int k = 0; k < 4 * feature_size; k++) {
                for (int l = 0; l < feature_size; l++) {
                    buf_Weights(l, k, j, i) = (std::rand() % 200 - 100) / 100.;
                }
            }
        }
    }
    for (int i = 0; i < num_layers; i++) {
        for (int j = 0; j < 4; j++) {
            for (int k = 0; k < feature_size; k++) {
                buf_biases(k, j, i) = (std::rand() % 200 - 100) / 100.;
            }
        }
    }
    for (int i = 0; i < seq_length; i++) {
        for (int j = 0; j < batch_size; j++) {
            for (int k = 0; k < feature_size; k++) {
                buf_x(k, j, i) = (std::rand() % 200 - 100) / 100.;
            }
        }
    }

    for (int i = 0; i < warmupN; i++) {
        lstm(buf_params.raw_buffer(),
             buf_Weights.raw_buffer(),
             buf_biases.raw_buffer(),
             buf_x.raw_buffer(),<commit_msg>Update wrapper.cpp<commit_after>#include "Halide.h"
#include <tiramisu/utils.h>
#include <cstdlib>
#include <iostream>

#include "wrapper.h"

typedef std::chrono::duration<double,std::milli> duration_t;

int main(int argc, char *argv[])
{
    int testN = 1;
    int warmupN = 0;

    int feature_size = 512;
    int batch_size = 64;
    int num_layers = 4;
    int seq_length = 100;

    // Note that indices are flipped (see tutorial 2)
    Halide::Buffer<int32_t> buf_params(4);
    Halide::Buffer<float> buf_Weights(feature_size, 4 * feature_size, 2, num_layers);
    Halide::Buffer<float> buf_biases(4 * feature_size, num_layers);
    Halide::Buffer<float> buf_x(feature_size, batch_size, seq_length);
    Halide::Buffer<float> buf_y(feature_size, batch_size, seq_length);

    buf_params(0) = feature_size;
    buf_params(1) = batch_size;
    buf_params(2) = num_layers;
    buf_params(3) = seq_length;

    std::srand(0);
    for (int i = 0; i < num_layers; i++) {
        for (int j = 0; j < 2; j++) {
            for (int k = 0; k < 4 * feature_size; k++) {
                for (int l = 0; l < feature_size; l++) {
                    buf_Weights(l, k, j, i) = (std::rand() % 200 - 100) / 100.;
                }
            }
        }
    }
    for (int i = 0; i < num_layers; i++) {
        for (int j = 0; j < 4 * feature_size; j++) {
            buf_biases(j, i) = (std::rand() % 200 - 100) / 100.;
        }
    }
    for (int i = 0; i < seq_length; i++) {
        for (int j = 0; j < batch_size; j++) {
            for (int k = 0; k < feature_size; k++) {
                buf_x(k, j, i) = (std::rand() % 200 - 100) / 100.;
            }
        }
    }

    for (int i = 0; i < warmupN; i++) {
        lstm(buf_params.raw_buffer(),
             buf_Weights.raw_buffer(),
             buf_biases.raw_buffer(),
             buf_x.raw_buffer(),
{'fraction_non_alphanumeric': 0.1553784860557769, 'fraction_numerical': 0.03373173970783533, 'mean_word_length': 2.127906976744186, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 21, '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': '6876681', 'n_tokens_mistral': 1506, 'n_tokens_neox': 1362, 'n_words': 347}