Files
compute-runtime/shared/source/gmm_helper/resource_info_impl.cpp
Mateusz Jablonski 7df9945ebe Add absolute include paths
Change-Id: I67a6919bbbff1d30c7d6cdb257b41c87bad51e7f
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2020-02-23 23:49:12 +01:00

33 lines
1.1 KiB
C++

/*
* Copyright (C) 2018-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/gmm_helper/gmm_helper.h"
#include "shared/source/gmm_helper/resource_info.h"
#include "gmm_client_context.h"
namespace NEO {
GmmResourceInfo::GmmResourceInfo(GmmClientContext *clientContext, GMM_RESCREATE_PARAMS *resourceCreateParams) : clientContext(clientContext) {
auto resourceInfoPtr = clientContext->createResInfoObject(resourceCreateParams);
createResourceInfo(resourceInfoPtr);
}
GmmResourceInfo::GmmResourceInfo(GmmClientContext *clientContext, GMM_RESOURCE_INFO *inputGmmResourceInfo) : clientContext(clientContext) {
auto resourceInfoPtr = clientContext->copyResInfoObject(inputGmmResourceInfo);
createResourceInfo(resourceInfoPtr);
}
void GmmResourceInfo::createResourceInfo(GMM_RESOURCE_INFO *resourceInfoPtr) {
auto customDeleter = [this](GMM_RESOURCE_INFO *gmmResourceInfo) {
this->clientContext->destroyResInfoObject(gmmResourceInfo);
};
this->resourceInfo = UniquePtrType(resourceInfoPtr, customDeleter);
}
} // namespace NEO