uygn / aparapi

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

Weird behavior with atomicAdd on CPU #95

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use the following code.
 final int[] arr = new int[]{0};
 Kernel kernel = new Kernel()
 {
     @Override
     public void run()
     {
         this.atomicAdd(arr, 0, 1);
     }
 };
 kernel.setExecutionMode(Kernel.EXECUTION_MODE.CPU);
 kernel.execute(65536);
 System.out.println("The result is " + arr[0]);
 kernel.dispose();

What is the expected output? What do you see instead?
 65536 is the expected result. 256 is the returned result. Works for other devices.

What version of the product are you using? On what operating system?
 2012-12-02. Windows 8.

Please provide any additional information below.
 Was run on a A10-4600M.

Original issue reported on code.google.com by kylesief...@gmail.com on 29 Jan 2013 at 12:17

GoogleCodeExporter commented 9 years ago
That is weird.   Does it work as expected in GPU mode?

Original comment by frost.g...@gmail.com on 1 Feb 2013 at 3:27

GoogleCodeExporter commented 9 years ago
Yes, it does.

Original comment by kylesief...@gmail.com on 3 Feb 2013 at 6:40

GoogleCodeExporter commented 9 years ago
Let me write a C program to test this, I don't think this is Aparapi. We pass 
this directly to OpenCL.

Can I assume you are using AMD's OpenCL driver (I assume so because you hava an 
A10-4600 - but I want to make sure ;) ) ?

Can you send me the result of executing clinfo.  I want to ensure I match your 
version of OpenCL.

Gary 

Original comment by frost.g...@gmail.com on 3 Feb 2013 at 7:09

GoogleCodeExporter commented 9 years ago
I'm have AMD APP installed so I'm pretty sure that means I'm using the OpenCL 
driver. I've attached the output of clinfo to this.

Original comment by kylesief...@gmail.com on 6 Feb 2013 at 10:26

Attachments:

GoogleCodeExporter commented 9 years ago
I figured that you had AMD's driver.  Just wanted to make sure.

O.K  I will code this in OpenCL and test on a Trinity CPU/APU.

If I see the same issue I will get advice from the OpenCL compiler guys. 

Gary  

Original comment by frost.g...@gmail.com on 6 Feb 2013 at 11:15