Skip to content

Fix synthetic long local declarations#188

Open
KingParmenides wants to merge 1 commit into
Syncleus:masterfrom
KingParmenides:bounty-10-long-local-descriptor
Open

Fix synthetic long local declarations#188
KingParmenides wants to merge 1 commit into
Syncleus:masterfrom
KingParmenides:bounty-10-long-local-descriptor

Conversation

@KingParmenides
Copy link
Copy Markdown

Summary

Fixes #10.

When Aparapi has to synthesize a local variable table for bytecode compiled without -g, long locals were recorded with descriptor L. In JVM descriptors, L starts an object reference type; scalar long is J. That made the generated OpenCL omit the declaration for locals such as long seed = (long) idx;, producing output like l_3 = (long)i_1;.

Changes

  • Map synthetic long local descriptors to JVM descriptor J.
  • Add a regression test that compiles a fixture with -g:none and checks that the generated OpenCL declares long l_3 for the cast-initialized local.

Verification

JAVA_HOME=/private/tmp/jdk-11 PATH=/private/tmp/apache-maven-3.9.11/bin:/private/tmp/jdk-11/bin:$PATH mvn -q -Dmaven.repo.local=/private/tmp/aparapi-m2 -DsecondaryCacheDir=/private/tmp/aparapi-zinc-jdk11 -DargLine="-XX:+IgnoreUnrecognizedVMOptions" -Dtest=LongVariableDeclarationWithCastNoDebugInfoTest,FirstAssignInExpressionTest,MultipleAssignTest test
JAVA_HOME=/private/tmp/jdk-11 PATH=/private/tmp/apache-maven-3.9.11/bin:/private/tmp/jdk-11/bin:$PATH mvn -q -Dmaven.repo.local=/private/tmp/aparapi-m2 -DsecondaryCacheDir=/private/tmp/aparapi-zinc-jdk11 -DargLine="-XX:+IgnoreUnrecognizedVMOptions" -DskipTests package

I also ran the full test suite. It reaches 576 tests but fails three existing runtime tests in this environment while repeatedly reporting that the OpenCL native library/device is unavailable: ArrayTest, AccessGetterSetterTest, and CallStaticFromAnonymousKernelTest.

If the bounty is still active and BTC payment is available: 39Q34P8A7g375yqEr8buvNJkUbRgKfbKQZ.

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