mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 22:12:59 +08:00
Move ptr.h to core folder
Change-Id: Icf0db7c767b2b1ea44fccc02b135f0f6c1f78c8f Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
@@ -7,9 +7,9 @@
|
||||
|
||||
#include "aub_mem_dump.h"
|
||||
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/aub/aub_helper.h"
|
||||
#include "runtime/helpers/debug_helpers.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/os_interface/debug_settings_manager.h"
|
||||
|
||||
namespace AubMemDump {
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/aub/aub_helper.h"
|
||||
#include "runtime/helpers/debug_helpers.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/memory_manager/memory_constants.h"
|
||||
|
||||
#include "aub_mem_dump.h"
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
|
||||
#include "runtime/built_ins/sip.h"
|
||||
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/device/device.h"
|
||||
#include "runtime/helpers/debug_helpers.h"
|
||||
#include "runtime/helpers/hw_helper.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/string.h"
|
||||
#include "runtime/memory_manager/graphics_allocation.h"
|
||||
#include "runtime/program/program.h"
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "runtime/command_queue/command_queue.h"
|
||||
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/built_ins/builtins_dispatch_builder.h"
|
||||
#include "runtime/command_stream/command_stream_receiver.h"
|
||||
#include "runtime/context/context.h"
|
||||
@@ -22,7 +23,6 @@
|
||||
#include "runtime/helpers/kernel_commands.h"
|
||||
#include "runtime/helpers/mipmap.h"
|
||||
#include "runtime/helpers/options.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/queue_helpers.h"
|
||||
#include "runtime/helpers/string.h"
|
||||
#include "runtime/helpers/surface_formats.h"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "core/helpers/ptr_math.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/aub/aub_helper.h"
|
||||
#include "runtime/aub_mem_dump/aub_alloc_dump.h"
|
||||
#include "runtime/aub_mem_dump/aub_alloc_dump.inl"
|
||||
@@ -17,7 +18,6 @@
|
||||
#include "runtime/helpers/hardware_context_controller.h"
|
||||
#include "runtime/helpers/hash.h"
|
||||
#include "runtime/helpers/neo_driver_version.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/string.h"
|
||||
#include "runtime/memory_manager/graphics_allocation.h"
|
||||
#include "runtime/memory_manager/memory_banks.h"
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/command_queue/gpgpu_walker.h"
|
||||
#include "runtime/command_stream/command_stream_receiver_hw.h"
|
||||
#include "runtime/command_stream/experimental_command_buffer.h"
|
||||
@@ -21,7 +22,6 @@
|
||||
#include "runtime/helpers/hw_helper.h"
|
||||
#include "runtime/helpers/options.h"
|
||||
#include "runtime/helpers/preamble.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/state_base_address.h"
|
||||
#include "runtime/helpers/timestamp_packet.h"
|
||||
#include "runtime/indirect_heap/indirect_heap.h"
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/debug_helpers.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <cstddef>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/aub/aub_center.h"
|
||||
#include "runtime/aub/aub_helper.h"
|
||||
#include "runtime/aub_mem_dump/page_table_entry_bits.h"
|
||||
@@ -15,7 +16,6 @@
|
||||
#include "runtime/helpers/debug_helpers.h"
|
||||
#include "runtime/helpers/hardware_context_controller.h"
|
||||
#include "runtime/helpers/hw_helper.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/memory_manager/graphics_allocation.h"
|
||||
#include "runtime/memory_manager/memory_banks.h"
|
||||
#include "runtime/memory_manager/memory_constants.h"
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "runtime/context/context.h"
|
||||
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/built_ins/built_ins.h"
|
||||
#include "runtime/command_queue/command_queue.h"
|
||||
#include "runtime/command_stream/command_stream_receiver.h"
|
||||
@@ -15,7 +16,6 @@
|
||||
#include "runtime/device_queue/device_queue.h"
|
||||
#include "runtime/gtpin/gtpin_notify.h"
|
||||
#include "runtime/helpers/get_info.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/string.h"
|
||||
#include "runtime/helpers/surface_formats.h"
|
||||
#include "runtime/mem_obj/image.h"
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/command_stream/linear_stream.h"
|
||||
#include "runtime/device_queue/device_queue.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/indirect_heap/indirect_heap.h"
|
||||
#include "runtime/kernel/kernel.h"
|
||||
#include "runtime/program/program.h"
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
|
||||
#include "runtime/gmm_helper/gmm.h"
|
||||
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/gmm_helper/gmm_helper.h"
|
||||
#include "runtime/gmm_helper/resource_info.h"
|
||||
#include "runtime/helpers/aligned_memory.h"
|
||||
#include "runtime/helpers/debug_helpers.h"
|
||||
#include "runtime/helpers/hw_helper.h"
|
||||
#include "runtime/helpers/hw_info.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/surface_formats.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
@@ -71,7 +71,6 @@ set(RUNTIME_SRCS_HELPERS_BASE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/preamble_bdw_plus.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/properties_helper.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/properties_helper.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ptr_math.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/queue_helpers.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/queue_helpers.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sampler_helpers.h
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
*/
|
||||
|
||||
#include "core/helpers/basic_math.h"
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/command_queue/local_id_gen.h"
|
||||
#include "runtime/command_stream/csr_definitions.h"
|
||||
#include "runtime/command_stream/preemption.h"
|
||||
#include "runtime/helpers/address_patch.h"
|
||||
#include "runtime/helpers/aligned_memory.h"
|
||||
#include "runtime/helpers/dispatch_info.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/string.h"
|
||||
#include "runtime/indirect_heap/indirect_heap.h"
|
||||
#include "runtime/kernel/kernel.h"
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
static const int ptrGarbageContent[16] = {
|
||||
0x0131, 0x133, 0xA, 0xEF,
|
||||
0x0131, 0x133, 0xA, 0xEF,
|
||||
0x0131, 0x133, 0xA, 0xEF,
|
||||
0x0131, 0x133, 0xA, 0xEF};
|
||||
static const auto ptrGarbage = (void *)ptrGarbageContent;
|
||||
|
||||
template <typename T>
|
||||
inline T ptrOffset(T ptrBefore, size_t offset) {
|
||||
auto addrBefore = (uintptr_t)ptrBefore;
|
||||
auto addrAfter = addrBefore + offset;
|
||||
return (T)addrAfter;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline uint64_t ptrOffset(uint64_t ptrBefore, size_t offset) {
|
||||
return ptrBefore + offset;
|
||||
}
|
||||
|
||||
template <typename TA, typename TB>
|
||||
inline size_t ptrDiff(TA ptrAfter, TB ptrBefore) {
|
||||
auto addrBefore = (uintptr_t)ptrBefore;
|
||||
auto addrAfter = (uintptr_t)ptrAfter;
|
||||
return addrAfter - addrBefore;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline uint64_t ptrDiff(uint64_t ptrAfter, T ptrBefore) {
|
||||
return ptrAfter - ptrBefore;
|
||||
}
|
||||
|
||||
template <typename IntegerAddressType>
|
||||
inline void *addrToPtr(IntegerAddressType addr) {
|
||||
uintptr_t correctBitnessAddress = static_cast<uintptr_t>(addr);
|
||||
void *ptrReturn = reinterpret_cast<void *>(correctBitnessAddress);
|
||||
return ptrReturn;
|
||||
}
|
||||
|
||||
inline void patchWithRequiredSize(void *memoryToBePatched, uint32_t patchSize, uintptr_t patchValue) {
|
||||
if (patchSize == sizeof(uint64_t)) {
|
||||
uint64_t *curbeAddress = (uint64_t *)memoryToBePatched;
|
||||
*curbeAddress = patchValue;
|
||||
} else {
|
||||
uint32_t *curbeAddress = (uint32_t *)memoryToBePatched;
|
||||
*curbeAddress = (uint32_t)patchValue;
|
||||
}
|
||||
}
|
||||
|
||||
inline uint64_t castToUint64(void *address) {
|
||||
return static_cast<uint64_t>(reinterpret_cast<uintptr_t>(address));
|
||||
}
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
#pragma once
|
||||
#include "core/helpers/basic_math.h"
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/command_stream/linear_stream.h"
|
||||
#include "runtime/helpers/aligned_memory.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/memory_manager/graphics_allocation.h"
|
||||
#include "runtime/memory_manager/memory_constants.h"
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "runtime/kernel/image_transformer.h"
|
||||
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/mem_obj/image.h"
|
||||
#include "runtime/program/kernel_info.h"
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "runtime/kernel/kernel.h"
|
||||
|
||||
#include "core/helpers/basic_math.h"
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/accelerators/intel_accelerator.h"
|
||||
#include "runtime/accelerators/intel_motion_estimation.h"
|
||||
#include "runtime/built_ins/built_ins.h"
|
||||
@@ -24,7 +25,6 @@
|
||||
#include "runtime/helpers/get_info.h"
|
||||
#include "runtime/helpers/hw_helper.h"
|
||||
#include "runtime/helpers/per_thread_data.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/sampler_helpers.h"
|
||||
#include "runtime/helpers/surface_formats.h"
|
||||
#include "runtime/kernel/image_transformer.h"
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "runtime/mem_obj/buffer.h"
|
||||
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/command_queue/command_queue.h"
|
||||
#include "runtime/command_stream/command_stream_receiver.h"
|
||||
#include "runtime/context/context.h"
|
||||
@@ -16,7 +17,6 @@
|
||||
#include "runtime/helpers/aligned_memory.h"
|
||||
#include "runtime/helpers/hw_helper.h"
|
||||
#include "runtime/helpers/hw_info.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/string.h"
|
||||
#include "runtime/helpers/validators.h"
|
||||
#include "runtime/mem_obj/mem_obj_helper.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "common/compiler_support.h"
|
||||
#include "core/helpers/basic_math.h"
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/command_queue/command_queue.h"
|
||||
#include "runtime/context/context.h"
|
||||
#include "runtime/device/device.h"
|
||||
@@ -20,7 +21,6 @@
|
||||
#include "runtime/helpers/hw_helper.h"
|
||||
#include "runtime/helpers/hw_info.h"
|
||||
#include "runtime/helpers/mipmap.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/string.h"
|
||||
#include "runtime/helpers/surface_formats.h"
|
||||
#include "runtime/mem_obj/buffer.h"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "runtime/mem_obj/map_operations_handler.h"
|
||||
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "core/helpers/ptr_math.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/debug_helpers.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/memory_manager/host_ptr_defines.h"
|
||||
#include "runtime/memory_manager/memory_banks.h"
|
||||
#include "runtime/memory_manager/memory_constants.h"
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
#include "runtime/memory_manager/os_agnostic_memory_manager.h"
|
||||
|
||||
#include "core/helpers/basic_math.h"
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/execution_environment/execution_environment.h"
|
||||
#include "runtime/gmm_helper/gmm.h"
|
||||
#include "runtime/gmm_helper/gmm_helper.h"
|
||||
#include "runtime/gmm_helper/resource_info.h"
|
||||
#include "runtime/helpers/aligned_memory.h"
|
||||
#include "runtime/helpers/options.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/surface_formats.h"
|
||||
#include "runtime/memory_manager/host_ptr_manager.h"
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
#include "debug_settings_manager.h"
|
||||
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/event/event.h"
|
||||
#include "runtime/helpers/dispatch_info.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/string.h"
|
||||
#include "runtime/helpers/timestamp_packet.h"
|
||||
#include "runtime/kernel/kernel.h"
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
*/
|
||||
|
||||
#include "core/helpers/basic_math.h"
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/aligned_memory.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/os_interface/32bit_memory.h"
|
||||
#include "runtime/os_interface/debug_settings_manager.h"
|
||||
#include "runtime/os_interface/linux/allocator_helper.h"
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
#pragma once
|
||||
#include "core/helpers/basic_math.h"
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/aligned_memory.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/utilities/heap_allocator.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "runtime/os_interface/linux/drm_memory_manager.h"
|
||||
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/command_stream/command_stream_receiver.h"
|
||||
#include "runtime/device/device.h"
|
||||
#include "runtime/execution_environment/execution_environment.h"
|
||||
@@ -15,7 +16,6 @@
|
||||
#include "runtime/gmm_helper/resource_info.h"
|
||||
#include "runtime/helpers/hw_info.h"
|
||||
#include "runtime/helpers/options.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/surface_formats.h"
|
||||
#include "runtime/memory_manager/host_ptr_manager.h"
|
||||
#include "runtime/os_interface/32bit_memory.h"
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
// Current order must be preserved due to two versions of igfxfmid.h
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4005)
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/command_stream/linear_stream.h"
|
||||
#include "runtime/command_stream/preemption.h"
|
||||
#include "runtime/device/device.h"
|
||||
#include "runtime/gmm_helper/page_table_mngr.h"
|
||||
#include "runtime/helpers/gmm_callbacks.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/mem_obj/mem_obj.h"
|
||||
#include "runtime/os_interface/windows/wddm/wddm.h"
|
||||
#include "runtime/os_interface/windows/wddm_device_command_stream.h"
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "runtime/os_interface/windows/wddm_memory_manager.h"
|
||||
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/command_stream/command_stream_receiver_hw.h"
|
||||
#include "runtime/device/device.h"
|
||||
#include "runtime/execution_environment/execution_environment.h"
|
||||
@@ -14,7 +15,6 @@
|
||||
#include "runtime/gmm_helper/gmm_helper.h"
|
||||
#include "runtime/gmm_helper/resource_info.h"
|
||||
#include "runtime/helpers/aligned_memory.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/surface_formats.h"
|
||||
#include "runtime/memory_manager/deferrable_deletion.h"
|
||||
#include "runtime/memory_manager/deferred_deleter.h"
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/device/device.h"
|
||||
#include "runtime/helpers/aligned_memory.h"
|
||||
#include "runtime/helpers/dispatch_info.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/string.h"
|
||||
#include "runtime/kernel/kernel.h"
|
||||
#include "runtime/mem_obj/buffer.h"
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
#include "printf_handler.h"
|
||||
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/aligned_memory.h"
|
||||
#include "runtime/helpers/dispatch_info.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/kernel/kernel.h"
|
||||
#include "runtime/mem_obj/buffer.h"
|
||||
#include "runtime/memory_manager/memory_manager.h"
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/gtpin/gtpin_notify.h"
|
||||
#include "runtime/helpers/aligned_memory.h"
|
||||
#include "runtime/helpers/debug_helpers.h"
|
||||
#include "runtime/helpers/hash.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/string.h"
|
||||
#include "runtime/memory_manager/memory_manager.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user