2018-05-06 03:30:37 +08:00
|
|
|
/*
|
2019-02-27 18:39:32 +08:00
|
|
|
* Copyright (C) 2018-2019 Intel Corporation
|
2018-09-18 15:11:08 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
2018-05-06 03:30:37 +08:00
|
|
|
|
|
|
|
#include "runtime/gmm_helper/gmm_helper.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
#include "runtime/gmm_helper/resource_info.h"
|
|
|
|
|
|
|
|
#include "gmm_client_context.h"
|
2018-05-06 03:30:37 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2018-05-06 03:30:37 +08:00
|
|
|
void GmmResourceInfo::customDeleter(GMM_RESOURCE_INFO *gmmResourceInfo) {
|
2018-07-23 18:23:48 +08:00
|
|
|
GmmHelper::getClientContext()->destroyResInfoObject(gmmResourceInfo);
|
2018-05-06 03:30:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GmmResourceInfo::GmmResourceInfo(GMM_RESCREATE_PARAMS *resourceCreateParams) {
|
2018-07-23 18:23:48 +08:00
|
|
|
auto resourceInfoPtr = GmmHelper::getClientContext()->createResInfoObject(resourceCreateParams);
|
2018-05-06 03:30:37 +08:00
|
|
|
this->resourceInfo = UniquePtrType(resourceInfoPtr, GmmResourceInfo::customDeleter);
|
|
|
|
}
|
|
|
|
|
|
|
|
GmmResourceInfo::GmmResourceInfo(GMM_RESOURCE_INFO *inputGmmResourceInfo) {
|
2018-07-23 18:23:48 +08:00
|
|
|
auto resourceInfoPtr = GmmHelper::getClientContext()->copyResInfoObject(inputGmmResourceInfo);
|
2018-05-06 03:30:37 +08:00
|
|
|
this->resourceInfo = UniquePtrType(resourceInfoPtr, GmmResourceInfo::customDeleter);
|
|
|
|
}
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|