mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-23 11:03:02 +08:00
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>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
64f735481d
commit
d1b2311207
@@ -19,7 +19,6 @@
|
|||||||
#include "opencl/source/command_queue/gpgpu_walker.h"
|
#include "opencl/source/command_queue/gpgpu_walker.h"
|
||||||
#include "opencl/source/helpers/dispatch_info.h"
|
#include "opencl/source/helpers/dispatch_info.h"
|
||||||
#include "opencl/source/helpers/queue_helpers.h"
|
#include "opencl/source/helpers/queue_helpers.h"
|
||||||
#include "opencl/source/mem_obj/mem_obj.h"
|
|
||||||
#include "opencl/source/program/printf_handler.h"
|
#include "opencl/source/program/printf_handler.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2022 Intel Corporation
|
* Copyright (C) 2018-2023 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "opencl/source/command_queue/command_queue.h"
|
|
||||||
#include "opencl/source/kernel/kernel.h"
|
#include "opencl/source/kernel/kernel.h"
|
||||||
|
|
||||||
#include "CL/cl.h"
|
#include "CL/cl.h"
|
||||||
|
|||||||
@@ -7,20 +7,14 @@
|
|||||||
|
|
||||||
#include "opencl/source/mem_obj/mem_obj.h"
|
#include "opencl/source/mem_obj/mem_obj.h"
|
||||||
|
|
||||||
#include "shared/source/command_stream/command_stream_receiver.h"
|
|
||||||
#include "shared/source/gmm_helper/gmm.h"
|
#include "shared/source/gmm_helper/gmm.h"
|
||||||
#include "shared/source/gmm_helper/resource_info.h"
|
#include "shared/source/gmm_helper/resource_info.h"
|
||||||
#include "shared/source/helpers/aligned_memory.h"
|
|
||||||
#include "shared/source/helpers/bit_helpers.h"
|
#include "shared/source/helpers/bit_helpers.h"
|
||||||
#include "shared/source/helpers/get_info.h"
|
#include "shared/source/helpers/get_info.h"
|
||||||
#include "shared/source/memory_manager/allocation_properties.h"
|
#include "shared/source/memory_manager/allocation_properties.h"
|
||||||
#include "shared/source/memory_manager/deferred_deleter.h"
|
|
||||||
#include "shared/source/memory_manager/internal_allocation_storage.h"
|
|
||||||
#include "shared/source/memory_manager/memory_manager.h"
|
#include "shared/source/memory_manager/memory_manager.h"
|
||||||
#include "shared/source/os_interface/os_context.h"
|
|
||||||
|
|
||||||
#include "opencl/source/cl_device/cl_device.h"
|
#include "opencl/source/cl_device/cl_device.h"
|
||||||
#include "opencl/source/command_queue/command_queue.h"
|
|
||||||
#include "opencl/source/context/context.h"
|
#include "opencl/source/context/context.h"
|
||||||
#include "opencl/source/helpers/get_info_status_mapper.h"
|
#include "opencl/source/helpers/get_info_status_mapper.h"
|
||||||
#include "opencl/source/helpers/mipmap.h"
|
#include "opencl/source/helpers/mipmap.h"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#include "opencl/source/cl_device/cl_device.h"
|
#include "opencl/source/cl_device/cl_device.h"
|
||||||
#include "opencl/source/context/context.h"
|
#include "opencl/source/context/context.h"
|
||||||
#include "opencl/source/helpers/cl_gfx_core_helper.h"
|
#include "opencl/source/helpers/cl_gfx_core_helper.h"
|
||||||
|
#include "opencl/source/mem_obj/mem_obj.h"
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2021 Intel Corporation
|
* Copyright (C) 2018-2023 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -11,13 +11,14 @@
|
|||||||
#include "shared/source/memory_manager/unified_memory_manager.h"
|
#include "shared/source/memory_manager/unified_memory_manager.h"
|
||||||
|
|
||||||
#include "opencl/extensions/public/cl_ext_private.h"
|
#include "opencl/extensions/public/cl_ext_private.h"
|
||||||
#include "opencl/source/mem_obj/mem_obj.h"
|
|
||||||
|
|
||||||
#include "CL/cl.h"
|
#include "CL/cl.h"
|
||||||
#include "memory_properties_flags.h"
|
#include "memory_properties_flags.h"
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
|
|
||||||
|
class Context;
|
||||||
|
|
||||||
class MemObjHelper {
|
class MemObjHelper {
|
||||||
public:
|
public:
|
||||||
static const uint64_t extraFlags;
|
static const uint64_t extraFlags;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2018-2021 Intel Corporation
|
# Copyright (C) 2018-2023 Intel Corporation
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
#
|
#
|
||||||
@@ -8,6 +8,7 @@ set(RUNTIME_SRCS_MEMORY_MANAGER
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/compression_selector_ocl.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/compression_selector_ocl.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/cpu_page_fault_manager_memory_sync.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/cpu_page_fault_manager_memory_sync.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/mem_obj_surface.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/mem_obj_surface.h
|
${CMAKE_CURRENT_SOURCE_DIR}/mem_obj_surface.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/migration_controller.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/migration_controller.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/migration_controller.h
|
${CMAKE_CURRENT_SOURCE_DIR}/migration_controller.h
|
||||||
|
|||||||
34
opencl/source/memory_manager/mem_obj_surface.cpp
Normal file
34
opencl/source/memory_manager/mem_obj_surface.cpp
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2023 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "opencl/source/memory_manager/mem_obj_surface.h"
|
||||||
|
|
||||||
|
#include "shared/source/command_stream/command_stream_receiver.h"
|
||||||
|
|
||||||
|
#include "opencl/source/mem_obj/mem_obj.h"
|
||||||
|
|
||||||
|
namespace NEO {
|
||||||
|
|
||||||
|
MemObjSurface::MemObjSurface(MemObj *memObj) : Surface(memObj->getMultiGraphicsAllocation().isCoherent()), memObj(memObj) {
|
||||||
|
memObj->incRefInternal();
|
||||||
|
}
|
||||||
|
|
||||||
|
MemObjSurface::~MemObjSurface() {
|
||||||
|
memObj->decRefInternal();
|
||||||
|
memObj = nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
void MemObjSurface::makeResident(CommandStreamReceiver &csr) {
|
||||||
|
DEBUG_BREAK_IF(!memObj);
|
||||||
|
csr.makeResident(*memObj->getGraphicsAllocation(csr.getRootDeviceIndex()));
|
||||||
|
}
|
||||||
|
|
||||||
|
Surface *MemObjSurface::duplicate() {
|
||||||
|
return new MemObjSurface(this->memObj);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace NEO
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2020 Intel Corporation
|
* Copyright (C) 2020-2023 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -8,28 +8,18 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "shared/source/memory_manager/surface.h"
|
#include "shared/source/memory_manager/surface.h"
|
||||||
|
|
||||||
#include "opencl/source/mem_obj/mem_obj.h"
|
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
|
|
||||||
|
class MemObj;
|
||||||
|
|
||||||
class MemObjSurface : public Surface {
|
class MemObjSurface : public Surface {
|
||||||
public:
|
public:
|
||||||
MemObjSurface(MemObj *memObj) : Surface(memObj->getMultiGraphicsAllocation().isCoherent()), memObj(memObj) {
|
MemObjSurface(MemObj *memObj);
|
||||||
memObj->incRefInternal();
|
~MemObjSurface() override;
|
||||||
}
|
|
||||||
~MemObjSurface() override {
|
|
||||||
memObj->decRefInternal();
|
|
||||||
memObj = nullptr;
|
|
||||||
};
|
|
||||||
|
|
||||||
void makeResident(CommandStreamReceiver &csr) override {
|
void makeResident(CommandStreamReceiver &csr) override;
|
||||||
DEBUG_BREAK_IF(!memObj);
|
|
||||||
csr.makeResident(*memObj->getGraphicsAllocation(csr.getRootDeviceIndex()));
|
|
||||||
}
|
|
||||||
|
|
||||||
Surface *duplicate() override {
|
Surface *duplicate() override;
|
||||||
return new MemObjSurface(this->memObj);
|
|
||||||
};
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
class MemObj *memObj;
|
class MemObj *memObj;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019-2020 Intel Corporation
|
* Copyright (C) 2019-2023 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
#include "opencl/source/sharings/unified/unified_sharing.h"
|
#include "opencl/source/sharings/unified/unified_sharing.h"
|
||||||
|
|
||||||
|
#include "CL/cl.h"
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
class Buffer;
|
class Buffer;
|
||||||
class Context;
|
class Context;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019-2020 Intel Corporation
|
* Copyright (C) 2019-2023 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
#include "opencl/source/sharings/unified/unified_sharing.h"
|
#include "opencl/source/sharings/unified/unified_sharing.h"
|
||||||
|
|
||||||
|
#include "CL/cl.h"
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
class Image;
|
class Image;
|
||||||
class Context;
|
class Context;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019-2022 Intel Corporation
|
* Copyright (C) 2019-2023 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "opencl/source/mem_obj/mem_obj.h"
|
|
||||||
#include "opencl/source/sharings/sharing.h"
|
#include "opencl/source/sharings/sharing.h"
|
||||||
#include "opencl/source/sharings/unified/unified_sharing_types.h"
|
#include "opencl/source/sharings/unified/unified_sharing_types.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,16 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2022 Intel Corporation
|
* Copyright (C) 2018-2023 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "shared/test/common/mocks/mock_device.h"
|
|
||||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||||
|
|
||||||
#include "opencl/source/command_queue/command_queue.h"
|
|
||||||
#include "opencl/source/context/context.h"
|
#include "opencl/source/context/context.h"
|
||||||
#include "opencl/source/mem_obj/buffer.h"
|
#include "opencl/source/mem_obj/buffer.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_program.h"
|
|
||||||
|
|
||||||
#include "cl_api_tests.h"
|
#include "cl_api_tests.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2021 Intel Corporation
|
* Copyright (C) 2018-2023 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "opencl/source/command_queue/command_queue.h"
|
|
||||||
#include "opencl/source/context/context.h"
|
#include "opencl/source/context/context.h"
|
||||||
#include "opencl/source/event/event.h"
|
#include "opencl/source/event/event.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_buffer.h"
|
#include "opencl/test/unit_test/mocks/mock_buffer.h"
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2022 Intel Corporation
|
* Copyright (C) 2018-2023 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "shared/source/device/device.h"
|
|
||||||
#include "shared/source/memory_manager/graphics_allocation.h"
|
#include "shared/source/memory_manager/graphics_allocation.h"
|
||||||
#include "shared/source/memory_manager/unified_memory_manager.h"
|
#include "shared/source/memory_manager/unified_memory_manager.h"
|
||||||
#include "shared/test/common/mocks/mock_device.h"
|
#include "shared/test/common/mocks/mock_device.h"
|
||||||
|
|
||||||
#include "opencl/source/command_queue/command_queue.h"
|
|
||||||
#include "opencl/source/event/user_event.h"
|
#include "opencl/source/event/user_event.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||||
#include "shared/test/common/test_macros/hw_test.h"
|
#include "shared/test/common/test_macros/hw_test.h"
|
||||||
|
|
||||||
|
#include "opencl/source/command_queue/command_queue.h"
|
||||||
#include "opencl/source/helpers/hardware_commands_helper.h"
|
#include "opencl/source/helpers/hardware_commands_helper.h"
|
||||||
#include "opencl/test/unit_test/aub_tests/command_stream/aub_command_stream_fixture.h"
|
#include "opencl/test/unit_test/aub_tests/command_stream/aub_command_stream_fixture.h"
|
||||||
#include "opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h"
|
#include "opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2022 Intel Corporation
|
* Copyright (C) 2022-2023 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||||
#include "shared/test/common/test_macros/hw_test.h"
|
#include "shared/test/common/test_macros/hw_test.h"
|
||||||
|
|
||||||
|
#include "opencl/source/command_queue/command_queue.h"
|
||||||
#include "opencl/source/helpers/hardware_commands_helper.h"
|
#include "opencl/source/helpers/hardware_commands_helper.h"
|
||||||
#include "opencl/test/unit_test/aub_tests/command_stream/aub_command_stream_fixture.h"
|
#include "opencl/test/unit_test/aub_tests/command_stream/aub_command_stream_fixture.h"
|
||||||
#include "opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h"
|
#include "opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h"
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include "shared/test/common/test_macros/test_checks_shared.h"
|
#include "shared/test/common/test_macros/test_checks_shared.h"
|
||||||
|
|
||||||
#include "opencl/extensions/public/cl_ext_private.h"
|
#include "opencl/extensions/public/cl_ext_private.h"
|
||||||
|
#include "opencl/source/command_queue/command_queue.h"
|
||||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||||
#include "opencl/source/mem_obj/buffer.h"
|
#include "opencl/source/mem_obj/buffer.h"
|
||||||
#include "opencl/source/mem_obj/image.h"
|
#include "opencl/source/mem_obj/image.h"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2022 Intel Corporation
|
* Copyright (C) 2018-2023 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -10,6 +10,8 @@
|
|||||||
#include "shared/source/memory_manager/allocations_list.h"
|
#include "shared/source/memory_manager/allocations_list.h"
|
||||||
#include "shared/test/common/test_macros/hw_test.h"
|
#include "shared/test/common/test_macros/hw_test.h"
|
||||||
|
|
||||||
|
#include "opencl/source/command_queue/command_queue.h"
|
||||||
|
|
||||||
using namespace NEO;
|
using namespace NEO;
|
||||||
|
|
||||||
template <typename FamilyType>
|
template <typename FamilyType>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||||
#include "shared/test/common/test_macros/hw_test.h"
|
#include "shared/test/common/test_macros/hw_test.h"
|
||||||
|
|
||||||
|
#include "opencl/source/command_queue/command_queue.h"
|
||||||
#include "opencl/source/event/event.h"
|
#include "opencl/source/event/event.h"
|
||||||
#include "opencl/source/mem_obj/buffer.h"
|
#include "opencl/source/mem_obj/buffer.h"
|
||||||
#include "opencl/test/unit_test/aub_tests/command_stream/aub_command_stream_fixture.h"
|
#include "opencl/test/unit_test/aub_tests/command_stream/aub_command_stream_fixture.h"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2018-2022 Intel Corporation
|
# Copyright (C) 2018-2023 Intel Corporation
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
#
|
#
|
||||||
@@ -15,6 +15,7 @@ target_sources(igdrcl_aub_tests PRIVATE
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/multicontext_aub_fixture.h
|
${CMAKE_CURRENT_SOURCE_DIR}/multicontext_aub_fixture.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/run_kernel_fixture.h
|
${CMAKE_CURRENT_SOURCE_DIR}/run_kernel_fixture.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/simple_arg_fixture.h
|
${CMAKE_CURRENT_SOURCE_DIR}/simple_arg_fixture.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/unified_memory_fixture.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/unified_memory_fixture.h
|
${CMAKE_CURRENT_SOURCE_DIR}/unified_memory_fixture.h
|
||||||
)
|
)
|
||||||
add_subdirectories()
|
add_subdirectories()
|
||||||
|
|||||||
@@ -0,0 +1,81 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2023 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "opencl/test/unit_test/aub_tests/fixtures/unified_memory_fixture.h"
|
||||||
|
|
||||||
|
#include "shared/source/memory_manager/memory_manager.h"
|
||||||
|
|
||||||
|
#include "opencl/source/command_queue/command_queue.h"
|
||||||
|
|
||||||
|
namespace NEO {
|
||||||
|
|
||||||
|
void UnifiedMemoryAubFixture::setUp() {
|
||||||
|
if (PagaFaultManagerTestConfig::disabled) {
|
||||||
|
skipped = true;
|
||||||
|
GTEST_SKIP();
|
||||||
|
}
|
||||||
|
AUBFixture::setUp(nullptr);
|
||||||
|
if (!platform()->peekExecutionEnvironment()->memoryManager->getPageFaultManager()) {
|
||||||
|
skipped = true;
|
||||||
|
GTEST_SKIP();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void *UnifiedMemoryAubFixture::allocateUSM(InternalMemoryType type) {
|
||||||
|
void *ptr = nullptr;
|
||||||
|
if (!this->skipped) {
|
||||||
|
switch (type) {
|
||||||
|
case DEVICE_UNIFIED_MEMORY:
|
||||||
|
ptr = clDeviceMemAllocINTEL(this->context, this->device.get(), nullptr, dataSize, 0, &retVal);
|
||||||
|
break;
|
||||||
|
case HOST_UNIFIED_MEMORY:
|
||||||
|
ptr = clHostMemAllocINTEL(this->context, nullptr, dataSize, 0, &retVal);
|
||||||
|
break;
|
||||||
|
case SHARED_UNIFIED_MEMORY:
|
||||||
|
ptr = clSharedMemAllocINTEL(this->context, this->device.get(), nullptr, dataSize, 0, &retVal);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ptr = new char[dataSize];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
EXPECT_EQ(retVal, CL_SUCCESS);
|
||||||
|
EXPECT_NE(ptr, nullptr);
|
||||||
|
}
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UnifiedMemoryAubFixture::freeUSM(void *ptr, InternalMemoryType type) {
|
||||||
|
if (!this->skipped) {
|
||||||
|
switch (type) {
|
||||||
|
case DEVICE_UNIFIED_MEMORY:
|
||||||
|
case HOST_UNIFIED_MEMORY:
|
||||||
|
case SHARED_UNIFIED_MEMORY:
|
||||||
|
retVal = clMemFreeINTEL(this->context, ptr);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
delete[] static_cast<char *>(ptr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
EXPECT_EQ(retVal, CL_SUCCESS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void UnifiedMemoryAubFixture::writeToUsmMemory(std::vector<char> data, void *ptr, InternalMemoryType type) {
|
||||||
|
if (!this->skipped) {
|
||||||
|
switch (type) {
|
||||||
|
case DEVICE_UNIFIED_MEMORY:
|
||||||
|
retVal = clEnqueueMemcpyINTEL(this->pCmdQ, true, ptr, data.data(), dataSize, 0, nullptr, nullptr);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
std::copy(data.begin(), data.end(), static_cast<char *>(ptr));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
EXPECT_EQ(retVal, CL_SUCCESS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace NEO
|
||||||
@@ -6,13 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "shared/source/helpers/constants.h"
|
|
||||||
#include "shared/source/memory_manager/memory_manager.h"
|
|
||||||
|
|
||||||
#include "opencl/source/api/api.h"
|
|
||||||
#include "opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h"
|
#include "opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
namespace PagaFaultManagerTestConfig {
|
namespace PagaFaultManagerTestConfig {
|
||||||
@@ -27,69 +21,12 @@ class UnifiedMemoryAubFixture : public AUBFixture {
|
|||||||
const size_t dataSize = MemoryConstants::megaByte;
|
const size_t dataSize = MemoryConstants::megaByte;
|
||||||
bool skipped = false;
|
bool skipped = false;
|
||||||
|
|
||||||
void setUp() {
|
void setUp();
|
||||||
if (PagaFaultManagerTestConfig::disabled) {
|
|
||||||
skipped = true;
|
|
||||||
GTEST_SKIP();
|
|
||||||
}
|
|
||||||
AUBFixture::setUp(nullptr);
|
|
||||||
if (!platform()->peekExecutionEnvironment()->memoryManager->getPageFaultManager()) {
|
|
||||||
skipped = true;
|
|
||||||
GTEST_SKIP();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void *allocateUSM(InternalMemoryType type) {
|
void *allocateUSM(InternalMemoryType type);
|
||||||
void *ptr = nullptr;
|
|
||||||
if (!this->skipped) {
|
|
||||||
switch (type) {
|
|
||||||
case DEVICE_UNIFIED_MEMORY:
|
|
||||||
ptr = clDeviceMemAllocINTEL(this->context, this->device.get(), nullptr, dataSize, 0, &retVal);
|
|
||||||
break;
|
|
||||||
case HOST_UNIFIED_MEMORY:
|
|
||||||
ptr = clHostMemAllocINTEL(this->context, nullptr, dataSize, 0, &retVal);
|
|
||||||
break;
|
|
||||||
case SHARED_UNIFIED_MEMORY:
|
|
||||||
ptr = clSharedMemAllocINTEL(this->context, this->device.get(), nullptr, dataSize, 0, &retVal);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ptr = new char[dataSize];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
EXPECT_EQ(retVal, CL_SUCCESS);
|
|
||||||
EXPECT_NE(ptr, nullptr);
|
|
||||||
}
|
|
||||||
return ptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void freeUSM(void *ptr, InternalMemoryType type) {
|
void freeUSM(void *ptr, InternalMemoryType type);
|
||||||
if (!this->skipped) {
|
|
||||||
switch (type) {
|
|
||||||
case DEVICE_UNIFIED_MEMORY:
|
|
||||||
case HOST_UNIFIED_MEMORY:
|
|
||||||
case SHARED_UNIFIED_MEMORY:
|
|
||||||
retVal = clMemFreeINTEL(this->context, ptr);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
delete[] static_cast<char *>(ptr);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
EXPECT_EQ(retVal, CL_SUCCESS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void writeToUsmMemory(std::vector<char> data, void *ptr, InternalMemoryType type) {
|
void writeToUsmMemory(std::vector<char> data, void *ptr, InternalMemoryType type);
|
||||||
if (!this->skipped) {
|
|
||||||
switch (type) {
|
|
||||||
case DEVICE_UNIFIED_MEMORY:
|
|
||||||
retVal = clEnqueueMemcpyINTEL(this->pCmdQ, true, ptr, data.data(), dataSize, 0, nullptr, nullptr);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
std::copy(data.begin(), data.end(), static_cast<char *>(ptr));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
EXPECT_EQ(retVal, CL_SUCCESS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
} // namespace NEO
|
} // namespace NEO
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019-2022 Intel Corporation
|
* Copyright (C) 2019-2023 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include "shared/test/common/test_macros/hw_test.h"
|
#include "shared/test/common/test_macros/hw_test.h"
|
||||||
|
|
||||||
|
#include "opencl/source/command_queue/command_queue.h"
|
||||||
#include "opencl/test/unit_test/aub_tests/fixtures/unified_memory_fixture.h"
|
#include "opencl/test/unit_test/aub_tests/fixtures/unified_memory_fixture.h"
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2019-2022 Intel Corporation
|
* Copyright (C) 2019-2023 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include "shared/test/common/test_macros/hw_test.h"
|
#include "shared/test/common/test_macros/hw_test.h"
|
||||||
|
|
||||||
|
#include "opencl/source/command_queue/command_queue.h"
|
||||||
#include "opencl/test/unit_test/aub_tests/fixtures/unified_memory_fixture.h"
|
#include "opencl/test/unit_test/aub_tests/fixtures/unified_memory_fixture.h"
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||||
#include "shared/test/common/test_macros/test_checks_shared.h"
|
#include "shared/test/common/test_macros/test_checks_shared.h"
|
||||||
|
|
||||||
#include "opencl/source/command_queue/command_queue.h"
|
|
||||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||||
#include "opencl/test/unit_test/fixtures/context_fixture.h"
|
#include "opencl/test/unit_test/fixtures/context_fixture.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "shared/source/memory_manager/memory_manager.h"
|
#include "shared/source/memory_manager/memory_manager.h"
|
||||||
#include "shared/test/common/test_macros/hw_test.h"
|
#include "shared/test/common/test_macros/hw_test.h"
|
||||||
|
|
||||||
|
#include "opencl/source/command_queue/command_queue.h"
|
||||||
#include "opencl/source/event/event.h"
|
#include "opencl/source/event/event.h"
|
||||||
#include "opencl/test/unit_test/command_queue/command_queue_fixture.h"
|
#include "opencl/test/unit_test/command_queue/command_queue_fixture.h"
|
||||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "shared/source/memory_manager/unified_memory_manager.h"
|
#include "shared/source/memory_manager/unified_memory_manager.h"
|
||||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||||
|
|
||||||
|
#include "opencl/source/command_queue/command_queue.h"
|
||||||
#include "opencl/source/event/user_event.h"
|
#include "opencl/source/event/user_event.h"
|
||||||
#include "opencl/source/helpers/dispatch_info.h"
|
#include "opencl/source/helpers/dispatch_info.h"
|
||||||
#include "opencl/test/unit_test/context/driver_diagnostics_tests.h"
|
#include "opencl/test/unit_test/context/driver_diagnostics_tests.h"
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "shared/test/common/test_macros/hw_test.h"
|
#include "shared/test/common/test_macros/hw_test.h"
|
||||||
|
|
||||||
|
#include "opencl/source/command_queue/command_queue.h"
|
||||||
#include "opencl/test/unit_test/command_queue/command_queue_fixture.h"
|
#include "opencl/test/unit_test/command_queue/command_queue_fixture.h"
|
||||||
#include "opencl/test/unit_test/command_stream/command_stream_fixture.h"
|
#include "opencl/test/unit_test/command_stream/command_stream_fixture.h"
|
||||||
#include "opencl/test/unit_test/fixtures/buffer_fixture.h"
|
#include "opencl/test/unit_test/fixtures/buffer_fixture.h"
|
||||||
|
|||||||
@@ -9,9 +9,7 @@
|
|||||||
#include "shared/test/common/fixtures/memory_management_fixture.h"
|
#include "shared/test/common/fixtures/memory_management_fixture.h"
|
||||||
#include "shared/test/common/test_macros/test.h"
|
#include "shared/test/common/test_macros/test.h"
|
||||||
|
|
||||||
#include "opencl/source/command_queue/command_queue.h"
|
|
||||||
#include "opencl/source/mem_obj/pipe.h"
|
#include "opencl/source/mem_obj/pipe.h"
|
||||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
|
||||||
#include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h"
|
#include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
|
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include "shared/test/common/test_macros/test.h"
|
#include "shared/test/common/test_macros/test.h"
|
||||||
|
|
||||||
|
#include "opencl/source/command_queue/command_queue.h"
|
||||||
#include "opencl/source/kernel/kernel.h"
|
#include "opencl/source/kernel/kernel.h"
|
||||||
#include "opencl/test/unit_test/command_queue/command_queue_fixture.h"
|
#include "opencl/test/unit_test/command_queue/command_queue_fixture.h"
|
||||||
#include "opencl/test/unit_test/fixtures/context_fixture.h"
|
#include "opencl/test/unit_test/fixtures/context_fixture.h"
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2022 Intel Corporation
|
* Copyright (C) 2018-2023 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "opencl/source/accelerators/intel_accelerator.h"
|
#include "opencl/source/accelerators/intel_accelerator.h"
|
||||||
#include "opencl/source/command_queue/command_queue.h"
|
|
||||||
#include "opencl/source/helpers/base_object.h"
|
#include "opencl/source/helpers/base_object.h"
|
||||||
#include "opencl/source/sharings/sharing_factory.h"
|
#include "opencl/source/sharings/sharing_factory.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
|
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user