This repository was archived by the owner on Jan 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,11 @@ class Memory : public amd::RuntimeObject {
141141 kArenaMemoryPtr = 0x2
142142 };
143143
144+ struct UserData
145+ {
146+ int deviceId = 0 ;
147+ };
148+
144149 protected:
145150 typedef cl_mem_object_type Type;
146151 typedef cl_mem_flags Flags;
@@ -184,6 +189,9 @@ class Memory : public amd::RuntimeObject {
184189 uint32_t flagsEx_;
185190 };
186191
192+ // ! used to save the user data during memory allocation.
193+ UserData userData_;
194+
187195 private:
188196 // ! Disable default assignment operator
189197 Memory& operator =(const Memory&);
@@ -357,6 +365,11 @@ class Memory : public amd::RuntimeObject {
357365 // ! Returns the base device memory object for possible P2P access
358366 device::Memory* BaseP2PMemory () const { return deviceMemories_[0 ].value_ ; }
359367 device::Memory* svmBase () const { return svmBase_; } // !< Returns SVM base for MGPU case
368+
369+
370+ // !save the user data during memory allocation
371+ UserData& getUserData () { return userData_; }
372+
360373};
361374
362375// ! Buffers are a specialization of memory. Just a wrapper, really,
You can’t perform that action at this time.
0 commit comments