<commit_before>#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "../../src/buffer_t.h"

// TODO: use custom version to test use of user-created OpenGL context.
extern "C" int halide_opengl_create_context();

class Image {
public:
    enum Layout {
        Interleaved, Planar
    };

    buffer_t buf;

    Image(int w, int h, int c, int elem_size, Layout layout = Interleaved) {
        memset(&buf, 0, sizeof(buffer_t));
        buf.extent[0] = w;
        buf.extent[1] = h;
        buf.extent[2] = c;
        buf.elem_size = elem_size;

        if (layout == Interleaved) {
            buf.stride[0] = buf.extent[2];
            buf.stride[1] = buf.extent[0] * buf.stride[0];
            buf.stride[2] = 1;
        } else {
            buf.stride[0] = 1;<commit_msg>Fix apps/glsl. Include HalideRuntime.h instead of removed buffer_t.h<commit_after>#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "HalideRuntime.h"

// TODO: use custom version to test use of user-created OpenGL context.
extern "C" int halide_opengl_create_context();

class Image {
public:
    enum Layout {
        Interleaved, Planar
    };

    buffer_t buf;

    Image(int w, int h, int c, int elem_size, Layout layout = Interleaved) {
        memset(&buf, 0, sizeof(buffer_t));
        buf.extent[0] = w;
        buf.extent[1] = h;
        buf.extent[2] = c;
        buf.elem_size = elem_size;

        if (layout == Interleaved) {
            buf.stride[0] = buf.extent[2];
            buf.stride[1] = buf.extent[0] * buf.stride[0];
            buf.stride[2] = 1;
        } else {
            buf.stride[0] = 1;
{'fraction_non_alphanumeric': 0.1382063882063882, 'fraction_numerical': 0.01597051597051597, 'mean_word_length': 2.290909090909091, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6478867', 'n_tokens_mistral': 591, 'n_tokens_neox': 571, 'n_words': 140}