Gabe Black has submitted this change. ( 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
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49023
Reviewed-by: Matt Sinclair <[email protected]>
Reviewed-by: Bobby R. Bruce <[email protected]>
Reviewed-by: Kyle Roarty <[email protected]>
Maintainer: Matt Sinclair <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/arch/amdgpu/gcn3/insts/op_encodings.hh
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
Matt Sinclair: Looks good to me, but someone else must approve; Looks good to me, approved
  Kyle Roarty: Looks good to me, approved
  Bobby R. Bruce: Looks good to me, approved
  kokoro: Regressions pass



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: 2
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Alex Dutu <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Kyle Roarty <[email protected]>
Gerrit-Reviewer: Matt Sinclair <[email protected]>
Gerrit-Reviewer: Matthew Poremba <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to