From 00b70cd41c9c35366fbcb1be4e98044d5a93c473 Mon Sep 17 00:00:00 2001 From: Andrei Elovikov Date: Mon, 23 Sep 2024 12:12:36 -0700 Subject: [PATCH] Move `ur_*` headers to the top level `include/` --- sycl/CMakeLists.txt | 12 ++++++------ sycl/include/sycl/accessor.hpp | 2 +- sycl/include/sycl/backend.hpp | 2 +- sycl/include/sycl/buffer.hpp | 2 +- sycl/include/sycl/context.hpp | 2 +- sycl/include/sycl/detail/array.hpp | 2 +- sycl/include/sycl/detail/cg_types.hpp | 2 +- sycl/include/sycl/detail/info_desc_helpers.hpp | 2 +- sycl/include/sycl/detail/ur.hpp | 12 ++++++------ sycl/include/sycl/device.hpp | 2 +- sycl/include/sycl/event.hpp | 2 +- .../sycl/ext/oneapi/accessor_property_list.hpp | 2 +- .../sycl/ext/oneapi/bindless_images_interop.hpp | 2 +- .../sycl/ext/oneapi/bindless_images_mem_handle.hpp | 2 +- .../sycl/ext/oneapi/bindless_images_sampler.hpp | 2 +- sycl/include/sycl/image.hpp | 2 +- sycl/include/sycl/info/info_desc.hpp | 2 +- sycl/include/sycl/interop_handle.hpp | 2 +- sycl/include/sycl/kernel.hpp | 2 +- sycl/include/sycl/kernel_bundle.hpp | 2 +- sycl/include/sycl/kernel_handler.hpp | 2 +- sycl/include/sycl/memory_enums.hpp | 2 +- sycl/include/sycl/platform.hpp | 2 +- sycl/source/detail/common.cpp | 2 +- sycl/source/detail/device_binary_image.hpp | 2 +- sycl/source/detail/error_handling/error_handling.hpp | 2 +- sycl/source/detail/mem_alloc_helper.hpp | 2 +- sycl/source/detail/memory_manager.hpp | 2 +- sycl/source/detail/platform_util.cpp | 2 +- sycl/source/detail/plugin.hpp | 2 +- sycl/source/detail/spec_constant_impl.cpp | 2 +- sycl/source/detail/sycl_mem_obj_i.hpp | 2 +- sycl/source/detail/ur.cpp | 2 +- sycl/test/include_deps/deps_known.sh | 3 ++- sycl/tools/sycl-trace/ur_trace_collector.cpp | 2 +- sycl/tools/xpti_helpers/usm_analyzer.hpp | 2 +- 36 files changed, 47 insertions(+), 46 deletions(-) diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index fae217bccb9fc..2470ccac77a1d 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -248,9 +248,9 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E copy_directory ${sycl_inc_dir}/std ${SYCL_INCLUDE_BUILD_DIR}/std COMMAND ${CMAKE_COMMAND} -E copy_directory ${sycl_inc_dir}/syclcompat ${SYCL_INCLUDE_BUILD_DIR}/syclcompat COMMAND ${CMAKE_COMMAND} -E copy ${sycl_inc_dir}/syclcompat.hpp ${SYCL_INCLUDE_BUILD_DIR}/syclcompat.hpp - COMMAND ${CMAKE_COMMAND} -E copy ${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_api.h ${SYCL_INCLUDE_BUILD_DIR}/sycl - COMMAND ${CMAKE_COMMAND} -E copy ${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_api_funcs.def ${SYCL_INCLUDE_BUILD_DIR}/sycl - COMMAND ${CMAKE_COMMAND} -E copy ${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_print.hpp ${SYCL_INCLUDE_BUILD_DIR}/sycl + COMMAND ${CMAKE_COMMAND} -E copy ${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_api.h ${SYCL_INCLUDE_BUILD_DIR} + COMMAND ${CMAKE_COMMAND} -E copy ${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_api_funcs.def ${SYCL_INCLUDE_BUILD_DIR} + COMMAND ${CMAKE_COMMAND} -E copy ${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_print.hpp ${SYCL_INCLUDE_BUILD_DIR} COMMENT "Copying SYCL headers ...") # Copy SYCL headers from source to install directory @@ -260,11 +260,11 @@ install(DIRECTORY "${sycl_inc_dir}/std" DESTINATION ${SYCL_INCLUDE_DIR} COMPONEN install(DIRECTORY ${BOOST_MP11_DESTINATION_DIR} DESTINATION ${SYCL_INCLUDE_DIR}/sycl/detail COMPONENT boost_mp11-headers) install(DIRECTORY "${sycl_inc_dir}/syclcompat" DESTINATION ${SYCL_INCLUDE_DIR} COMPONENT sycl-headers) install(FILES "${sycl_inc_dir}/syclcompat.hpp" DESTINATION ${SYCL_INCLUDE_DIR} COMPONENT sycl-headers) -install(FILES "${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_api.h" DESTINATION ${SYCL_INCLUDE_DIR}/sycl +install(FILES "${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_api.h" DESTINATION ${SYCL_INCLUDE_DIR} COMPONENT sycl-headers) -install(FILES "${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_api_funcs.def" DESTINATION ${SYCL_INCLUDE_DIR}/sycl +install(FILES "${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_api_funcs.def" DESTINATION ${SYCL_INCLUDE_DIR} COMPONENT sycl-headers) -install(FILES "${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_print.hpp" DESTINATION ${SYCL_INCLUDE_DIR}/sycl +install(FILES "${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_print.hpp" DESTINATION ${SYCL_INCLUDE_DIR} COMPONENT sycl-headers) if (WIN32) diff --git a/sycl/include/sycl/accessor.hpp b/sycl/include/sycl/accessor.hpp index c8c3118035443..72f54f150ecfe 100644 --- a/sycl/include/sycl/accessor.hpp +++ b/sycl/include/sycl/accessor.hpp @@ -37,7 +37,7 @@ #include // for property_list #include // for range #include // for addressing_mode -#include // for UR_RESULT_ERRO... +#include // for UR_RESULT_ERRO... #include // for size_t #include // for hash diff --git a/sycl/include/sycl/backend.hpp b/sycl/include/sycl/backend.hpp index 93dbf639bddf4..ff89a07a06cea 100644 --- a/sycl/include/sycl/backend.hpp +++ b/sycl/include/sycl/backend.hpp @@ -31,7 +31,7 @@ #include // for platform, get_n... #include // for property_list #include // for queue, get_native -#include // for ur_native_handle_t +#include // for ur_native_handle_t #if SYCL_BACKEND_OPENCL #include // for interop diff --git a/sycl/include/sycl/buffer.hpp b/sycl/include/sycl/buffer.hpp index 09efa2fac3ac0..8b3a14af607f2 100644 --- a/sycl/include/sycl/buffer.hpp +++ b/sycl/include/sycl/buffer.hpp @@ -25,7 +25,7 @@ #include #include #include -#include // for ur_native_handle_t +#include // for ur_native_handle_t #include // for size_t, nullptr_t #include // for function diff --git a/sycl/include/sycl/context.hpp b/sycl/include/sycl/context.hpp index 0ccd168692545..e517f6c432478 100644 --- a/sycl/include/sycl/context.hpp +++ b/sycl/include/sycl/context.hpp @@ -17,7 +17,7 @@ #include // for OwnerLessBase #include // for platform #include // for property_list -#include // for ur_native_handle_t +#include // for ur_native_handle_t #ifdef __SYCL_INTERNAL_API #include diff --git a/sycl/include/sycl/detail/array.hpp b/sycl/include/sycl/detail/array.hpp index 0059673cbe78c..f0602c52885d8 100644 --- a/sycl/include/sycl/detail/array.hpp +++ b/sycl/include/sycl/detail/array.hpp @@ -10,7 +10,7 @@ #include // for __SYCL_ALWAYS_INLINE #include -#include // for UR_RESULT_ERROR_INVALID_VALUE +#include // for UR_RESULT_ERROR_INVALID_VALUE #include // for size_t #include // for enable_if_t diff --git a/sycl/include/sycl/detail/cg_types.hpp b/sycl/include/sycl/detail/cg_types.hpp index 2334c217c1bbf..cb7b066a256b1 100644 --- a/sycl/include/sycl/detail/cg_types.hpp +++ b/sycl/include/sycl/detail/cg_types.hpp @@ -23,7 +23,7 @@ #include // for nd_item #include // for nd_range #include // for range, operator* -#include // for UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE +#include // for UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE #include // for function #include // for size_t diff --git a/sycl/include/sycl/detail/info_desc_helpers.hpp b/sycl/include/sycl/detail/info_desc_helpers.hpp index 273c6e0e1d62b..d3b4bfd977139 100644 --- a/sycl/include/sycl/detail/info_desc_helpers.hpp +++ b/sycl/include/sycl/detail/info_desc_helpers.hpp @@ -8,7 +8,7 @@ #pragma once -#include +#include #include // for true_type diff --git a/sycl/include/sycl/detail/ur.hpp b/sycl/include/sycl/detail/ur.hpp index 33e954d20d508..1320cf5e82449 100644 --- a/sycl/include/sycl/detail/ur.hpp +++ b/sycl/include/sycl/detail/ur.hpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include @@ -49,13 +49,13 @@ namespace detail { enum class UrApiKind { #define _UR_API(api) api, -#include +#include #undef _UR_API }; struct UrFuncPtrMapT { #define _UR_API(api) decltype(&::api) pfn_##api = nullptr; -#include +#include #undef _UR_API }; @@ -66,7 +66,7 @@ void *GetWinProcAddress(void *module, const char *funcName); inline void PopulateUrFuncPtrTable(UrFuncPtrMapT *funcs, void *module) { #define _UR_API(api) \ funcs->pfn_##api = (decltype(&::api))GetWinProcAddress(module, #api); -#include +#include #undef _UR_API } @@ -81,7 +81,7 @@ inline void PopulateUrFuncPtrTable(UrFuncPtrMapT *funcs, void *module) { return (FuncPtrT)GetWinProcAddress(module, #api); \ } \ }; -#include +#include #undef _UR_API #else #define _UR_API(api) \ @@ -91,7 +91,7 @@ inline void PopulateUrFuncPtrTable(UrFuncPtrMapT *funcs, void *module) { constexpr inline FuncPtrT getFuncPtr(const void *) { return &api; } \ constexpr inline FuncPtrT getFuncPtrFromModule(void *) { return &api; } \ }; -#include +#include #undef _UR_API #endif diff --git a/sycl/include/sycl/device.hpp b/sycl/include/sycl/device.hpp index e2933ed06bdd2..d49a1f1d1ff9a 100644 --- a/sycl/include/sycl/device.hpp +++ b/sycl/include/sycl/device.hpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include diff --git a/sycl/include/sycl/event.hpp b/sycl/include/sycl/event.hpp index 9d4b790ad0968..2f3974dca5e39 100644 --- a/sycl/include/sycl/event.hpp +++ b/sycl/include/sycl/event.hpp @@ -13,7 +13,7 @@ #include // for __SYCL_EXPORT #include // for is_event_info_desc, is_... #include // for OwnerLessBase -#include // for ur_native_handle_t +#include // for ur_native_handle_t #ifdef __SYCL_INTERNAL_API #include diff --git a/sycl/include/sycl/ext/oneapi/accessor_property_list.hpp b/sycl/include/sycl/ext/oneapi/accessor_property_list.hpp index cfdba703d961e..7a1ce1119dbbd 100644 --- a/sycl/include/sycl/ext/oneapi/accessor_property_list.hpp +++ b/sycl/include/sycl/ext/oneapi/accessor_property_list.hpp @@ -14,7 +14,7 @@ #include // for PropertyListBase #include #include // for property_list -#include // for UR_RESULT_ERROR_INVALID_VALUE +#include // for UR_RESULT_ERROR_INVALID_VALUE #include // for bitset #include // for shared_ptr diff --git a/sycl/include/sycl/ext/oneapi/bindless_images_interop.hpp b/sycl/include/sycl/ext/oneapi/bindless_images_interop.hpp index b5e1794b7446e..a0d6eef50c5f6 100644 --- a/sycl/include/sycl/ext/oneapi/bindless_images_interop.hpp +++ b/sycl/include/sycl/ext/oneapi/bindless_images_interop.hpp @@ -8,7 +8,7 @@ #pragma once -#include +#include #include // for size_t diff --git a/sycl/include/sycl/ext/oneapi/bindless_images_mem_handle.hpp b/sycl/include/sycl/ext/oneapi/bindless_images_mem_handle.hpp index 80f2563d43191..0d859fb9e3288 100644 --- a/sycl/include/sycl/ext/oneapi/bindless_images_mem_handle.hpp +++ b/sycl/include/sycl/ext/oneapi/bindless_images_mem_handle.hpp @@ -8,7 +8,7 @@ #pragma once -#include "sycl/ur_api.h" +#include namespace sycl { inline namespace _V1 { diff --git a/sycl/include/sycl/ext/oneapi/bindless_images_sampler.hpp b/sycl/include/sycl/ext/oneapi/bindless_images_sampler.hpp index 3f442c48f36fa..e3221ce62db1e 100644 --- a/sycl/include/sycl/ext/oneapi/bindless_images_sampler.hpp +++ b/sycl/include/sycl/ext/oneapi/bindless_images_sampler.hpp @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace sycl { inline namespace _V1 { diff --git a/sycl/include/sycl/image.hpp b/sycl/include/sycl/image.hpp index 654f5498bde5a..386fe93d3e41d 100644 --- a/sycl/include/sycl/image.hpp +++ b/sycl/include/sycl/image.hpp @@ -30,7 +30,7 @@ #include // for range, rangeTo... #include // for image_sampler #include // for vec -#include // for ur_native_hand... +#include // for ur_native_hand... #include // for size_t, nullptr_t #include // for function diff --git a/sycl/include/sycl/info/info_desc.hpp b/sycl/include/sycl/info/info_desc.hpp index 6356b388d5590..b84f98f350d0d 100644 --- a/sycl/include/sycl/info/info_desc.hpp +++ b/sycl/include/sycl/info/info_desc.hpp @@ -9,7 +9,7 @@ #pragma once #include // for __SYCL2020_DEPRECATED -#include +#include // FIXME: .def files included to this file use all sorts of SYCL objects like // id, range, traits, etc. We have to include some headers before including .def diff --git a/sycl/include/sycl/interop_handle.hpp b/sycl/include/sycl/interop_handle.hpp index c9a125642860b..81e4a9d559caa 100644 --- a/sycl/include/sycl/interop_handle.hpp +++ b/sycl/include/sycl/interop_handle.hpp @@ -21,7 +21,7 @@ #include // for accessor_property_list #include // for image #include // for buffer -#include // for ur_mem_handle_t, ur... +#include // for ur_mem_handle_t, ur... #include // for shared_ptr #include // for int32_t diff --git a/sycl/include/sycl/kernel.hpp b/sycl/include/sycl/kernel.hpp index ffa04c5e525f8..dac7f619d745e 100644 --- a/sycl/include/sycl/kernel.hpp +++ b/sycl/include/sycl/kernel.hpp @@ -22,7 +22,7 @@ #include // for device #include // for bundle_state #include // for range -#include // for ur_native_handle_t +#include // for ur_native_handle_t #include // for hash namespace sycl { diff --git a/sycl/include/sycl/kernel_bundle.hpp b/sycl/include/sycl/kernel_bundle.hpp index e52ef1ea5869d..1237bc0651b40 100644 --- a/sycl/include/sycl/kernel_bundle.hpp +++ b/sycl/include/sycl/kernel_bundle.hpp @@ -19,7 +19,7 @@ #include // for kernel, kernel_bundle #include // for bundle_state #include // for property_list -#include // for ur_native_handle_t +#include // for ur_native_handle_t #include #include // PropertyT diff --git a/sycl/include/sycl/kernel_handler.hpp b/sycl/include/sycl/kernel_handler.hpp index d631148409745..1c59400cdc273 100644 --- a/sycl/include/sycl/kernel_handler.hpp +++ b/sycl/include/sycl/kernel_handler.hpp @@ -11,7 +11,7 @@ #include // for __SYCL_TYPE #include // for __SYCL_ALWAYS_INLINE #include // for feature_not_supported -#include // for UR_RESULT_ERROR_INVALID_OPERATION +#include // for UR_RESULT_ERROR_INVALID_OPERATION #ifdef __SYCL_DEVICE_ONLY__ #include diff --git a/sycl/include/sycl/memory_enums.hpp b/sycl/include/sycl/memory_enums.hpp index 638b66c7beb41..9ae997896f5e8 100644 --- a/sycl/include/sycl/memory_enums.hpp +++ b/sycl/include/sycl/memory_enums.hpp @@ -8,7 +8,7 @@ #pragma once -#include // for ur_memory_order_capability_flags_t +#include // for ur_memory_order_capability_flags_t #include // for memory_order #include // for vector diff --git a/sycl/include/sycl/platform.hpp b/sycl/include/sycl/platform.hpp index 3d6f5374cc696..cc99804680487 100644 --- a/sycl/include/sycl/platform.hpp +++ b/sycl/include/sycl/platform.hpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #ifdef __SYCL_INTERNAL_API #include diff --git a/sycl/source/detail/common.cpp b/sycl/source/detail/common.cpp index 255ab7b089116..dded4d4955f3a 100644 --- a/sycl/source/detail/common.cpp +++ b/sycl/source/detail/common.cpp @@ -8,7 +8,7 @@ #include -#include +#include namespace sycl { inline namespace _V1 { diff --git a/sycl/source/detail/device_binary_image.hpp b/sycl/source/detail/device_binary_image.hpp index e5e238d0c5a86..298d176f4cdff 100644 --- a/sycl/source/detail/device_binary_image.hpp +++ b/sycl/source/detail/device_binary_image.hpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include diff --git a/sycl/source/detail/error_handling/error_handling.hpp b/sycl/source/detail/error_handling/error_handling.hpp index 1f8d21f7226d5..3583eb773e764 100644 --- a/sycl/source/detail/error_handling/error_handling.hpp +++ b/sycl/source/detail/error_handling/error_handling.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include namespace sycl { inline namespace _V1 { diff --git a/sycl/source/detail/mem_alloc_helper.hpp b/sycl/source/detail/mem_alloc_helper.hpp index 1924804706e2a..69759709c0b47 100644 --- a/sycl/source/detail/mem_alloc_helper.hpp +++ b/sycl/source/detail/mem_alloc_helper.hpp @@ -8,7 +8,7 @@ #pragma once -#include +#include namespace sycl { inline namespace _V1 { diff --git a/sycl/source/detail/memory_manager.hpp b/sycl/source/detail/memory_manager.hpp index bd1821a752361..cc573abc62ddb 100644 --- a/sycl/source/detail/memory_manager.hpp +++ b/sycl/source/detail/memory_manager.hpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include diff --git a/sycl/source/detail/platform_util.cpp b/sycl/source/detail/platform_util.cpp index 93ec814ca2ad3..68692ce14b96b 100644 --- a/sycl/source/detail/platform_util.cpp +++ b/sycl/source/detail/platform_util.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #if defined(__SYCL_RT_OS_LINUX) #include diff --git a/sycl/source/detail/plugin.hpp b/sycl/source/detail/plugin.hpp index 52616e22f130a..22f9ed96cb589 100644 --- a/sycl/source/detail/plugin.hpp +++ b/sycl/source/detail/plugin.hpp @@ -15,7 +15,7 @@ #include #include -#include +#include #ifdef XPTI_ENABLE_INSTRUMENTATION // Include the headers necessary for emitting traces using the trace framework #include "xpti/xpti_trace_framework.h" diff --git a/sycl/source/detail/spec_constant_impl.cpp b/sycl/source/detail/spec_constant_impl.cpp index a40ed7881762e..8696cc69ee612 100644 --- a/sycl/source/detail/spec_constant_impl.cpp +++ b/sycl/source/detail/spec_constant_impl.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include diff --git a/sycl/source/detail/sycl_mem_obj_i.hpp b/sycl/source/detail/sycl_mem_obj_i.hpp index 3cb7b762a89c0..4d1e84d2ef836 100644 --- a/sycl/source/detail/sycl_mem_obj_i.hpp +++ b/sycl/source/detail/sycl_mem_obj_i.hpp @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace sycl { inline namespace _V1 { diff --git a/sycl/source/detail/ur.cpp b/sycl/source/detail/ur.cpp index b247dcca876f9..fb70b92e3b29f 100644 --- a/sycl/source/detail/ur.cpp +++ b/sycl/source/detail/ur.cpp @@ -22,8 +22,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/sycl/test/include_deps/deps_known.sh b/sycl/test/include_deps/deps_known.sh index e4b8e78856e79..d4b33541b0205 100644 --- a/sycl/test/include_deps/deps_known.sh +++ b/sycl/test/include_deps/deps_known.sh @@ -13,9 +13,10 @@ function deps() { clang++ -fsycl -fsycl-device-only -include "$HEADER" -c -x c++ /dev/null -o /dev/null -MD -MF - \ | sed 's@: /dev/null@: /dev/null\n@' \ - | grep 'include/sycl\|/dev/null\|CL/\|:' \ + | grep 'include/sycl\|/dev/null\|CL/\|ur_\|:' \ | sed 's@.*/include/sycl/@@' \ | sed 's@.*/include/CL/@CL/@' \ + | sed 's@.*/include/ur_@ur_@' \ | sed 's/ \\//' } diff --git a/sycl/tools/sycl-trace/ur_trace_collector.cpp b/sycl/tools/sycl-trace/ur_trace_collector.cpp index 77e0c23e823b6..4f9e1959bedce 100644 --- a/sycl/tools/sycl-trace/ur_trace_collector.cpp +++ b/sycl/tools/sycl-trace/ur_trace_collector.cpp @@ -12,7 +12,7 @@ #include "xpti/xpti_trace_framework.h" #include -#include +#include #include #include diff --git a/sycl/tools/xpti_helpers/usm_analyzer.hpp b/sycl/tools/xpti_helpers/usm_analyzer.hpp index dc14563d660de..6df1c522899d9 100644 --- a/sycl/tools/xpti_helpers/usm_analyzer.hpp +++ b/sycl/tools/xpti_helpers/usm_analyzer.hpp @@ -8,7 +8,7 @@ #include "xpti/xpti_trace_framework.h" -#include +#include #include #include