Closed GoogleCodeExporter closed 8 years ago
Yes I just recreated. This is a big regression. Thanks for reporting.
It is also broken in the 'trunk-20130305' snapshot taken prior to the recent
JNI refactoring.
I need to back-track to see where this regression came from.
I will try to track this down today/tonight.
Apologies for this.
Gary
Original comment by frost.g...@gmail.com
on 24 Mar 2013 at 5:05
There is a subtle gotcha with your app that might not be documented or maybe
not tested correctly.
The problem is that "objects" is static. It ends up that the BugDataObject
class is not processed correctly for oop conversion because it is a static
field. Early versions of Aparapi had almost no support for static fields and
this might be a lingerer from that.
I slightly modified the example as shown below and it works OK.
I have not looked at trunk in a while but we will see about fixing this so the
example will work as is originally written.
==========
package bug;
import com.amd.aparapi.*;
public class BugBadObjectAccess extends Kernel
{
BugDataObject [] objects = new BugDataObject[1024];
public static void main(String[] args)
{
BugBadObjectAccess b = new BugBadObjectAccess();
// for(int i = 0; i < objects.length; ++i)
// objects[i] = new BugDataObject();
b.execute(1024);
}
public BugBadObjectAccess() {
for(int i = 0; i < objects.length; ++i)
objects[i] = new BugDataObject();
}
@Override
public void run()
{
int id = getGlobalId();
int value = objects[id].getValue();
}
}
Original comment by ecasp...@gmail.com
on 25 Mar 2013 at 4:52
Fixed in revision 1117, but there are still some issues with use of static
fields. I modified the submitted example app into a test case. Thanks for that.
Original comment by ecasp...@gmail.com
on 26 Mar 2013 at 3:37
Original issue reported on code.google.com by
n...@u1.com
on 24 Mar 2013 at 12:29Attachments: