Open GoogleCodeExporter opened 9 years ago
Original comment by ecasp...@gmail.com
on 1 Nov 2012 at 9:48
Eric I think you should simplify the test case. It has artifacts of three
seperate use cases.
If I understand correctly the issue is that the static fields (values and
results) of the containing class cannot be accessed from the anonymous
innerclass (because of the synthetic obeject reference in the bytecode).
I think you test case should be:-
package com.amd.aparapi.test.runtime;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.amd.aparapi.Kernel;
public class Issue78 {
static final int size = 256;
final int[] values = new int[size];
final int[] results = new int[size];
@Test public void test() {
Kernel kernel = new Kernel() {
@Override public void run() {
int gid = getGlobalId();
results[gid] = values[gid];
}
};
kernel.execute(size);
assertTrue("ran on GPU", kernel.getExecutionMode()==Kernel.EXECUTION_MODE.GPU);
}
}
Original comment by frost.g...@gmail.com
on 2 Nov 2012 at 6:51
I removed the unnecessary fooBar method but left the initialization and final
comparison assert so it will still be a useful test when this functionalty is
getting implemented.
Now that I look at it, your version is more suitable as a codegen test, right?
Because it will fail in the bytecode processing.
Original comment by ecasp...@gmail.com
on 9 Nov 2012 at 5:24
Attachments:
Original issue reported on code.google.com by
ecasp...@gmail.com
on 1 Nov 2012 at 9:04