mirror of
https://github.com/intel/compute-runtime.git
synced 2025-06-28 17:58:30 +08:00

According to regression, remove setting value for CL_MEM_ALLOC_DEFAULT_INTEL in MemoryPropertiesFlags Related-To: NEO-4053 Change-Id: I1761bbf2ed8b977b7e96cebd38040c3977998b63 Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
85 lines
3.0 KiB
C++
85 lines
3.0 KiB
C++
/*
|
|
* Copyright (C) 2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "common/helpers/bit_helpers.h"
|
|
#include "public/cl_ext_private.h"
|
|
#include "runtime/helpers/memory_properties_flags_helpers.h"
|
|
|
|
#include "CL/cl_ext_intel.h"
|
|
|
|
namespace NEO {
|
|
|
|
MemoryPropertiesFlags MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(cl_mem_flags flags, cl_mem_flags_intel flagsIntel, cl_mem_alloc_flags_intel allocflags) {
|
|
MemoryPropertiesFlags memoryPropertiesFlags;
|
|
|
|
if (isValueSet(flags, CL_MEM_READ_WRITE)) {
|
|
memoryPropertiesFlags.flags.readWrite = true;
|
|
}
|
|
if (isValueSet(flags, CL_MEM_WRITE_ONLY)) {
|
|
memoryPropertiesFlags.flags.writeOnly = true;
|
|
}
|
|
if (isValueSet(flags, CL_MEM_READ_ONLY)) {
|
|
memoryPropertiesFlags.flags.readOnly = true;
|
|
}
|
|
if (isValueSet(flags, CL_MEM_USE_HOST_PTR)) {
|
|
memoryPropertiesFlags.flags.useHostPtr = true;
|
|
}
|
|
if (isValueSet(flags, CL_MEM_ALLOC_HOST_PTR)) {
|
|
memoryPropertiesFlags.flags.allocHostPtr = true;
|
|
}
|
|
if (isValueSet(flags, CL_MEM_COPY_HOST_PTR)) {
|
|
memoryPropertiesFlags.flags.copyHostPtr = true;
|
|
}
|
|
if (isValueSet(flags, CL_MEM_HOST_WRITE_ONLY)) {
|
|
memoryPropertiesFlags.flags.hostWriteOnly = true;
|
|
}
|
|
if (isValueSet(flags, CL_MEM_HOST_READ_ONLY)) {
|
|
memoryPropertiesFlags.flags.hostReadOnly = true;
|
|
}
|
|
if (isValueSet(flags, CL_MEM_HOST_NO_ACCESS)) {
|
|
memoryPropertiesFlags.flags.hostNoAccess = true;
|
|
}
|
|
if (isValueSet(flags, CL_MEM_KERNEL_READ_AND_WRITE)) {
|
|
memoryPropertiesFlags.flags.kernelReadAndWrite = true;
|
|
}
|
|
if (isValueSet(flags, CL_MEM_FORCE_LINEAR_STORAGE_INTEL) ||
|
|
isValueSet(flagsIntel, CL_MEM_FORCE_LINEAR_STORAGE_INTEL)) {
|
|
memoryPropertiesFlags.flags.forceLinearStorage = true;
|
|
}
|
|
if (isValueSet(flags, CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL)) {
|
|
memoryPropertiesFlags.flags.accessFlagsUnrestricted = true;
|
|
}
|
|
if (isValueSet(flags, CL_MEM_NO_ACCESS_INTEL)) {
|
|
memoryPropertiesFlags.flags.noAccess = true;
|
|
}
|
|
if (isValueSet(flags, CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL) ||
|
|
isValueSet(flagsIntel, CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL)) {
|
|
memoryPropertiesFlags.flags.allowUnrestrictedSize = true;
|
|
}
|
|
if (isValueSet(flagsIntel, CL_MEM_LOCALLY_UNCACHED_RESOURCE)) {
|
|
memoryPropertiesFlags.flags.locallyUncachedResource = true;
|
|
}
|
|
|
|
if (isValueSet(flagsIntel, CL_MEM_LOCALLY_UNCACHED_SURFACE_STATE_RESOURCE)) {
|
|
memoryPropertiesFlags.flags.locallyUncachedInSurfaceState = true;
|
|
}
|
|
|
|
if (isValueSet(flags, CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL)) {
|
|
memoryPropertiesFlags.flags.forceSharedPhysicalMemory = true;
|
|
}
|
|
|
|
if (isValueSet(allocflags, CL_MEM_ALLOC_WRITE_COMBINED_INTEL)) {
|
|
memoryPropertiesFlags.allocFlags.allocWriteCombined = true;
|
|
}
|
|
|
|
addExtraMemoryPropertiesFlags(memoryPropertiesFlags, flags, flagsIntel);
|
|
|
|
return memoryPropertiesFlags;
|
|
}
|
|
|
|
} // namespace NEO
|