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