Halide internal error issue -
here's code. i'm using halide on vs2013, win64 trunk of aug 5, 2015. when execute diag.compile_to_lowered_stmt("diag.html", {}, html) (with 16mb stack), following error message:
"internal error @ e:\code\halide\src\ir.cpp:160 condition failed: a.type() == b.type() lt of mismatched types"
i have confirmed error occurs because of line:
diag(x, y, c) = select(m135(x, y) > m45(x, y), f45(x, y, c), select(m45(x, y) > m135(x, y), f135(x, y, c), f4x4(x, y, c)));
the way i've been able remove error remove both selects (the function unusable in case, of course.) i've tried converting condition expr, , i've checked types of m45 , m135 (by assigning them expr t1, , looking @ t1.type().) note changing ">" "<" or ">=" not change error message "lt".
any ideas?
code still same previous post:
image<uint8_t> orig_uint = tools::load_image("../foo.ppm"); var x, y, c; func orig("orig"), orig_lum("orig_lum"), m45("m45"), m135("m135"), f45("f45"), f135("f135"), f4x4_horiz("f4x4_horiz"), f4x4("f4x4"), diag("diag"); func orig_clamped = boundaryconditions::repeat_edge(orig_uint); const float wta = 1.0f, wtb = 3.0f, wt0 = wta * wta, wt1 = wta * wtb, wt2 = wtb * wtb; orig(x, y, c) = cast<float_t>(orig_clamped(x, y, c)); orig_lum(x, y) = 0.299f * orig(x, y, 0) + 0.587f * orig(x, y, 1) + 0.114f * orig(x, y, 2); m45(x, y) = abs(orig_lum(x - 1, y - 1) - orig_lum(x, y)) + abs(orig_lum(x, y) - orig_lum(x + 1, y + 1)) + abs(orig_lum(x + 1, y + 1) - orig_lum(x + 2, y + 2)); m135(x, y) = abs(orig_lum(x + 2, y - 1) - orig_lum(x + 1, y)) + abs(orig_lum(x + 1, y) - orig_lum(x, y + 1)) + abs(orig_lum(x, y + 1) - orig_lum(x - 1, y + 2)); f45(x, y, c) = wta * (orig(x - 1, y - 1, c) + orig(x + 2, y + 2, c)) + wtb * (orig(x, y, c) + orig(x + 1, y + 1, c)); f135(x, y, c) = wta * (orig(x - 1, y + 2, c) + orig(x + 2, y - 1, c)) + wtb * (orig(x, y + 1, c) + orig(x + 1, y, c)); f4x4_horiz(x, y, c) = wta * (orig(x - 1, y, c) + orig(x + 2, y, c)) + wtb * (orig(x, y, c) + orig(x + 1, y, c)); f4x4(x, y, c) = wta * (f4x4_horiz(x, y - 1, c) + f4x4_horiz(x, y + 2, c)) + wtb * (f4x4_horiz(x, y, c) + f4x4_horiz(x, y + 1, c)); diag(x, y, c) = select(m135(x, y) > m45(x, y), f45(x, y, c), select(m45(x, y) > m135(x, y), f135(x, y, c), f4x4(x, y, c))); // schedule orig_lum.compute_root(); m45.compute_root().bound(x, 0, orig_uint.width()).bound(y, 0, orig_uint.height()); m135.compute_root().bound(x, 0, orig_uint.width()).bound(y, 0, orig_uint.height()); f45.compute_at(diag, x); f135.compute_at(diag, x); f4x4.compute_at(diag, x); diag.compute_root(); // compile can take @ code diag.compile_to_lowered_stmt("diag.html", {}, html); // stack oflo here
it's bug in halide. fix pushed andrew adams hour ago (thanks!)
Comments
Post a Comment