Skip to content

[SYCL] Remove unused plugin-related infrastructure from scripts. #15387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down
64 changes: 0 additions & 64 deletions sycl/cmake/modules/AddSYCL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 0 additions & 4 deletions sycl/test/include_deps/deps_known.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@ function deps() {
#
# However, sometimes first header is on the same line with
# "null.o: /dev/null <header>", so add an explicit line break there.
#
# Also, <detail/plugins/.*/features.hpp> 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/ \\//'
}
Expand Down
29 changes: 0 additions & 29 deletions sycl/tools/abi_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <backend BE> __SYCL_EXPORT const PluginPtr &getPlugin();
#
# ur.cpp:
# template <backend BE> 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

Expand Down
1 change: 0 additions & 1 deletion sycl/tools/sycl-trace/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
Loading