1

I want to use Halide to generate multiple output buffer.

Func output;
std::vector<Expr> argsExpr( 4 );
argsExpr[ 0 ] = aOut( x, y );
argsExpr[ 1 ] = bOut( x, y );
argsExpr[ 2 ] = cOut( x, y );
argsExpr[ 3 ] = dOut( x, y );
output( x, y ) = Tuple( argsExpr );

This example works fine, but I was wondering if it's possible to have multiple Output, but not the same size, like:

std::vector<Expr> argsExpr( 4 );
argsExpr[ 0 ] = aOut( x, y, c );
argsExpr[ 1 ] = bOut( x, y );
argsExpr[ 2 ] = cOut( x, y );
argsExpr[ 3 ] = dOut( x, y );
output( x, y, ? ) = Tuple( argsExpr );

I got an error from Halide about the difference between output 0 and output 1.

I assume that I want only one compilation (compile_to_file), not multiple Object files.

Jay

1 Answer 1

3

Currently all outputs (elements of a Realization) must have the same number of dimensions, mins, and extents. Only the type of the elements can vary. Andrew has a plan to remove this restriction, but I would not depend on it for anything less than six to nine months out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.