[code-reflection] Integrated: CUDA and OpenCL C99 code now identical except for handling of atomics

Gary Frost gfrost at openjdk.org
Sat Oct 4 11:06:31 UTC 2025


Generated code essentially same for CUDA and OpenCL.  

Not only does this lend itself to simpler codegen, it also opens the doorway to a HAT C99 dialect which we can use for prototyping and even intrinsics

Check the code generated for 

HAT=SHOW_CODE java @hat/test ffi-opencl
HAT=SHOW_CODE java @hat/test ffi-cuda
``` 
The only differences should be the generated preprocessor macros.

We need to deal with atomics .... somehow. Still thinking about that.

-------------

Commit messages:
 - CUDA and OpenCL C99 code now identical except for handling of atomics

Changes: https://git.openjdk.org/babylon/pull/603/files
  Webrev: https://webrevs.openjdk.org/?repo=babylon&pr=603&range=00
  Stats: 90 lines in 3 files changed: 0 ins; 28 del; 62 mod
  Patch: https://git.openjdk.org/babylon/pull/603.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/603/head:pull/603

PR: https://git.openjdk.org/babylon/pull/603


More information about the babylon-dev mailing list