[llvm-dev] [Non-DoD Source] Re: llvm OpenMP support for Apple Silicon

GRISMER, MATTHEW J CIV USAF AFMC AFRL/RQVC via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 19 13:24:05 PDT 2021


According to the Apple documentation, you access the GPU via their Metal API.  Metal supports computation as well as graphics acceleration.  Digging a little deeper, kernels that run on the GPU are written in Metal Shading Language, which is a variant of C++ designed for GPUs.  The preparatory stuff to get the kernel running on the GPU is all done through a Metal Objective-C/C++ object which is tied to the particular device you want to use.  With that object you get a reference to your kernel function(s), setup a pipeline (converts function to executable code), create a queue, create data buffers and load data, create a command buffer and encode commands, specify thread count and group size, and commit the queue to execute it.  Somewhat similar to how SYCL works, at least from what I’ve read.  Since Apple uses LLVM/Clang for their system compiler, I assume it is also used to compile for the GPU.  Anyway, the short answer to the question appears to be OpenMP offload would need to be implemented using Apple’s Metal API.


From: Johannes Doerfert <johannesdoerfert at gmail.com>
Date: Saturday, October 16, 2021 at 12:30 PM
To: GRISMER, MATTHEW J CIV USAF AFMC AFRL/RQVC <matthew.grismer at us.af.mil>, llvm-dev at lists.llvm.org <llvm-dev at lists.llvm.org>
Cc: openmp-dev <openmp-dev at lists.llvm.org>
Subject: [Non-DoD Source] Re: [llvm-dev] llvm OpenMP support for Apple Silicon
Hi Matt,

not that I'm aware of any ongoing effort.

Though, I'm not an expert on Apple hardware (or software for that matter).
How would you program them right now?
Does LLVM have code generation capabilities for those GPUs?

Depending on the answers it might be reasonable to add OpenMP offloading
support (or not).

~ Johannes

llvm-dev wrote:
> Hi,
> I'm interested in exploring Apple Silicon performance with computational fluid dynamic codes, in particular codes that take advantage of OpenMP offload to accelerate performance.  Are there any plans to support OpenMP offload to the integrated GPU in Apple Silicon processors?
> Thanks.
> Matt
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211019/448111ad/attachment.html>

More information about the llvm-dev mailing list