<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Johannes,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Matt<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Johannes Doerfert <johannesdoerfert@gmail.com><br>
<b>Date: </b>Saturday, October 16, 2021 at 12:30 PM<br>
<b>To: </b>GRISMER, MATTHEW J CIV USAF AFMC AFRL/RQVC <matthew.grismer@us.af.mil>, llvm-dev@lists.llvm.org <llvm-dev@lists.llvm.org><br>
<b>Cc: </b>openmp-dev <openmp-dev@lists.llvm.org><br>
<b>Subject: </b>[Non-DoD Source] Re: [llvm-dev] llvm OpenMP support for Apple Silicon<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">Hi Matt,<br>
<br>
not that I'm aware of any ongoing effort.<br>
<br>
Though, I'm not an expert on Apple hardware (or software for that matter).<br>
How would you program them right now?<br>
Does LLVM have code generation capabilities for those GPUs?<br>
<br>
Depending on the answers it might be reasonable to add OpenMP offloading <br>
support (or not).<br>
<br>
~ Johannes<br>
<br>
<br>
On 10/15/21 12:42, GRISMER, MATTHEW J CIV USAF AFMC AFRL/RQVC via <br>
llvm-dev wrote:<br>
> Hi,<br>
><br>
> 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?<br>
><br>
> Thanks.<br>
><br>
> Matt<br>
><br>
><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> llvm-dev@lists.llvm.org<br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><o:p></o:p></p>
</div>
</div>
</body>
</html>