Revision 0aa3766355c7a108578ab45d1f752a91ce8f0f6e authored by Steven Johnson on 19 August 2019, 21:36:33 UTC, committed by Steven Johnson on 19 August 2019, 21:36:33 UTC
1 parent e110b79
Raw File
alias_aottest.cpp
#include "HalideRuntime.h"
#include "HalideBuffer.h"

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

#include "alias.h"
#include "alias_with_offset_42.h"

using namespace Halide::Runtime;

const int kSize = 32;

int main(int argc, char **argv) {
    Buffer<int32_t> input(kSize), output(kSize);

    input.for_each_element([&](int x) {
        input(x) = x;
    });

    alias(input, output);
    input.for_each_element([=](int x) {
        assert(output(x) == input(x));
    });

    alias_with_offset_42(input, output);
    input.for_each_element([=](int x) {
        assert(output(x) == input(x) + 42);
    });

    printf("Success!\n");
    return 0;
}
back to top