Skip to content

Escape OpenCL keyword identifiers#202

Open
justwe-bot wants to merge 1 commit into
Syncleus:masterfrom
justwe-bot:codex/escape-opencl-keyword-identifiers
Open

Escape OpenCL keyword identifiers#202
justwe-bot wants to merge 1 commit into
Syncleus:masterfrom
justwe-bot:codex/escape-opencl-keyword-identifiers

Conversation

@justwe-bot
Copy link
Copy Markdown

Fixes #54.

Summary

  • add an OpenCL reserved identifier guard in BlockWriter
  • mangle Java identifiers that collide with OpenCL keywords by prefixing aparapi_
  • apply the same mangling to generated field names, kernel arguments, local variables, array length/dimension helper names, getter output, and object struct fields
  • add a codegen regression test using legal Java identifiers that are OpenCL keywords: constant, kernel, and global

Verification

git diff --check

I could not run the Java test suite locally because this environment does not have a Java runtime or Maven installed:

java: Unable to locate a Java Runtime
mvn: command not found

The focused test added is OpenCLKeywordIdentifierTest, which asserts the generated OpenCL uses aparapi_constant, aparapi_kernel, and aparapi_global instead of raw OpenCL keyword identifiers.

Payout preference if needed: USDT/USDT0 on Arbitrum One, 0x69c25c0b82093513abaf8d9c50d17e0564e91505.

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] OpenCL keywords are not escaped during code generation

1 participant