Here is my code. I have changed all the Project Properties to be the same as in your scatter example. At this point I can't really think of a simpler example. This just crashes when it calls the kernel. It runs fine if BRT_RUNTIME (which I had to create, it's not created automatically) is set to "cpu" but not when it is set to "cal".
#include < stdio.h >
#include < stdlib.h >
#define size1 2*2*2
#define size2 2*2
kernel void foo(float4 a[], float4 b[], out float4 c[])
{
float idx = indexof(c);
c[idx] = a[idx]+b[idx];
}
int main()
{
int j=0;
float num;
float4 b < size1 > ;
float4 c < size1 > ;
float4 a < size1 > ;
float4 g[size1];
float4 h[size1];
for (j=0;j < size1;j=j+1)
{
g.x= (float)j;
g.y= (float)j;
g.z= (float)j;
g.w= (float)j;
h.x=(float)j;
h.y=(float)j;
h.z=(float)j;
h.w=(float)j;
}
streamRead(b, g);
streamRead(a, h);
foo(a, b, c);
scanf_s("%f", &num);
streamWrite(c, g);
}
What would be the reasons it would run in cpu but not in cal? Also, I'm currently using 2900xt, don't think that should matter though, since it's R600.