Fix Macos support
I know that Apple sadly deprecated the OpenCL Framework on MacOS, but I'd love to use this SDK either way but it is difficult to use this sdk when I have to manually switch to use the OpenCL framework instead of the sdks binaries.
Hi!
The OpenCL SDK should work with MacOS and we have CI testing on MacOS in place. There are a few gremlins we might need to chase down, but at the time of our last release things were mostly working, see: https://github.com/KhronosGroup/OpenCL-SDK/pull/145
The one gotcha is that this only works (or at least, is only tested) through the OpenCL ICD loader and hence OpenCL ICDs, such as PoCL. I suppose some of the samples might work with the OpenCL frameworks instead, but the OpenCL frameworks are quite old at this point.
Do you have a set of changes to use the OpenCL frameworks instead? If so, it might be worth a PR to see the scope of the changes, even if it isn't the primary focus of this project.
Weirdly when I try to build the sdk everything works, but the built clinfo and a small test program outputs zero available devices. When I am running clinfo that I installed via homebrew it outputs one available target device. Maybe I just overread something but the output of the auto-build clinfo is this
ICD loader properties
ICD loader Name Khronos OpenCL ICD Loader
ICD loader Vendor Khronos Group
ICD loader Version 3.0.7
ICD loader Profile OpenCL 3.0
whereas the brew version outputs something like this
Platform Name Apple
Platform Vendor Apple
Platform Version OpenCL 1.2 (Aug 2 2025 21:16:03)
Platform Profile FULL_PROFILE
Platform Extensions cl_APPLE_SetMemObjectDestructor cl_APPLE_ContextLoggingFunctions cl_APPLE_clut cl_APPLE_query_kernel_names cl_APPLE_gl_sharing cl_khr_gl_event
Platform Name Apple
Number of devices 1
Device Name Apple M4 Pro
...
...
Do I have to set up anything else besides running the commands in the readme? Or what am I doing wrong?
I've also tried compiling clinfo manually by cloning that repo and compiling it with make (not even using the OS=Homebrew flag) and that works just fine like the homebrew installation
Fail on my Mac M4 Pro devices. Simply shows "OpenCL runtime error: clGetPlatformIDs (-1001)" on all demos
I would love to use this project on all my OpenCL development if you can fix it.