Files
compute-runtime/core/gmm_helper/resource_info_impl.cpp
Mateusz Hoppe 51f7ca1601 Move files to core
- runtime/gmm_helper files
- engine_control.h
- allocation_properties.h

Change-Id: I108888d639c8fdb298eda00fb1e7961b2ccb26cd
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2020-01-02 15:57:05 +01:00

33 lines
1.1 KiB
C++

/*
* Copyright (C) 2018-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "core/gmm_helper/gmm_helper.h"
#include "core/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