[Openmp-commits] [PATCH] D139208: [OpenMP][libomptarget][AMDGPU] lock/unlock (pin/unpin) mechanism in libomptarget amdgpu plugin (API and implementation)

Carlo Bertolli via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jan 17 08:02:30 PST 2023


carlo.bertolli added a comment.

In D139208#4059152 <https://reviews.llvm.org/D139208#4059152>, @kevinsala wrote:

> @carlo.bertolli is there documentation regarding `llvm_omp_target_lock_mem` `llvm_omp_target_unlock_mem`? While reading the comments of this patch, I see that the API ensures that locked areas feature reference counting. But I have the following doubts. Should the API support locking memory buffers that were already locked (e.g., complete or partial overlapping)? What's the behavior in such a case?

I didn't add documentation for those two APIs, but indeed I should have. Is API description in code enough or is there a better/different place for it?
According to the ROCr implementation of lock/pin and unlock/unpin:
https://github.com/RadeonOpenCompute/ROCR-Runtime/blob/master/src/inc/hsa_ext_amd.h#L1525
double locking just keeps things locked. There is a comment about overlapping pages for two calls to lock that leaves the pages locked.
I don't think we need to report double locks if ref counting works correctly and I do think we should allow double locking.
My two cents. Thanks for the question!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139208



More information about the Openmp-commits mailing list