cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

drstrip
Journeyman III

brook+ compiler hangs on instance()

In Vis Studio 2005, the following code hangs -

sample.br -

kernel void hang(uint4 s<><>
{
  int4 index = instance();
}

 

The compile starts and never returns. I can compile the samples, so I think my install is correct.

0 Likes
8 Replies
Gipsel
Adept I

Originally posted by: drstrip In Vis Studio 2005, the following code hangs -

sample.br -

kernel void hang(uint4 s<><>) {   int4 index = instance(); }

 

The compile starts and never returns. I can compile the samples, so I think my install is correct.



Try that:

kernel void does_not_hang(uint4 s<>) {

   int4 index = instance();

}

0 Likes

please add out keyword to stream. it works fine.

 

see working kernel.

kernel void hang(out uint4 s<>
{
  int4 index = instance();
}

 

0 Likes

thanks.

What if there is no output stream? (Can't actually think of a useful example at the moment.)

0 Likes

Originally posted by: genaganna please add out keyword to stream.


Oops, I just copied the example and removed the superfluous <>.

Originally posted by: drstrip thanks.

What if there is no output stream? (Can't actually think of a useful example at the moment.)



I guess it would be the fastest possible kernel, if you need no output

0 Likes

Originally posted by: Gipsel
Originally posted by: genaganna please add out keyword to stream.


Oops, I just copied the example and removed the superfluous <>.

Originally posted by: drstrip thanks.

What if there is no output stream? (Can't actually think of a useful example at the moment.)



I guess it would be the fastest possible kernel, if you need no output

 

LOL, yes, I don't think the compiler generates code for a kernel without an output.

0 Likes

function semantics for Brook

1. kernel with alteast one output and void as return type can be called from other kernel or from host.

2. Kernel with no output and return type can be called from any other kernel

all other cases are invaild.

0 Likes

no output and return type = subkernel, yes?

Subkernels get inlined, yes?

0 Likes

Originally posted by: ryta1203 no output and return type = subkernel, yes?

       yes

Subkernels get inlined, yes?

        yes

0 Likes