SWDEV-286346 - Implement Arena Memory Object for externally created memory.

Change-Id: I8530602d89edf83ad367c52167e48a1559ee1e18


[ROCm/clr commit: 1c49d8816c]
This commit is contained in:
kjayapra-amd
2021-05-13 21:49:01 -04:00
committed by Karthik Jayaprakash
parent c521759b09
commit aae0d4ca51
7 changed files with 67 additions and 5 deletions
+14
View File
@@ -36,6 +36,7 @@
#include <map>
#include <unordered_map>
#include <memory>
#include <limits>
#define CL_MEM_FOLLOW_USER_NUMA_POLICY (1u << 31)
#define ROCCLR_MEM_HSA_SIGNAL_MEMORY (1u << 30)
@@ -133,6 +134,12 @@ class Memory : public amd::RuntimeObject {
: callback_(callback), data_(data) {}
};
public:
enum MemoryType {
kSvmMemoryPtr = 0x1,
kArenaMemoryPtr = 0x2
};
protected:
typedef cl_mem_object_type Type;
typedef cl_mem_flags Flags;
@@ -639,6 +646,13 @@ class LiquidFlashFile : public RuntimeObject {
virtual ObjectType objectType() const { return ObjectTypeLiquidFlashFile; }
};
class ArenaMemory: public Buffer {
public:
ArenaMemory(Context& context)
: Buffer(context, 0, std::numeric_limits<uint64_t>::max(), kArenaMemoryPtr) {}
};
} // namespace amd
#endif // MEMORY_H_