ThomasI

Is there a maximum Loop Depth?

Discussion created by ThomasI on Jun 25, 2009
Latest reply on Jul 13, 2009 by hagen

Hi,

When trying to implement a particular problem we are facing a number of problems.

 

1. Most important is that local arrays are not supported. From my point of view it was also not well documented in the Stream Computing user Guide - which mentions local shared arrays in A.6.3.1, but the compiler just tells me its not implemented.

 2. When manually unrolling the kernel we faced another problem. The kernel just didn't seem to return anything. The output stream always contained the results of the last successful run.

 

We managed to reduce the kernel to this:

 



kernel void dame(unsigned int input<>, out unsigned int output<>, out unsigned int debug<>
{
unsigned int cnt = 0u;

debug = input;

do {
do {
do {
do {
do {
cnt = cnt + 1u;
} while(0);
} while(0);
} while(0);
} while(0);
} while(0);
output = cnt;
}



For example running it straight after boot:

$> ./dame 123
0: 4294967295 dbg: 4294967167
1: 4294967295 dbg: 4294967295
2: 4294967215 dbg: 4294967295
3: 4294967295 dbg: 4294967295
4: 4294770688 dbg: 4294967295
5: 4294377472 dbg: 4261412863
6: 4294901760 dbg: 4294967295
7: 4294901764 dbg: 4294967295
$> BRT_RUNTIME=cpu ./dame 123
0: 1 dbg: 123
1: 1 dbg: 123
2: 1 dbg: 123
3: 1 dbg: 123
4: 1 dbg: 123
5: 1 dbg: 123
6: 1 dbg: 123
7: 1 dbg: 123



Just for reference the CPP program.

#include
#include
#include
using namespace std;

#define N 8

int main(int argc, char *argv[]) {
unsigned int Dim1[]={N};
int i;
brook::Streaminput(1,Dim1);
brook::Streamoutput(1,Dim1);
brook::Streamdebug(1,Dim1);
uint32_t input_cpu[N];
uint32_t output_cpu[N];
uint32_t debug_cpu[N];
for(i=0;i input.read(input_cpu);
dame(input, output, debug);

output.write(output_cpu);
debug.write(debug_cpu);
for(i=0;i cout << i << ": " << output_cpu[ i ] << " dbg: " << debug_cpu[ i ] << endl;

return 0;
}



Any help to find out whats wrong with the kernel is highly appreciated.

Some other notes:

3. The brcc compiler is extremely picky about types. Each integer constant used with unsigned ints must be explicitly marked as 0u. IMHO this makes it harder than it should be to just copy/paste c code.

4. Will there be support for 64 bit integer types?

5. Will we ever be the stream kernel analyser for linux?

 

Best Regards

Thomas

 

P.S. atistream-1.4.0_beta-lnx64 //  ati-driver-installer-9-6-x86.x86_64 // single FireStream 9170 // SLES10

Outcomes