I realized that my brook program gives me different results from different backends.
After my kernel execution stream write gives me different output3D image
kernel void SAD3D(out float output<imageHeightInt , imageWidthInt, d >, float4 input_l[imageHeightInt][imageWidthInt], float4 input_r[imageHeightInt][imageWidthInt], float winx, float winy,int dMin, int deltaD, float2 imageSize)
{....}
float *output_image;
float *output_image3D;
{....}
SAD3D(output_stream3D, image_l_stream, image_r_stream, winx, winy,dMin, deltaD, imageSize);
streamWrite(output_stream3D, output_image3D);
viewStream3d(output_image3D, imageSize, deltaD);
In case of cpu backened it looks as if it were good. Result is normal but in case of cal backend I have results like this :
5.83137e-039 5.83137e-039 ..... .... .....
What is the problem?
I use 8.9 drivers with 1.2.1 beta AmdStream , Windows XP SP2 32bit
Noone can answer me?
What is going on with amd/ati support ?
Please this is important for me because I have to finish my master's thesis and this bug doesn't allow me to do so.
That is whole my kernel code. Please let me know if something is wrong with the code.
I tried to reinstall drivers (8.9) and Brook / Cal SDK and still is the same
kernel void SAD3D(out float output<imageHeightInt , imageWidthInt, d >, float4 input_l[imageHeightInt][imageWidthInt], float4 input_r[imageHeightInt][imageWidthInt], float winx, float winy,int dMin, int deltaD, float2 imageSize)
{
const float3 si = indexof(output);
const float2 si2d = {si.y, si.z};
//windows has to be odd
int d = dMin + deltaD;
float halfx = (winx-1)/2;
float halfy = (winy-1)/2;
float j = 0.0f;
float i = 0.0f;
float suma = 0.0f;
for(i = -halfx ; i<= halfx; i = i + 1.0f)
for(j = -halfy ; j<= halfy; j = j + 1.0f)
{
float2 xy = {i,j};
float2 xyd = {i+ si.x ,j};
suma += abs(input_l[si2d+xy].x - input_r[si2d+xyd].x) +
abs(input_l[si2d+xy].y - input_r[si2d+xyd].y) +
abs(input_l[si2d+xy].z - input_r[si2d+xyd].z);
}
output = suma;
}
I have a similar problem when using input and output streams of different sizes. In my case, this is probably due to the fact that in such a case Brook+ implicitly invokes reduced kernels.
PS
I like your "suma". Sounds pretty familiar to me...
@Bahrd
So do You suggest to change dimention of input gathered stream? I thought that this implicit reduction apply only with normal <> stream. I have to check it.
I realized that my card (Radeon HD3850) is not on supported card list so this may be the problem?
I also noticed that when I use Cal backend my cpu is 50% loaded (1 od 2 core of my AMD X2 ) . Is this normal behavior?
PS. Maybe "Suma" is familiar to You because You are Polish as I am?