Mesa 25.0 Introduces Standard Library For Driver OpenCL C
([Mesa] 3 Hours Ago
OpenCL C Driver Standard Library)
- Reference: 0001512550
- News link: https://www.phoronix.com/news/OpenCL-C-Std-Lib-Mesa-25.0
- Source link:
An interesting addition to Mesa 25.0 this week is Alyssa Rosenzweig adding a standard library for the driver OpenCL C code, including the initial abbility to support assert() on device and other standard C constructs for the OpenCL C code.
Alyssa Rosenzweig explained in the recently landed merge request for Mesa 25.0:
"Now that we have common code for precompiling driver CL C to hw binaries, the fundamentals are there for implementing driver code on CL. However, that infrastructure is still pretty barebones. This MR adds lots of common code providing a standard library for driver CL C, including lots of standard C constructs available in host C but not out-of-the-box in application CL:
abort
static_assert
assert
assorted routines ported from util/macros.h, math.h, etc
The combination of printf, abort, and assert facilitate debugging driver CL. If correctly integrated (as done here for Honeykrisp), these all work anywhere in the driver CL library - both precompiled shaders and library functions injected into application shaders."
This is good news for the Honeykrisp driver effort for Apple Silicon as part of the Asahi Linux project as well as for other Mesa open-source drivers.
Those interested in more details on this standard library implementation for driver OpenCL C code can see [1]this merge request that was merged to Mesa 25.0-devel on Friday.
[1] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32529
Alyssa Rosenzweig explained in the recently landed merge request for Mesa 25.0:
"Now that we have common code for precompiling driver CL C to hw binaries, the fundamentals are there for implementing driver code on CL. However, that infrastructure is still pretty barebones. This MR adds lots of common code providing a standard library for driver CL C, including lots of standard C constructs available in host C but not out-of-the-box in application CL:
abort
static_assert
assert
assorted routines ported from util/macros.h, math.h, etc
The combination of printf, abort, and assert facilitate debugging driver CL. If correctly integrated (as done here for Honeykrisp), these all work anywhere in the driver CL library - both precompiled shaders and library functions injected into application shaders."
This is good news for the Honeykrisp driver effort for Apple Silicon as part of the Asahi Linux project as well as for other Mesa open-source drivers.
Those interested in more details on this standard library implementation for driver OpenCL C code can see [1]this merge request that was merged to Mesa 25.0-devel on Friday.
[1] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32529
phoronix