[code-reflection] Integrated: [hat][API] ComputeRange moved to NDRange

Juan Fumero jfumero at openjdk.org
Tue Nov 4 14:46:28 UTC 2025


On Tue, 4 Nov 2025 10:28:32 GMT, Juan Fumero <jfumero at openjdk.org> wrote:

> This PR refactors the `NDRange` and the `ComputeRange`.
> 
> NDRange removes the need for the accelerator object, and the internal kernelContext. 
> 
> Instead the `ComputeRange` has been moved to an `NDRange`. Thus, from this change, this is how we will dispatch kernels:
> 
> 
> NDRange ndRange = NDRange.of(new Global2D(globalSize, globalSize), new Local2D(BLOCK_SIZE, BLOCK_SIZE));
>         cc.dispatchKernel(ndRange,
>                 kc -> matrixMultiplyKernel2DLI(kc, matrixA, matrixB, matrixC, globalSize)
>         );
> 
> 
> We add also a set of factory methods to facilitate composing NDRanges when 1D is required :
> 
> For instance:
> 
> 
> cc.dispatchKernel( NDRange.of(call.length()), 
>    kc -> blackScholesKernel(kc, call, put, S, X, T, r, v)
>  );

This pull request has now been integrated.

Changeset: 5332a2e3
Author:    Juan Fumero <jfumero at openjdk.org>
URL:       https://git.openjdk.org/babylon/commit/5332a2e37c02e790c3023847e0191dba3616b22c
Stats:     943 lines in 64 files changed: 256 ins; 387 del; 300 mod

[hat][API] ComputeRange moved to NDRange

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

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


More information about the babylon-dev mailing list