[Openmp-commits] [PATCH] D129787: [OpenMP][AMDGPU] Add the support for `malloc` and `free` for AMDGPU

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jul 14 10:26:18 PDT 2022

tianshilei1992 created this revision.
tianshilei1992 added reviewers: jdoerfert, JonChesterfield, jhuber6.
Herald added subscribers: kosarev, guansong, t-tye, tpr, dstuttard, yaxunl, mgorny, kzhuravl.
Herald added a project: All.
tianshilei1992 requested review of this revision.
Herald added subscribers: openmp-commits, sstefan1, wdng.
Herald added a project: OpenMP.

This patch adds the basic support for `malloc` and `free` for AMDGPU.
It borrows the idea from `clang/lib/Headers/__clang_hip_runtime_wrapper.h` but
ignores the two checks: HIP version, and whether enabling device malloc. Arguably,
this doesn't make things worse. Currently no matter which HIP version users are
using, or whether the device malloc is enabled, they will all get link error if
they use `malloc` and `free` in target region. Then for users using pre ROCm 4.5,
they still get link error. That also helps to get rid of the check whether device
malloc is enabled because it is only needed for before ROCm 4.5. The good part is,
users using ROCm 4.5+ would get the feature.

  rG LLVM Github Monorepo



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129787.444715.patch
Type: text/x-patch
Size: 6497 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220714/dc41d10e/attachment.bin>

More information about the Openmp-commits mailing list