2019-06-17 21:27:33 +08:00
|
|
|
/*
|
2020-02-23 05:21:06 +08:00
|
|
|
* Copyright (C) 2019-2020 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) {
|
|
|
|
resourceMask |= InternalMemoryType::HOST_UNIFIED_MEMORY;
|
|
|
|
}
|
|
|
|
if (this->indirectDeviceAllocationsAllowed) {
|
|
|
|
resourceMask |= InternalMemoryType::DEVICE_UNIFIED_MEMORY;
|
|
|
|
}
|
2019-06-18 13:22:38 +08:00
|
|
|
if (this->indirectSharedAllocationsAllowed) {
|
|
|
|
resourceMask |= InternalMemoryType::SHARED_UNIFIED_MEMORY;
|
|
|
|
}
|
2019-06-17 21:27:33 +08:00
|
|
|
|
|
|
|
return resourceMask;
|
|
|
|
}
|