Files
compute-runtime/runtime/gmm_helper/client_context/gmm_client_context_base.h
Jobczyk, Lukasz 3fc748c0f9 Use newer GMM API
Related-To: NEO-3832

Change-Id: I9c97a20a6a611118eb14348a8c6960115a20777d
Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2019-11-05 08:30:09 +01:00

40 lines
1.4 KiB
C++

/*
* Copyright (C) 2018-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "runtime/gmm_helper/gmm_lib.h"
#include <memory>
namespace NEO {
class GmmClientContext;
struct HardwareInfo;
class GmmClientContextBase {
public:
virtual ~GmmClientContextBase();
MOCKABLE_VIRTUAL MEMORY_OBJECT_CONTROL_STATE cachePolicyGetMemoryObject(GMM_RESOURCE_INFO *pResInfo, GMM_RESOURCE_USAGE_TYPE usage);
MOCKABLE_VIRTUAL GMM_RESOURCE_INFO *createResInfoObject(GMM_RESCREATE_PARAMS *pCreateParams);
MOCKABLE_VIRTUAL GMM_RESOURCE_INFO *copyResInfoObject(GMM_RESOURCE_INFO *pSrcRes);
MOCKABLE_VIRTUAL void destroyResInfoObject(GMM_RESOURCE_INFO *pResInfo);
GMM_CLIENT_CONTEXT *getHandle() const;
template <typename T>
static std::unique_ptr<GmmClientContext> create(HardwareInfo *hwInfo, decltype(&InitializeGmm) initFunc, decltype(&GmmDestroy) destroyFunc) {
return std::make_unique<T>(hwInfo, initFunc, destroyFunc);
}
MOCKABLE_VIRTUAL uint8_t getSurfaceStateCompressionFormat(GMM_RESOURCE_FORMAT format);
MOCKABLE_VIRTUAL uint8_t getMediaSurfaceStateCompressionFormat(GMM_RESOURCE_FORMAT format);
protected:
GMM_CLIENT_CONTEXT *clientContext;
GmmClientContextBase(HardwareInfo *hwInfo, decltype(&InitializeGmm) initFunc, decltype(&GmmDestroy) destroyFunc);
decltype(&GmmDestroy) destroyFunc;
};
} // namespace NEO