[code-reflection] RFR: HAT memory mallocs and copies improved

Juan Fumero jfumero at openjdk.org
Fri Dec 12 11:40:44 UTC 2025


Use of `MappableIface` annotations to tag the buffer accessor for OpenCL. 
In addition, this PR reuses buffers attach to each dispatch and copies the data that is needed. 

For OpenCL and macOS, this PR in HAT increases performance of up to 30% end-to-end time (including data movement).

Buffer accessors are not available for CUDA, but the CUDA runtime in HAT minimizes the transfers as well as cuda allocations. 

How to test? All unit-tests should be passing:


java @hat/test-suite ffi-opencl


Run violajones:


HAT=MINIMIZE_COPIES java -cp hat/job.jar hat.java run ffi-opencl -Dheadless=true violajones
``` 

Run GoL:


java @hat/run ffi-opencl life

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

Commit messages:
 - Merge branch 'code-reflection' into hat/memory/accessors
 - [hat] using the same type for accessors
 - [hat] improving data handler and transfers
 - [hat] cuda buffer allocs and copies minimized
 - [hat][wip] Improvements MemAlloc and data copies

Changes: https://git.openjdk.org/babylon/pull/746/files
  Webrev: https://webrevs.openjdk.org/?repo=babylon&pr=746&range=00
  Stats: 120 lines in 15 files changed: 24 ins; 22 del; 74 mod
  Patch: https://git.openjdk.org/babylon/pull/746.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/746/head:pull/746

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


More information about the babylon-dev mailing list