Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bad_alloc #1

@ronghongbo

Description

@ronghongbo

Hello Jing,

Here is a small test case that runs into a bad_alloc error:

#include "Halide.h"
#include <stdio.h>
using namespace Halide;
int main(int argc, char **argv) {
    Func e, f, g;
    Var x;
    e(x) =x;
    f(x) = e(x);
    g(x) = f(x); 

    Var xi, xo;
    g.split(x, xo, xi, 16).accelerate({e}, xi, xo);
    f.linebuffer();

    Image<int> out = g.realize(100);//, target);
    return 0;
}

Halide-HLS]$ g++ -std=c++11 -g -fno-omit-frame-pointer -fno-rtti -Wall -Werror -Wno-unused-function -Wcast-qual -Wignored-qualifiers -Wno-comment -Wsign-compare -O3 test/correctness/gpu_dynamic_shared.cpp -Iinclude -Lbin -lHalide -lpthread -ldl -lz -rdynamic -Wl,--rpath=/home/hrong/Halide-HLS/bin -o t

Halide-HLS]$ ./t
Warning at test/correctness/gpu_dynamic_shared.cpp:34:
No linebuffer inserted after function f.
Warning at test/correctness/gpu_dynamic_shared.cpp:34:
No linebuffer inserted after function .
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted (core dumped)

Thanks!
Hongbo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions