mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
- runtime/gmm_helper files - engine_control.h - allocation_properties.h Change-Id: I108888d639c8fdb298eda00fb1e7961b2ccb26cd Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
33 lines
1.1 KiB
C++
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
|