diff --git a/projects/clr/rocclr/device/device.cpp b/projects/clr/rocclr/device/device.cpp index 2d462e952d..a45f0b76c4 100644 --- a/projects/clr/rocclr/device/device.cpp +++ b/projects/clr/rocclr/device/device.cpp @@ -438,6 +438,7 @@ Device::Device() activeWait_(false), blitProgram_(nullptr), hwDebugMgr_(nullptr), + context_(nullptr), vaCacheAccess_(nullptr), vaCacheMap_(nullptr), index_(0) { diff --git a/projects/clr/rocclr/device/device.hpp b/projects/clr/rocclr/device/device.hpp index 8c25dd9d00..a46ee414f9 100644 --- a/projects/clr/rocclr/device/device.hpp +++ b/projects/clr/rocclr/device/device.hpp @@ -1785,6 +1785,9 @@ class Device : public RuntimeObject { return false; } + //! Return context + amd::Context& context() const { return *context_; } + //! Return private global device context for P2P allocations amd::Context& GlbCtx() const { return *glb_ctx_; } @@ -1835,6 +1838,7 @@ class Device : public RuntimeObject { BlitProgram* blitProgram_; //!< Blit program info static AppProfile appProfile_; //!< application profile HwDebugManager* hwDebugMgr_; //!< Hardware Debug manager + amd::Context* context_; //!< Context static amd::Context* glb_ctx_; //!< Global context with all devices static amd::Monitor p2p_stage_ops_; //!< Lock to serialise cache for the P2P resources diff --git a/projects/clr/rocclr/device/gpu/gpudevice.cpp b/projects/clr/rocclr/device/gpu/gpudevice.cpp index 37c574af86..3eb7b7147c 100644 --- a/projects/clr/rocclr/device/gpu/gpudevice.cpp +++ b/projects/clr/rocclr/device/gpu/gpudevice.cpp @@ -804,7 +804,6 @@ Device::Device() : NullDevice(), CALGSLDevice(), numOfVgpus_(0), - context_(NULL), heap_(), dummyPage_(NULL), lockAsyncOps_(NULL), diff --git a/projects/clr/rocclr/device/gpu/gpudevice.hpp b/projects/clr/rocclr/device/gpu/gpudevice.hpp index 4eb61ca61b..35a83c7688 100644 --- a/projects/clr/rocclr/device/gpu/gpudevice.hpp +++ b/projects/clr/rocclr/device/gpu/gpudevice.hpp @@ -453,9 +453,6 @@ class Device : public NullDevice, public CALGSLDevice { //! Gets the GPU resource associated with the global heap const Memory& globalMem() const { return heap_.resource(); } - //! Gets the device context object - amd::Context& context() const { return *context_; } - //! Gets the global heap object const Heap& heap() const { return heap_; } @@ -576,7 +573,6 @@ class Device : public NullDevice, public CALGSLDevice { const VirtualGPU* vgpu //!< Virtual GPU for the allocation ); - amd::Context* context_; //!< A dummy context for internal allocations Heap heap_; //!< GPU global heap amd::Memory* dummyPage_; //!< A dummy page for NULL pointer diff --git a/projects/clr/rocclr/device/pal/paldevice.cpp b/projects/clr/rocclr/device/pal/paldevice.cpp index 7523055aa5..2c2b3964fb 100644 --- a/projects/clr/rocclr/device/pal/paldevice.cpp +++ b/projects/clr/rocclr/device/pal/paldevice.cpp @@ -716,7 +716,6 @@ Device::ScopedLockVgpus::~ScopedLockVgpus() { Device::Device() : NullDevice(), numOfVgpus_(0), - context_(nullptr), lockAsyncOps_("Device Async Ops Lock", true), lockForInitHeap_("Initialization of Heap Resource", true), lockPAL_("PAL Ops Lock", true), diff --git a/projects/clr/rocclr/device/pal/paldevice.hpp b/projects/clr/rocclr/device/pal/paldevice.hpp index 6ba4c4d16b..052577e722 100644 --- a/projects/clr/rocclr/device/pal/paldevice.hpp +++ b/projects/clr/rocclr/device/pal/paldevice.hpp @@ -517,9 +517,6 @@ class Device : public NullDevice { //! Returns PAL device interface Pal::IDevice* iDev() const { return device_; } - //! Return private device context for internal allocations - amd::Context& context() const { return *context_; } - RgpCaptureMgr* rgpCaptureMgr() const { return rgpCaptureMgr_; } //! Update free memory for OCL extension @@ -640,7 +637,6 @@ class Device : public NullDevice { static char* platformObj_; //!< Memory allocated for PAL platform object static Pal::IPlatform* platform_; //!< Pointer to the PAL platform object - amd::Context* context_; //!< A dummy context for internal allocations mutable amd::Monitor lockAsyncOps_; //!< Lock to serialise all async ops on this device //! Lock to serialise all async ops on initialization heap operation mutable amd::Monitor lockForInitHeap_; diff --git a/projects/clr/rocclr/device/rocm/rocdevice.cpp b/projects/clr/rocclr/device/rocm/rocdevice.cpp index 0cca8ab908..cf70b99750 100644 --- a/projects/clr/rocclr/device/rocm/rocdevice.cpp +++ b/projects/clr/rocclr/device/rocm/rocdevice.cpp @@ -153,7 +153,6 @@ Device::Device(hsa_agent_t bkendDevice) , pciDeviceId_(0) , gpuvm_segment_max_alloc_(0) , alloc_granularity_(0) - , context_(nullptr) , xferQueue_(nullptr) , xferRead_(nullptr) , xferWrite_(nullptr) diff --git a/projects/clr/rocclr/device/rocm/rocdevice.hpp b/projects/clr/rocclr/device/rocm/rocdevice.hpp index 61a37eaeb4..8188b40359 100644 --- a/projects/clr/rocclr/device/rocm/rocdevice.hpp +++ b/projects/clr/rocclr/device/rocm/rocdevice.hpp @@ -429,8 +429,6 @@ class Device : public NullDevice { roc::Memory* getRocMemory(amd::Memory* mem //!< Pointer to AMD memory object ) const; - amd::Context& context() const { return *context_; } - //! Create internal blit program bool createBlitProgram(); @@ -538,7 +536,6 @@ class Device : public NullDevice { size_t gpuvm_segment_max_alloc_; size_t alloc_granularity_; static constexpr bool offlineDevice_ = false; - amd::Context* context_; //!< A dummy context for internal data transfer VirtualGPU* xferQueue_; //!< Transfer queue, created on demand XferBuffers* xferRead_; //!< Transfer buffers read