Ceq

Streams as normal function parameters

Discussion created by Ceq on Jun 3, 2008
Latest reply on Jul 8, 2008 by Ceq
Hello, I think I've found a issue when you use a stream as a function parameter in SDK 1.1b. If you don't specify a size it won't compile. Example:

void str_red_aux(double2 input<> ) { }

Brook+ output:

str_red.br:1: Error (syntax error) before 'int'
void str_red_aux(double2 input<> ) {
^
Errors - Aborting parse.
***Unable to parse str_red.br

-----------------------

However if you write any number as a stream size it will work:

void str_red_aux(double2 input<9> ) { }

According to the documentation I think you don't really need to specify the size, moreover Brook+ translates it in something that doesn't need the size:

void str_red_aux(::brook::stream input) { }

==============


Second issue is related to a strange behavior, if you try to compile:

kernel void ker_copy(float4 a<>, out float4 b<> ) { b = a; }
kernel void ker_set1(out float4 c[], float i<> ) { c[ i ] = 1; }

You get a really verbose error, quite large to paste here. However if you split those lines in two different files it works OK.

==============


Last question: Was iterator support dropped? If you try to compile:

iter float it<10> = iter(0, 10);

The compiler will abort:

ERROR--1: Iterator not supported
str_inc.br:23: float it<10>
***Semantic check found 1 errors


Thanks.

Outcomes