cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

thesquiff
Journeyman III

A bug

or is it me....

While compiling this code, I get the errors below:

kernel void zeros(float matches<>, out float zeros<> {
    int idx = instance().x;
    zeros = (matches < 1.0F) ? (float)idx:0.0F;
}

1>ERROR: Invalid cast
1>While processing <buffer>:127
1>In compiler at AST::Symbol::AsFunctionSymbol()[astsymbol.hpp:178]
1>  ToString() = (float)zeros[r308]
1>Aborting...
1>Problem with compiling u:\GPGPU\mygzip\hello_brook\\built\hello_brook_zeros.hlslERROR: Invalid cast
1>While processing <buffer>:179
1>In compiler at AST::Symbol::AsFunctionSymbol()[astsymbol.hpp:178]
1>  ToString() = (float)zeros[r368]
1>Aborting...

I've tried all sorts of ways of modifying the code. Is it me or the compiler?

Thanks

0 Likes
3 Replies
gaurav_garg
Adept I

Brcc fails in case funtion name matches with any parameter name or variable inside kernel.

Try changing kernel name.

0 Likes

kernel void foo_s(float matches<>, out float zeros<>)
{
int idx=instance().x;

zeros = (matches < 1.0F) ? (float)idx:0.0F;
}

This works, although Garuav beat me to it, your function name and output stream name are the same.
0 Likes

ok, I had a feel it would be my fault. A more descriptive error message might have pointed me in the right direction!

Thanks for your help once again guys.

 

 

0 Likes