2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2023-05-05 20:37:10 +08:00
|
|
|
* Copyright (C) 2020-2023 Intel Corporation
|
2019-03-26 18:59:46 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/gmm_helper/resource_info.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2023-05-05 20:37:10 +08:00
|
|
|
#include "shared/source/helpers/debug_helpers.h"
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2019-12-30 21:14:27 +08:00
|
|
|
GmmResourceInfo *GmmResourceInfo::create(GmmClientContext *clientContext, GMM_RESCREATE_PARAMS *resourceCreateParams) {
|
2023-05-05 20:37:10 +08:00
|
|
|
auto resourceInfo = new GmmResourceInfo(clientContext, resourceCreateParams);
|
|
|
|
UNRECOVERABLE_IF(resourceInfo->peekHandle() == 0);
|
|
|
|
return resourceInfo;
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
|
|
|
|
2019-12-30 21:14:27 +08:00
|
|
|
GmmResourceInfo *GmmResourceInfo::create(GmmClientContext *clientContext, GMM_RESOURCE_INFO *inputGmmResourceInfo) {
|
2023-05-05 20:37:10 +08:00
|
|
|
auto resourceInfo = new GmmResourceInfo(clientContext, inputGmmResourceInfo);
|
|
|
|
UNRECOVERABLE_IF(resourceInfo->peekHandle() == 0);
|
|
|
|
return resourceInfo;
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
2022-04-19 20:11:45 +08:00
|
|
|
|
|
|
|
GmmResourceInfo *GmmResourceInfo::create(GmmClientContext *clientContext, GMM_RESOURCE_INFO *inputGmmResourceInfo, bool openingHandle) {
|
2023-05-05 20:37:10 +08:00
|
|
|
auto resourceInfo = new GmmResourceInfo(clientContext, inputGmmResourceInfo, openingHandle);
|
|
|
|
UNRECOVERABLE_IF(resourceInfo->peekHandle() == 0);
|
|
|
|
return resourceInfo;
|
2022-04-19 20:11:45 +08:00
|
|
|
}
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|