[code-reflection] RFR: Support for Generalized Buffer Type in Hat SPIR-V Backend
Paul Sandoz
psandoz at openjdk.org
Thu Dec 19 18:57:52 UTC 2024
On Mon, 16 Dec 2024 22:02:23 GMT, hanklo6 <duke at openjdk.org> wrote:
> This PR introduces support for generalized buffer by creating SPIRV type structure and arrays in the generated module. Most of the implementation references the OpenCL Hat builder. The SPIR-V module assumes the same memory layout as the java buffer object, provided there is not additional customized padding between fields. Also, generated dependent functions from callgraph instead of using code model to resolve the issue where private functions can't be accessed.
>
> The blackscholes, mandel, and violajones examples now run successfully. However, the violajones example still gets wrong value when accessing `threshold` from `stage` inside `isAFaceStage` function, so I currently update the condition to `sumOfThisStage > threshold`.
>
> For machines that don't have `float64` capability, enable `FP64` emulation by setting the environment variable: `OverrideDefaultFP64Settings=1` and `IGC_EnableDPEmulation=1` before running. For more details: https://github.com/intel/compute-runtime/blob/master/opencl/doc/FAQ.md#feature-double-precision-emulation-fp64
hat/backends/spirv/src/main/java/intel/code/spirv/SpirvModuleGenerator.java line 238:
> 236: }
> 237:
> 238: private void generateTypeDeclaration(Object... args) {
@grfrost can better advise, but if possible it might be better to work directly off the `MemoryLayout` objects used by the buffer, that's also a more general solution.
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/298#discussion_r1892996224
More information about the babylon-dev
mailing list