arch-gcn3: Fix initAtomicAccess.
This function used makeAtomicOpFunctor to create a unique_ptr which pointed to an AtomicOpFunctor *, which it immediately extracted with .get(). Then since the temporary unique_ptr went out of scope, it deleted the AtomicOpFunctor which it just returned a pointer to. Instead, that function should create a local unique_ptr to pass ownership of the object off to. It will still be cleaned up when it goes out of scope, but not before it's done being used. Change-Id: I74a0bcbb719a78a3e9ec8cb2ea5aa15120da0456 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49023 Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com> Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu> Reviewed-by: Kyle Roarty <kyleroarty1716@gmail.com> Maintainer: Matt Sinclair <mattdsinclair@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -886,12 +886,12 @@ namespace Gcn3ISA
|
||||
for (int lane = 0; lane < NumVecElemPerVecReg; ++lane) {
|
||||
if (gpuDynInst->exec_mask[lane]) {
|
||||
Addr vaddr = gpuDynInst->addr[lane];
|
||||
AtomicOpFunctor* amo_op =
|
||||
auto amo_op =
|
||||
gpuDynInst->makeAtomicOpFunctor<T>(
|
||||
&(reinterpret_cast<T*>(
|
||||
gpuDynInst->a_data))[lane],
|
||||
&(reinterpret_cast<T*>(
|
||||
gpuDynInst->x_data))[lane]).get();
|
||||
gpuDynInst->x_data))[lane]);
|
||||
|
||||
T tmp = wf->ldsChunk->read<T>(vaddr);
|
||||
(*amo_op)(reinterpret_cast<uint8_t *>(&tmp));
|
||||
|
||||
Reference in New Issue
Block a user