huixiangufl / aparapi

Automatically exported from code.google.com/p/aparapi
Other
0 stars 0 forks source link

Missing Sync or Volatile with Aparapi #161

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to write a code like this:
    private void setReturnValue(int gid,float value){
        if(epsilon!=0){
            float diff=Math.abs(rawData[gid]-value);
            if(diff>maxDeltaValue[0]){
                maxDeltaValue[0]=diff;
            }
        }
        returnData[gid]=value;
    }
2.Execute the kernel with GPU Mode and JTP.
3.GPU Mode give total different and random MaxDeltaValues instead of JTP.

What is the expected output? What do you see instead?
Same Output like JTP. I know ist because of the missing synchronize in the diff 
code I think. But I think I have no opportunity to make this possible with 
aparapi? Or a volatile? Whats my Problem and how can i solve it.

What version of the product are you using? On what operating system?
1.0.0 Win7 64

Please provide any additional information below.

Original issue reported on code.google.com by oliver.h...@gmail.com on 5 Feb 2015 at 2:18

GoogleCodeExporter commented 9 years ago
But it works with CPU OpenCL Mode. Whats the different? The results are the 
same on CPU and GPU. But also the GPU values are all times different but in a 
close range.

Original comment by oliver.h...@gmail.com on 5 Feb 2015 at 2:25

GoogleCodeExporter commented 9 years ago
Delete it, same like Issue 66 ... :( so aparapi is useless for my problem. 
Could store all values in a Array but this makes it slower then JTP. JTP dont 
need sync, ist hit everytime the right value.

I should search for an other example.

Original comment by oliver.h...@gmail.com on 6 Feb 2015 at 12:39