Skip to content

Fix synthetic long local descriptors#209

Open
hunterbastian wants to merge 1 commit into
Syncleus:masterfrom
hunterbastian:fix-issue-10-montecarlo-local-scope
Open

Fix synthetic long local descriptors#209
hunterbastian wants to merge 1 commit into
Syncleus:masterfrom
hunterbastian:fix-issue-10-montecarlo-local-scope

Conversation

@hunterbastian
Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOUNTY $25] Kernel error for MonteCarlo on NVIDIA and AMD GPUs

1 participant