2019-06-17 21:27:33 +08:00
|
|
|
/*
|
2023-12-13 18:09:37 +08:00
|
|
|
* Copyright (C) 2019-2023 Intel Corporation
|
2019-06-17 21:27:33 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/unified_memory/unified_memory.h"
|
2019-06-17 21:27:33 +08:00
|
|
|
|
|
|
|
uint32_t UnifiedMemoryControls::generateMask() {
|
|
|
|
uint32_t resourceMask = 0u;
|
|
|
|
if (this->indirectHostAllocationsAllowed) {
|
2023-12-13 18:09:37 +08:00
|
|
|
resourceMask |= static_cast<uint32_t>(InternalMemoryType::hostUnifiedMemory);
|
2019-06-17 21:27:33 +08:00
|
|
|
}
|
|
|
|
if (this->indirectDeviceAllocationsAllowed) {
|
2023-12-13 18:09:37 +08:00
|
|
|
resourceMask |= static_cast<uint32_t>(InternalMemoryType::deviceUnifiedMemory);
|
2019-06-17 21:27:33 +08:00
|
|
|
}
|
2019-06-18 13:22:38 +08:00
|
|
|
if (this->indirectSharedAllocationsAllowed) {
|
2023-12-13 18:09:37 +08:00
|
|
|
resourceMask |= static_cast<uint32_t>(InternalMemoryType::sharedUnifiedMemory);
|
2019-06-18 13:22:38 +08:00
|
|
|
}
|
2019-06-17 21:27:33 +08:00
|
|
|
|
|
|
|
return resourceMask;
|
|
|
|
}
|