Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/49023 )

Change subject: arch-gcn3: Fix initAtomicAccess.
......................................................................

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
---
M src/arch/amdgpu/gcn3/insts/op_encodings.hh
1 file changed, 2 insertions(+), 2 deletions(-)



diff --git a/src/arch/amdgpu/gcn3/insts/op_encodings.hh b/src/arch/amdgpu/gcn3/insts/op_encodings.hh
index 27b9b99..24edfa7 100644
--- a/src/arch/amdgpu/gcn3/insts/op_encodings.hh
+++ b/src/arch/amdgpu/gcn3/insts/op_encodings.hh
@@ -886,12 +886,12 @@
                 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));

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/49023
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I74a0bcbb719a78a3e9ec8cb2ea5aa15120da0456
Gerrit-Change-Number: 49023
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to