mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-07 21:27:04 +08:00
Resolves: NEO-3575 Change-Id: I825a9acf993a46e6260bc7c77a955ed83da3b672 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
34 lines
1.0 KiB
C++
34 lines
1.0 KiB
C++
/*
|
|
* Copyright (C) 2018-2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "runtime/gmm_helper/gmm_helper.h"
|
|
#include "runtime/gmm_helper/resource_info.h"
|
|
|
|
#include "gmm_client_context.h"
|
|
|
|
namespace NEO {
|
|
|
|
GmmResourceInfo::GmmResourceInfo(GMM_RESCREATE_PARAMS *resourceCreateParams) {
|
|
auto resourceInfoPtr = GmmHelper::getClientContext()->createResInfoObject(resourceCreateParams);
|
|
createResourceInfo(resourceInfoPtr);
|
|
}
|
|
|
|
GmmResourceInfo::GmmResourceInfo(GMM_RESOURCE_INFO *inputGmmResourceInfo) {
|
|
auto resourceInfoPtr = GmmHelper::getClientContext()->copyResInfoObject(inputGmmResourceInfo);
|
|
createResourceInfo(resourceInfoPtr);
|
|
}
|
|
|
|
void GmmResourceInfo::createResourceInfo(GMM_RESOURCE_INFO *resourceInfoPtr) {
|
|
auto gmmClientContext = GmmHelper::getClientContext();
|
|
auto customDeleter = [gmmClientContext](GMM_RESOURCE_INFO *gmmResourceInfo) {
|
|
gmmClientContext->destroyResInfoObject(gmmResourceInfo);
|
|
};
|
|
this->resourceInfo = UniquePtrType(resourceInfoPtr, customDeleter);
|
|
}
|
|
|
|
} // namespace NEO
|