cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Raistmer
Adept II

[SOLVED]What wrong with this kernel?

even simplest struct not allowed ?

variable of user-defined type int8 doesn't allowed?

struct int8{ int4 a; int4 b; }; kernel void GPU_coadd_and_compare_kernel_s8(float4 src[][], int thresholds[][],int level,out float4 dest[][], out int8 output<> ) { int threadID=instance().x; float threshold=(float)thresholds[threadID][level]; int was_signal=0; int bin=0; int8 s; float4 i1,i2; float4 o11,o21; i1=src[threadID][0]; i2=src[threadID][1]; if(i1.x>=threshold){ was_signal++; bin=0; } if(i1.y>=threshold){ was_signal++; bin=1; } ........................... ERROR: Error (syntax error) before 'Identifier' kernel void GPU_coadd_and_compare_kernel_s8(float4 src[][], int thresholds[][],int level,out float4 dest[][], out int8 output<> ) ^

0 Likes
3 Replies
hagen
Journeyman III

Structures should work for both input and output streams.

In your code, don't you have to typedef your struct?

typedef struct mystruc{
   int4 a;
   int4 b;
} int8;

0 Likes

yes, seems the typedef required, thanks for pointing this.
0 Likes

.
0 Likes