[PATCH] D116967: [HIP] Fix device malloc/free

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 11 06:41:44 PST 2022


yaxunl added inline comments.


================
Comment at: clang/lib/Headers/__clang_hip_runtime_wrapper.h:80
 
+#if HIP_VERSION_MAJOR > 4 || (HIP_VERSION_MAJOR == 4 && HIP_VERSION_MINOR >= 5)
+extern "C" __device__ unsigned long long __ockl_dm_alloc(unsigned long long __size);
----------------
tra wrote:
> Nit: perhaps something like this would express the intent a bit more directly:
> 
> ```
> # if HIP_VERSION_MAJOR*100+HIP_VERSION_MINOR*10 > 450
> ```
> 
> 
We had ROCm 3.10, so the minor version may be 10 or greater.

Probably use HIP_VERSION_MAJOR*100+HIP_VERSION_MINOR > 405 instead?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116967/new/

https://reviews.llvm.org/D116967



More information about the cfe-commits mailing list