[all-commits] [llvm/llvm-project] 221ada: [libomptarget] Implement locks for amdgcn
Jon Chesterfield via All-commits
all-commits at lists.llvm.org
Thu Mar 5 12:25:53 PST 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 221ada654b28a524d01dc70ec16d38e0f2484f78
https://github.com/llvm/llvm-project/commit/221ada654b28a524d01dc70ec16d38e0f2484f78
Author: Jon Chesterfield <jonathanchesterfield at gmail.com>
Date: 2020-03-05 (Thu, 05 Mar 2020)
Changed paths:
M openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
A openmp/libomptarget/deviceRTLs/amdgcn/src/amdgcn_locks.hip
Log Message:
-----------
[libomptarget] Implement locks for amdgcn
Summary:
[libomptarget] Implement locks for amdgcn
The nvptx implementation deadlocks on amdgcn. atomic_cas with multiple
active lanes can deadlock - if one lane succeeds, all the others are locked
out. The set_lock implementation therefore runs on a single lane.
Also uses a sleep intrinsic instead of the system clock for a probably
minor performance improvement. The unset/test implementations may be revised
later, based on code size / performance or similar concerns.
This implements the lock at a per-wavefront scope. That's not strictly as
specified, since openmp describes locks in terms of threads. I think the
nvptx implementation provides true per-thread locking on volta and the same
per-warp locking on other architectures.
Reviewers: jdoerfert, ABataev, grokos
Reviewed By: jdoerfert
Subscribers: jvesely, mgorny, jfb, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D75546
More information about the All-commits
mailing list