aparapi icon indicating copy to clipboard operation
aparapi copied to clipboard

Fix synthetic long local descriptors

Open hunterbastian opened this issue 6 months ago • 0 comments

Fixes #10.

Summary

  • map synthetic fake-local-table long variables to the JVM J descriptor instead of the object/class L descriptor
  • add a Monte Carlo codegen regression that compiles the kernel with -g:none during the test, covering long seed = (long) idx when 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 a long declaration
  • 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.

hunterbastian avatar May 14 '26 06:05 hunterbastian