From 96cc1081c083341d89ce14283ad5b3e4f1cdfff3 Mon Sep 17 00:00:00 2001 From: Mateusz Hoppe Date: Wed, 4 Dec 2019 09:47:55 +0100 Subject: [PATCH] Moving print.h/.cpp files to core Change-Id: I4972f87a007c7183acdaf79f48ece4ff0a6cf087 Signed-off-by: Mateusz Hoppe --- core/os_interface/CMakeLists.txt | 1 + core/os_interface/linux/CMakeLists.txt | 1 + .../os_interface/linux/print.cpp | 2 +- core/os_interface/print.h | 17 ++++++++++ core/os_interface/windows/CMakeLists.txt | 1 + .../os_interface/windows/print.cpp | 4 +-- runtime/os_interface/CMakeLists.txt | 1 - runtime/os_interface/linux/CMakeLists.txt | 1 - runtime/os_interface/print.h | 32 ------------------- runtime/os_interface/windows/CMakeLists.txt | 1 - runtime/program/print_formatter.h | 2 +- 11 files changed, 24 insertions(+), 39 deletions(-) rename {runtime => core}/os_interface/linux/print.cpp (97%) create mode 100644 core/os_interface/print.h rename {runtime => core}/os_interface/windows/print.cpp (97%) delete mode 100644 runtime/os_interface/print.h diff --git a/core/os_interface/CMakeLists.txt b/core/os_interface/CMakeLists.txt index 2427c5ffe3..931a573a0e 100644 --- a/core/os_interface/CMakeLists.txt +++ b/core/os_interface/CMakeLists.txt @@ -10,6 +10,7 @@ set(NEO_CORE_OS_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/aub_memory_operations_handler.h ${CMAKE_CURRENT_SOURCE_DIR}/os_library.h ${CMAKE_CURRENT_SOURCE_DIR}/os_memory.h + ${CMAKE_CURRENT_SOURCE_DIR}/print.h ) set_property(GLOBAL PROPERTY NEO_CORE_OS_INTERFACE ${NEO_CORE_OS_INTERFACE}) diff --git a/core/os_interface/linux/CMakeLists.txt b/core/os_interface/linux/CMakeLists.txt index 23699b3909..646a318bd0 100644 --- a/core/os_interface/linux/CMakeLists.txt +++ b/core/os_interface/linux/CMakeLists.txt @@ -12,6 +12,7 @@ set(NEO_CORE_OS_INTERFACE_LINUX ${CMAKE_CURRENT_SOURCE_DIR}/os_library_linux.h ${CMAKE_CURRENT_SOURCE_DIR}/os_memory_linux.cpp ${CMAKE_CURRENT_SOURCE_DIR}/os_memory_linux.h + ${CMAKE_CURRENT_SOURCE_DIR}/print.cpp ) set_property(GLOBAL PROPERTY NEO_CORE_OS_INTERFACE_LINUX ${NEO_CORE_OS_INTERFACE_LINUX}) diff --git a/runtime/os_interface/linux/print.cpp b/core/os_interface/linux/print.cpp similarity index 97% rename from runtime/os_interface/linux/print.cpp rename to core/os_interface/linux/print.cpp index 2ee3dec4b0..ec07d0c98b 100644 --- a/runtime/os_interface/linux/print.cpp +++ b/core/os_interface/linux/print.cpp @@ -5,7 +5,7 @@ * */ -#include "runtime/os_interface/print.h" +#include "core/os_interface/print.h" #include #include diff --git a/core/os_interface/print.h b/core/os_interface/print.h new file mode 100644 index 0000000000..cc6ea61ca9 --- /dev/null +++ b/core/os_interface/print.h @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2017-2019 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once + +#include + +void printToSTDOUT(const char *str); + +template +size_t simple_sprintf(char *output, size_t outputSize, const char *format, T value); +size_t simple_sprintf(char *output, size_t outputSize, const char *format, const char *value); +size_t simple_sprintf(char *output, size_t outputSize, const char *format, void *value); diff --git a/core/os_interface/windows/CMakeLists.txt b/core/os_interface/windows/CMakeLists.txt index 92758f18da..b921bbbd46 100644 --- a/core/os_interface/windows/CMakeLists.txt +++ b/core/os_interface/windows/CMakeLists.txt @@ -12,6 +12,7 @@ set(NEO_CORE_OS_INTERFACE_WINDOWS ${CMAKE_CURRENT_SOURCE_DIR}/os_library_win.h ${CMAKE_CURRENT_SOURCE_DIR}/os_memory_win.cpp ${CMAKE_CURRENT_SOURCE_DIR}/os_memory_win.h + ${CMAKE_CURRENT_SOURCE_DIR}/print.cpp ${CMAKE_CURRENT_SOURCE_DIR}/windows_wrapper.h ) diff --git a/runtime/os_interface/windows/print.cpp b/core/os_interface/windows/print.cpp similarity index 97% rename from runtime/os_interface/windows/print.cpp rename to core/os_interface/windows/print.cpp index c14d204ac6..7a3199ceb8 100644 --- a/runtime/os_interface/windows/print.cpp +++ b/core/os_interface/windows/print.cpp @@ -5,7 +5,7 @@ * */ -#include "runtime/os_interface/print.h" +#include "core/os_interface/print.h" #include "core/os_interface/windows/windows_wrapper.h" @@ -78,4 +78,4 @@ template size_t simple_sprintf(char *output, size_t output_size, const template size_t simple_sprintf(char *output, size_t output_size, const char *format, uint8_t value); template size_t simple_sprintf(char *output, size_t output_size, const char *format, uint16_t value); template size_t simple_sprintf(char *output, size_t output_size, const char *format, uint32_t value); -template size_t simple_sprintf(char *output, size_t output_size, const char *format, uint64_t value); \ No newline at end of file +template size_t simple_sprintf(char *output, size_t output_size, const char *format, uint64_t value); diff --git a/runtime/os_interface/CMakeLists.txt b/runtime/os_interface/CMakeLists.txt index 17129ba17b..db6b339db1 100644 --- a/runtime/os_interface/CMakeLists.txt +++ b/runtime/os_interface/CMakeLists.txt @@ -27,7 +27,6 @@ set(RUNTIME_SRCS_OS_INTERFACE_BASE ${CMAKE_CURRENT_SOURCE_DIR}/os_time.h ${CMAKE_CURRENT_SOURCE_DIR}/performance_counters.cpp ${CMAKE_CURRENT_SOURCE_DIR}/performance_counters.h - ${CMAKE_CURRENT_SOURCE_DIR}/print.h ) target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_OS_INTERFACE_BASE}) diff --git a/runtime/os_interface/linux/CMakeLists.txt b/runtime/os_interface/linux/CMakeLists.txt index ef84a4934e..4cce4b4f5e 100644 --- a/runtime/os_interface/linux/CMakeLists.txt +++ b/runtime/os_interface/linux/CMakeLists.txt @@ -50,7 +50,6 @@ set(RUNTIME_SRCS_OS_INTERFACE_LINUX ${CMAKE_CURRENT_SOURCE_DIR}/os_time_linux.h ${CMAKE_CURRENT_SOURCE_DIR}/performance_counters_linux.cpp ${CMAKE_CURRENT_SOURCE_DIR}/performance_counters_linux.h - ${CMAKE_CURRENT_SOURCE_DIR}/print.cpp ) if(UNIX) target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_OS_INTERFACE_LINUX}) diff --git a/runtime/os_interface/print.h b/runtime/os_interface/print.h deleted file mode 100644 index d9203f52da..0000000000 --- a/runtime/os_interface/print.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2017, Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -#pragma once - -#include - -void printToSTDOUT(const char *str); - -template -size_t simple_sprintf(char *output, size_t outputSize, const char *format, T value); -size_t simple_sprintf(char *output, size_t outputSize, const char *format, const char *value); -size_t simple_sprintf(char *output, size_t outputSize, const char *format, void *value); \ No newline at end of file diff --git a/runtime/os_interface/windows/CMakeLists.txt b/runtime/os_interface/windows/CMakeLists.txt index 7620a430ec..a494f01e04 100644 --- a/runtime/os_interface/windows/CMakeLists.txt +++ b/runtime/os_interface/windows/CMakeLists.txt @@ -41,7 +41,6 @@ set(RUNTIME_SRCS_OS_INTERFACE_WINDOWS ${CMAKE_CURRENT_SOURCE_DIR}/os_time_win.h ${CMAKE_CURRENT_SOURCE_DIR}/performance_counters_win.cpp ${CMAKE_CURRENT_SOURCE_DIR}/performance_counters_win.h - ${CMAKE_CURRENT_SOURCE_DIR}/print.cpp ${CMAKE_CURRENT_SOURCE_DIR}/sys_calls.h ${CMAKE_CURRENT_SOURCE_DIR}/thk_wrapper.h ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/wddm_allocation.cpp diff --git a/runtime/program/print_formatter.h b/runtime/program/print_formatter.h index fa07c0b8d6..ea4a928ff9 100644 --- a/runtime/program/print_formatter.h +++ b/runtime/program/print_formatter.h @@ -8,8 +8,8 @@ #pragma once #include "core/helpers/aligned_memory.h" +#include "core/os_interface/print.h" #include "runtime/kernel/kernel.h" -#include "runtime/os_interface/print.h" #include #include