Fix destruction sequence in execution environment.

- Gmm needs to be closed after memory manager.

Change-Id: I608fc328034012ce52b7e791afd9ad2ff2f0cd1a
This commit is contained in:
Mrozek, Michal
2018-07-13 07:42:18 +02:00
committed by sys_ocldev
parent a8ce3ca00a
commit e34c47271b
3 changed files with 37 additions and 4 deletions

View File

@ -32,14 +32,14 @@ class ExecutionEnvironment : public ReferenceTrackedObject<ExecutionEnvironment>
private:
DeviceFactoryCleaner cleaner;
protected:
std::unique_ptr<GmmHelper> gmmHelper;
public:
ExecutionEnvironment();
~ExecutionEnvironment() override;
void initGmm(const HardwareInfo *hwInfo);
std::unique_ptr<CommandStreamReceiver> commandStreamReceiver;
std::unique_ptr<MemoryManager> memoryManager;
protected:
std::unique_ptr<GmmHelper> gmmHelper;
};
} // namespace OCLRT

View File

@ -41,7 +41,7 @@ class GmmHelper {
public:
GmmHelper() = delete;
GmmHelper(const HardwareInfo *hwInfo);
~GmmHelper();
MOCKABLE_VIRTUAL ~GmmHelper();
static constexpr uint32_t cacheDisabledIndex = 0;
static constexpr uint32_t cacheEnabledIndex = 4;
static constexpr uint32_t maxPossiblePitch = 2147483648;