<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Yes, but you will need to cast the returned void pointer and declare the function `extern "C"` so the name doesn't get mangled.</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Itaru Kitayama <itaru.kitayama@gmail.com><br>
<b>Sent:</b> Thursday, June 10, 2021 1:23 AM<br>
<b>To:</b> Huber, Joseph <huberjn@ornl.gov><br>
<b>Cc:</b> openmp-dev <openmp-dev@lists.llvm.org><br>
<b>Subject:</b> Re: [EXTERNAL] [Openmp-dev] undefined reference to `llvm_omp_target_alloc_shared</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi Joseph, all,<br>
I was looking at too the test code in the libomptarget/test/api<br>
directory, and it can be built with today's main branch Clang.<br>
<br>
However, are the llvm_ prefixed omp_targer_allocs callable from C++ codes?<br>
<br>
On Wed, Jun 9, 2021 at 9:48 PM Huber, Joseph <huberjn@ornl.gov> wrote:<br>
><br>
> The special allocators are supported upstream only for the nvptx64 target. The library interface was added in March and the nvptx64 implementation in May. The test file `omp_device_managed_memory.c` gives an example usage.<br>
> ________________________________<br>
> From: Openmp-dev <openmp-dev-bounces@lists.llvm.org> on behalf of Itaru Kitayama via Openmp-dev <openmp-dev@lists.llvm.org><br>
> Sent: Wednesday, June 9, 2021 1:30 AM<br>
> To: openmp-dev <openmp-dev@lists.llvm.org><br>
> Subject: [EXTERNAL] [Openmp-dev] undefined reference to `llvm_omp_target_alloc_shared<br>
><br>
> I'd like to use llvm_omp_targe_alloc_shared(), but can't link with Clang 12;<br>
> are they available in main?<br>
> _______________________________________________<br>
> Openmp-dev mailing list<br>
> Openmp-dev@lists.llvm.org<br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev</a><br>
</div>
</span></font></div>
</body>
</html>