From 813e58c2045895aa984004b049ecbfba539f692d Mon Sep 17 00:00:00 2001 From: Aaron Greig Date: Fri, 13 Sep 2024 12:18:23 +0100 Subject: [PATCH] [SYCL] Remove unused plugin-related infrastructure from scripts. Also delete commented out plugin stream reference in sycl-trace. --- sycl/CMakeLists.txt | 3 +- sycl/cmake/modules/AddSYCL.cmake | 64 ---------------------------- sycl/test/include_deps/deps_known.sh | 4 -- sycl/tools/abi_check.py | 29 ------------- sycl/tools/sycl-trace/main.cpp | 1 - 5 files changed, 1 insertion(+), 100 deletions(-) diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index 3c529e7e5aeb2..1bc03edd866ce 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -196,7 +196,6 @@ set(SYCL_EXT_ONEAPI_BACKEND_HIP ${LLVM_HAS_AMDGPU_TARGET}) # Configure SYCL version macro set(sycl_inc_dir ${CMAKE_CURRENT_SOURCE_DIR}/include) set(sycl_src_dir ${CMAKE_CURRENT_SOURCE_DIR}/source) -set(sycl_plugin_dir ${CMAKE_CURRENT_SOURCE_DIR}/plugins) string(TIMESTAMP __SYCL_COMPILER_VERSION "%Y%m%d") configure_file("source/version.hpp.in" "${SYCL_INCLUDE_BUILD_DIR}/sycl/version.hpp") configure_file("source/feature_test.hpp.in" "${SYCL_INCLUDE_BUILD_DIR}/sycl/feature_test.hpp") @@ -289,7 +288,7 @@ else() endif() # This function allows building multiple libraries with the same options. -# Currently used by sycl and plugins library. +# Currently used by add_sycl_library and add_sycl_rt_library. # Currently handles linking with libcxx support and gcc workaround function( add_common_options LIB_NAME) if (SYCL_USE_LIBCXX) diff --git a/sycl/cmake/modules/AddSYCL.cmake b/sycl/cmake/modules/AddSYCL.cmake index 16338b432f80e..9b25a85e25930 100644 --- a/sycl/cmake/modules/AddSYCL.cmake +++ b/sycl/cmake/modules/AddSYCL.cmake @@ -33,67 +33,3 @@ function(add_sycl_library LIB_NAME TYPE) # TODO remove add_common_options add_common_options(${LIB_NAME}) endfunction() - -# current ur adapter dependency managing is a bit hacky, we should try to copy -# this as closely as possible instead -function(add_sycl_plugin PLUGIN_NAME) - cmake_parse_arguments("ARG" - "" - "" - "SOURCES;INCLUDE_DIRS;LIBRARIES;HEADER" - ${ARGN} - ) - - add_sycl_library("pi_${PLUGIN_NAME}" SHARED - LINKER_SCRIPT "${PROJECT_SOURCE_DIR}/plugins/ld-version-script.txt" - SOURCES ${ARG_SOURCES} - INCLUDE_DIRS - ${ARG_INCLUDE_DIRS} - ${sycl_inc_dir} - LIBRARIES - ${ARG_LIBRARIES} - OpenCL-Headers - ) - - # All SYCL plugins use UR sources. - # Disable errors from warnings and apply other workarounds while building the UR. - if(WIN32) - target_compile_options("pi_${PLUGIN_NAME}" PRIVATE /WX- /UUNICODE /DUSE_Z7=ON) - else() - target_compile_options("pi_${PLUGIN_NAME}" PRIVATE -Wno-error) - endif() - - # Install feature test header - if (NOT "${ARG_HEADER}" STREQUAL "") - get_filename_component(HEADER_NAME ${ARG_HEADER} NAME) - configure_file( - ${ARG_HEADER} - ${SYCL_INCLUDE_BUILD_DIR}/sycl/detail/plugins/${PLUGIN_NAME}/${HEADER_NAME} - COPYONLY) - - install(FILES ${ARG_HEADER} - DESTINATION ${SYCL_INCLUDE_DIR}/sycl/detail/plugins/${PLUGIN_NAME} - COMPONENT pi_${PLUGIN_NAME}) - endif() - - install(TARGETS pi_${PLUGIN_NAME} - LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT pi_${PLUGIN_NAME} - RUNTIME DESTINATION "bin" COMPONENT pi_${PLUGIN_NAME}) - - set (manifest_file - ${CMAKE_CURRENT_BINARY_DIR}/install_manifest_pi_${PLUGIN_NAME}.txt) - add_custom_command(OUTPUT ${manifest_file} - COMMAND "${CMAKE_COMMAND}" - "-DCMAKE_INSTALL_COMPONENT=pi_${PLUGIN_NAME}" - -P "${CMAKE_BINARY_DIR}/cmake_install.cmake" - COMMENT "Deploying component pi_${PLUGIN_NAME}" - USES_TERMINAL - ) - add_custom_target(install-sycl-plugin-${PLUGIN_NAME} - DEPENDS - ${manifest_file} pi_${PLUGIN_NAME} - ) - - set_property(GLOBAL APPEND PROPERTY SYCL_TOOLCHAIN_INSTALL_COMPONENTS - pi_${PLUGIN_NAME}) -endfunction() diff --git a/sycl/test/include_deps/deps_known.sh b/sycl/test/include_deps/deps_known.sh index 58a8e5e8656ad..65dce35dc08df 100644 --- a/sycl/test/include_deps/deps_known.sh +++ b/sycl/test/include_deps/deps_known.sh @@ -10,14 +10,10 @@ function deps() { # # However, sometimes first header is on the same line with # "null.o: /dev/null
", so add an explicit line break there. - # - # Also, is dependent on what plugins were - # enabled, so ignore them. 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\|:' \ - | grep -v 'detail/plugins/.*/features.hpp' \ | sed 's@.*/include/sycl/@@' \ | sed 's/ \\//' } diff --git a/sycl/tools/abi_check.py b/sycl/tools/abi_check.py index 30ab028fcde49..d788dd0ee2be4 100644 --- a/sycl/tools/abi_check.py +++ b/sycl/tools/abi_check.py @@ -61,35 +61,6 @@ def parse_readobj_output(output): # See: https://github.com/bminor/glibc/commit/035c012e32c11e84d64905efaf55e74f704d3668 ignore_symbols += ["__libc_csu_fini", "__libc_csu_init"] - # In some scenarios MSVC and clang-cl exhibit differences in regards to the exported symbols they generate. - # Some of them happen in the SYCL RT library and we think clang-cl's behavior is more reasonable. - # - # Case 1: - # ur.hpp: - # template __SYCL_EXPORT const PluginPtr &getPlugin(); - # - # ur.cpp: - # template const PluginPtr &getPlugin() { - # static const plugin *Plugin = nullptr; - # ... - # } - # // explicit dllexport instantiations. - # - # clang-cl generates exported symbols for the static variables Plugin. These are never referenced - # in the user's headers so cannot be used outside DLL and not exporting them should not affect any - # usage scenario. - # - # In general, the compiler doesn't know if the definition is in the DLL or in the header and inline - # dllexport/dllimport functions have to be supported, hence clang-cl's behavior. - # - # See also https://devblogs.microsoft.com/oldnewthing/20140109-00/?p=2123. - ignore_symbols += [ - "?Plugin@?1???$getPlugin@$01@pi@detail@_V1@sycl@@YAAEBVplugin@234@XZ@4PEBV5234@EB", - "?Plugin@?1???$getPlugin@$00@pi@detail@_V1@sycl@@YAAEBVplugin@234@XZ@4PEBV5234@EB", - "?Plugin@?1???$getPlugin@$04@pi@detail@_V1@sycl@@YAAEBVplugin@234@XZ@4PEBV5234@EB", - "?Plugin@?1???$getPlugin@$02@pi@detail@_V1@sycl@@YAAEBVplugin@234@XZ@4PEBV5234@EB", - "?Plugin@?1???$getPlugin@$05@pi@detail@_V1@sycl@@YAAEBVplugin@234@XZ@4PEBV5234@EB", - ] parsed_symbols = [s for s in parsed_symbols if s not in ignore_symbols] return parsed_symbols diff --git a/sycl/tools/sycl-trace/main.cpp b/sycl/tools/sycl-trace/main.cpp index 77c5c4ddee238..456342aa344ef 100644 --- a/sycl/tools/sycl-trace/main.cpp +++ b/sycl/tools/sycl-trace/main.cpp @@ -22,7 +22,6 @@ int main(int argc, char **argv, char *env[]) { cl::desc("Available tracing modes:"), cl::values( // TODO graph dot - // clEnumValN(PI, "plugin", "Trace Plugin Interface calls"), clEnumValN(UR, "ur.call", "Trace Unified Runtime calls"), clEnumValN(ZE, "level_zero", "Trace Level Zero calls"), clEnumValN(CU, "cuda", "Trace CUDA Driver API calls"),