[libomptarget] [amdgpu] After a kernel dispatch packet is published, its contents...
authorDhruva Chakrabarti <Dhruva.Chakrabarti@amd.com>
Wed, 29 Sep 2021 05:44:14 +0000 (22:44 -0700)
committerDhruva Chakrabarti <Dhruva.Chakrabarti@amd.com>
Wed, 29 Sep 2021 16:22:07 +0000 (09:22 -0700)
commit622627025332af4bfa01057210f315b2278a9439
tree9c1d22502e951cb6f693655850c1471ae6a62a4c
parent6e2afdb7f508a08018def9f3b33179527159be92
[libomptarget] [amdgpu] After a kernel dispatch packet is published, its contents must not be accessed.

Fixes: SWDEV-275232 (With contributions from Ammar Elwazir, Laurent Morichetti, and Tony Tye)

The current code is racy. After the packet is submitted, the GPU will increment the read index. If this wraps around before the memory is read from it'll refer to a signal from an unrelated packet. Change avoids reading from the packet post-submission.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D110679
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp