Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit 9c4c34a

Browse files
committed
SWDEV-301069 - current device id saved while allocating memory in VDI
Change-Id: Ic5426895fb1d152e4e6e1baf8b938f35c85fa3d8
1 parent dbb1ce0 commit 9c4c34a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

platform/memory.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)