Files
compute-runtime/opencl/source/mem_obj/mem_obj_helper.h
Warchulski, Jaroslaw d1b2311207 Cleanup includes 49
Cleaned up files:
opencl/source/command_queue/command_queue_hw.h
opencl/source/gtpin/gtpin_defs.h
opencl/source/mem_obj/mem_obj_helper.h
opencl/source/memory_manager/mem_obj_surface.h
opencl/source/sharings/unified/unified_sharing.h
opencl/test/unit_test/api/cl_enqueue_migrate_mem_objects_tests.inl
opencl/test/unit_test/aub_tests/fixtures/unified_memory_fixture.h
opencl/test/unit_test/command_queue/command_queue_fixture.h

Related-To: NEO-5548

Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-02-10 17:26:49 +01:00

50 lines
2.2 KiB
C++

/*
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/helpers/bit_helpers.h"
#include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/memory_manager/unified_memory_manager.h"
#include "opencl/extensions/public/cl_ext_private.h"
#include "CL/cl.h"
#include "memory_properties_flags.h"
namespace NEO {
class Context;
class MemObjHelper {
public:
static const uint64_t extraFlags;
static const uint64_t extraFlagsIntel;
static const uint64_t commonFlags;
static const uint64_t commonFlagsIntel;
static const uint64_t validFlagsForBuffer;
static const uint64_t validFlagsForBufferIntel;
static const uint64_t validFlagsForImage;
static const uint64_t validFlagsForImageIntel;
static bool validateMemoryPropertiesForBuffer(const MemoryProperties &memoryProperties, cl_mem_flags flags,
cl_mem_flags_intel flagsIntel, const Context &context);
static bool validateMemoryPropertiesForImage(const MemoryProperties &memoryProperties, cl_mem_flags flags,
cl_mem_flags_intel flagsIntel, cl_mem parent, const Context &context);
static AllocationProperties getAllocationPropertiesWithImageInfo(uint32_t rootDeviceIndex, ImageInfo &imgInfo, bool allocateMemory,
const MemoryProperties &memoryProperties,
const HardwareInfo &hwInfo, DeviceBitfield subDevicesBitfieldParam, bool deviceOnlyVisibilty);
static bool checkMemFlagsForSubBuffer(cl_mem_flags flags);
static SVMAllocsManager::SvmAllocationProperties getSvmAllocationProperties(cl_mem_flags flags);
static bool isSuitableForCompression(bool compressionSupported, const MemoryProperties &properties, Context &context,
bool preferCompression);
protected:
static bool validateExtraMemoryProperties(const MemoryProperties &memoryProperties, cl_mem_flags flags,
cl_mem_flags_intel flagsIntel, const Context &context);
};
} // namespace NEO