aparapi
aparapi copied to clipboard
Fix synthetic long local descriptors
Fixes #10.
Summary
- map synthetic fake-local-table long variables to the JVM
Jdescriptor instead of the object/classLdescriptor - add a Monte Carlo codegen regression that compiles the kernel with
-g:noneduring the test, coveringlong seed = (long) idxwhen no local variable table is available - ensure the generated OpenCL declares the synthetic long local before assigning it
Verification
javac -g:none -source 8 -target 8 -cp target/classes:/private/tmp/bcel-6.5.0.jar:/private/tmp/commons-lang3-3.10.jar -d /private/tmp/aparapi-check /private/tmp/RunMonteCodegen.java- before the fix, the harness reproduced
l_3 = (long)i_1;without alongdeclaration - after the fix, the harness emits
long l_3 = (long)i_1; java -cp /private/tmp/aparapi-check:target/test-classes:target/classes:/private/tmp/bcel-6.5.0.jar:/private/tmp/commons-lang3-3.10.jar:/private/tmp/junit-4.13.2.jar:/private/tmp/hamcrest-core-1.3.jar org.junit.runner.JUnitCore com.aparapi.codegen.test.MonteCarloNoDebugLocalVariableTest com.aparapi.codegen.test.ReturnLongArrayVarTest com.aparapi.codegen.test.DremTest com.aparapi.codegen.test.ArbitraryScopeTest->OK (5 tests)git diff --check
Note: Maven is not installed in my local environment, so I used the already-built project classes plus the minimal test/runtime jars above for focused verification.