[code-reflection] Integrated: Add platform capability checks to bld and mkpoms

Gary Frost gfrost at openjdk.org
Fri Dec 6 13:27:34 UTC 2024


Added platform capability checking to bld and mkpoms

This allows the build to determine if the platform say has OpenCL/CUDA/OpenGL etc. 

We piggy back on cmake to do this. via CMakeProbe class.

We pass the list of requested capabilities to CMakeProbe,  which builds a simple CMakeLists.txt, executes and extracts its state (basically collects all of the CMake internal Vars). The vars are passed to each capability and individual cababilities can use these vars to determine whether the capabity exists, and to determine usefil unfi (where are the header files for OpenCL for instance).

So now nbody example (which needs opencl and opengl extracted via jextract) will only attempt to build on platforms with these capabilities. 

In future we may need to support capabities that cmake can't help us with.  Such as HIP

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

Commit messages:
 - Add platform capability checks to bld and mkpoms

Changes: https://git.openjdk.org/babylon/pull/292/files
  Webrev: https://webrevs.openjdk.org/?repo=babylon&pr=292&range=00
  Stats: 1101 lines in 8 files changed: 656 ins; 179 del; 266 mod
  Patch: https://git.openjdk.org/babylon/pull/292.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/292/head:pull/292

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


More information about the babylon-dev mailing list