diff --git a/.github/workflows/sycl-linux-build.yml b/.github/workflows/sycl-linux-build.yml index e3b350fbac3cb..ffacc9d9c7000 100644 --- a/.github/workflows/sycl-linux-build.yml +++ b/.github/workflows/sycl-linux-build.yml @@ -260,10 +260,6 @@ jobs: if: ${{ !cancelled() && contains(inputs.changes, 'libclc') }} run: | cmake --build $GITHUB_WORKSPACE/build --target check-libclc - - name: check-libdevice - if: ${{ !cancelled() && contains(inputs.changes, 'sycl') }} - run: | - cmake --build $GITHUB_WORKSPACE/build --target check-libdevice - name: Check E2E test requirements if: ${{ !cancelled() && !contains(inputs.changes, 'sycl') }} run: | diff --git a/.github/workflows/sycl-windows-build.yml b/.github/workflows/sycl-windows-build.yml index 829031649dab1..55b107aa081bf 100644 --- a/.github/workflows/sycl-windows-build.yml +++ b/.github/workflows/sycl-windows-build.yml @@ -186,10 +186,6 @@ jobs: if: ${{ !cancelled() && contains(inputs.changes, 'xptifw') }} run: | cmake --build build --target check-xptifw - - name: check-libdevice - if: ${{ !cancelled() && contains(inputs.changes, 'sycl') }} - run: | - cmake --build build --target check-libdevice - name: Generate/diff new ABI symbols if: ${{ !cancelled() && contains(inputs.changes, 'sycl') }} shell: bash diff --git a/libdevice/CMakeLists.txt b/libdevice/CMakeLists.txt index ca57cf39a1970..1a45e5a8f846a 100644 --- a/libdevice/CMakeLists.txt +++ b/libdevice/CMakeLists.txt @@ -50,5 +50,3 @@ set(LIBDEVICE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) set(LIBDEVICE_LIBRARY_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) set(LIBDEVICE_RUNTIME_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) set(LIBDEVICE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) - -add_subdirectory(test) diff --git a/libdevice/cmake/modules/SYCLLibdevice.cmake b/libdevice/cmake/modules/SYCLLibdevice.cmake index 1e5d079a0aacd..7c00bd5358bf8 100644 --- a/libdevice/cmake/modules/SYCLLibdevice.cmake +++ b/libdevice/cmake/modules/SYCLLibdevice.cmake @@ -4,19 +4,14 @@ set(obj-new-offload_binary_dir "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") if (MSVC) set(obj-suffix obj) set(obj-new-offload-suffix new.obj) - set(spv_binary_dir "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") - set(install_dest_spv bin) set(devicelib_host_static_obj sycl-devicelib-host.lib) set(devicelib_host_static_obj-new-offload sycl-devicelib-host.new.lib) else() set(obj-suffix o) set(obj-new-offload-suffix new.o) - set(spv_binary_dir "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") - set(install_dest_spv lib${LLVM_LIBDIR_SUFFIX}) set(devicelib_host_static_obj libsycl-devicelib-host.a) set(devicelib_host_static_obj-new-offload libsycl-devicelib-host.new.a) endif() -set(spv-suffix spv) set(bc-suffix bc) set(bc_binary_dir "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") set(install_dest_obj lib${LLVM_LIBDIR_SUFFIX}) @@ -80,8 +75,7 @@ endif() add_custom_target(libsycldevice) -set(filetypes obj obj-new-offload spv bc) -set(filetypes_no_spv obj obj-new-offload bc) +set(filetypes obj obj-new-offload bc) foreach(filetype IN LISTS filetypes) add_custom_target(libsycldevice-${filetype}) @@ -108,7 +102,6 @@ if("AMDGPU" IN_LIST LLVM_TARGETS_TO_BUILD) endif() -set(spv_device_compile_opts -fsycl-device-only -fsycl-device-obj=spirv) set(bc_device_compile_opts -fsycl-device-only -fsycl-device-obj=llvmir) set(obj-new-offload_device_compile_opts -fsycl -c --offload-new-driver -foffload-lto=thin ${sycl_targets_opt}) @@ -524,7 +517,6 @@ else() SRC sanitizer/asan_rtl.cpp DEPENDENCIES ${asan_obj_deps} BUILD_ARCHS ${sanitizer_build_archs} - FILETYPES "${filetypes_no_spv}" EXTRA_OPTS -fno-sycl-instrument-device-code -I${UR_SANITIZER_INCLUDE_DIR} -I${CMAKE_CURRENT_SOURCE_DIR}) @@ -532,7 +524,7 @@ else() # asan aot set(asan_devicetypes pvc cpu dg2) - foreach(asan_ft IN LISTS filetypes_no_spv) + foreach(asan_ft IN LISTS filetypes) foreach(asan_device IN LISTS asan_devicetypes) compile_lib_ext(libsycl-asan-${asan_device} SRC sanitizer/asan_rtl.cpp @@ -547,7 +539,6 @@ else() SRC sanitizer/msan_rtl.cpp DEPENDENCIES ${msan_obj_deps} BUILD_ARCHS ${sanitizer_build_archs} - FILETYPES "${filetypes_no_spv}" EXTRA_OPTS -fno-sycl-instrument-device-code -I${UR_SANITIZER_INCLUDE_DIR} -I${CMAKE_CURRENT_SOURCE_DIR}) @@ -555,7 +546,7 @@ else() # msan aot set(msan_devicetypes pvc cpu) - foreach(msan_ft IN LISTS filetypes_no_spv) + foreach(msan_ft IN LISTS filetypes) foreach(msan_device IN LISTS msan_devicetypes) compile_lib_ext(libsycl-msan-${msan_device} SRC sanitizer/msan_rtl.cpp @@ -570,14 +561,13 @@ else() SRC sanitizer/tsan_rtl.cpp DEPENDENCIES ${tsan_obj_deps} BUILD_ARCHS ${sanitizer_build_archs} - FILETYPES "${filetypes_no_spv}" EXTRA_OPTS -fno-sycl-instrument-device-code -I${UR_SANITIZER_INCLUDE_DIR} -I${CMAKE_CURRENT_SOURCE_DIR}) set(tsan_devicetypes pvc cpu) - foreach(tsan_ft IN LISTS filetypes_no_spv) + foreach(tsan_ft IN LISTS filetypes) foreach(tsan_device IN LISTS tsan_devicetypes) compile_lib_ext(libsycl-tsan-${tsan_device} SRC sanitizer/tsan_rtl.cpp diff --git a/libdevice/test/CMakeLists.txt b/libdevice/test/CMakeLists.txt deleted file mode 100644 index 0d027d7d905ba..0000000000000 --- a/libdevice/test/CMakeLists.txt +++ /dev/null @@ -1,53 +0,0 @@ -set(LIBDEVICE_TEST_DEPENDS - FileCheck - clang-offload-bundler - count - llvm-dis - llvm-spirv - not - ) - -# Enable new IN_LIST operator. -cmake_policy(SET CMP0057 NEW) -if (libdevice IN_LIST LLVM_ENABLE_PROJECTS AND - (sycl IN_LIST LLVM_ENABLE_PROJECTS OR - sycl IN_LIST LLVM_EXTERNAL_PROJECTS)) - set(LLVM_HAS_LIBSYCLDEVICE TRUE) - list(APPEND LIBDEVICE_TEST_DEPENDS libsycldevice) -endif() - -llvm_canonicalize_cmake_booleans( - LLVM_HAS_LIBSYCLDEVICE - ) - -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py - MAIN_CONFIG - ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py - PATHS - "CLANG_TOOLS_DIR" - "CMAKE_CURRENT_SOURCE_DIR" - "LIBDEVICE_SOURCE_DIR" - "LIBDEVICE_BINARY_DIR" - "LIBDEVICE_LIBRARY_DIR" - "LIBDEVICE_RUNTIME_DIR" - "LLVM_TOOLS_DIR" - ) - -add_custom_target(libdevice-test-depends DEPENDS ${LIBDEVICE_TEST_DEPENDS}) -set_target_properties(libdevice-test-depends PROPERTIES FOLDER "Tests") - -if(LLVM_BUILD_TOOLS AND - LLVM_HAS_LIBSYCLDEVICE) - set(exclude_from_check_all "") -else() - set(exclude_from_check_all "EXCLUDE_FROM_CHECK_ALL") -endif() - -add_lit_testsuite(check-libdevice "Running the libdevice regression tests" - ${CMAKE_CURRENT_BINARY_DIR} - ${exclude_from_check_all} - DEPENDS ${LIBDEVICE_TEST_DEPENDS} - ) -set_target_properties(check-libdevice PROPERTIES FOLDER "Tests") diff --git a/libdevice/test/check_cmath.txt b/libdevice/test/check_cmath.txt deleted file mode 100644 index 856dea8c0e772..0000000000000 --- a/libdevice/test/check_cmath.txt +++ /dev/null @@ -1,12 +0,0 @@ -REQUIRES: libsycldevice - -Check functions in fp32 libdevice spirv file. - -RUN: llvm-spirv --spirv-target-env=SPV-IR -r %libsycldevice_spv_dir/libsycl-cmath.spv -o %t.bc -RUN: llvm-dis %t.bc -o %t.ll -RUN: FileCheck %s --input-file %t.ll - -CHECK: target triple ={{.*}}spir64 - -CHECK-LABEL: define spir_func float @rintf( -CHECK: call spir_func float @_Z16__spirv_ocl_rintf( diff --git a/libdevice/test/check_fp64.txt b/libdevice/test/check_fp64.txt deleted file mode 100644 index 6148b2e862ba5..0000000000000 --- a/libdevice/test/check_fp64.txt +++ /dev/null @@ -1,18 +0,0 @@ -REQUIRES: libsycldevice - -Verify that the fallback functions in fp32 libdevice spirv file don't use fp64 type. - -RUN: llvm-spirv -r %libsycldevice_spv_dir/libsycl-fallback-cmath.spv -o %t1.bc -RUN: llvm-dis %t1.bc -o %t1.ll -RUN: FileCheck %s --input-file %t1.ll - -RUN: llvm-spirv -r %libsycldevice_spv_dir/libsycl-fallback-complex.spv -o %t2.bc -RUN: llvm-dis %t2.bc -o %t2.ll -RUN: FileCheck %s --input-file %t2.ll - -RUN: llvm-spirv -r %libsycldevice_spv_dir/libsycl-fallback-imf.spv -o %t3.bc -RUN: llvm-dis %t3.bc -o %t3.ll -RUN: FileCheck %s --input-file %t3.ll - -CHECK: target triple ={{.*}}spir64 -CHECK-NOT: double diff --git a/libdevice/test/lit.cfg.py b/libdevice/test/lit.cfg.py deleted file mode 100644 index c04f0cb2ff9fa..0000000000000 --- a/libdevice/test/lit.cfg.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- Python -*- - -# Configuration file for the 'lit' test runner. -import os -import sys - -import lit.util -import lit.formats -from lit.llvm import llvm_config -from lit.llvm.subst import FindTool -from lit.llvm.subst import ToolSubst - -# name: The name of this test suite. -config.name = 'libdevice' - -# suffixes: A list of file extensions to treat as test files. -config.suffixes = ['.txt'] - -# excludes: A list of directories to exclude from the testsuite. -config.excludes = ['CMakeLists.txt'] - -# test_source_root: The root path where tests are located. -config.test_source_root = os.path.dirname(__file__) - -# test_exec_root: The root path where tests should be run. -config.test_exec_root = os.path.join(config.libdevice_binary_dir, 'test') - -# testFormat: The test format to use to interpret tests. -config.test_format = lit.formats.ShTest() - -llvm_config.use_default_substitutions() - -tool_dirs = [config.clang_tools_dir, config.llvm_tools_dir] - -tools = [ - 'clang-offload-bundler', 'llvm-dis', 'llvm-spirv' -] - -llvm_config.add_tool_substitutions(tools, tool_dirs) - -if config.has_libsycldevice: - config.available_features.add("libsycldevice"); -config.substitutions.append( - ('%libsycldevice_obj_dir', config.libdevice_library_dir)) -if sys.platform in ['win32']: - config.substitutions.append( - ('%libsycldevice_spv_dir', config.libdevice_runtime_dir)) -else: - config.substitutions.append( - ('%libsycldevice_spv_dir', config.libdevice_library_dir)) diff --git a/libdevice/test/lit.site.cfg.py.in b/libdevice/test/lit.site.cfg.py.in deleted file mode 100644 index 7ced17959aaa2..0000000000000 --- a/libdevice/test/lit.site.cfg.py.in +++ /dev/null @@ -1,19 +0,0 @@ -@LIT_SITE_CFG_IN_HEADER@ -@AUTO_GEN_COMMENT@ - -config.llvm_tools_dir = path(r"@LLVM_TOOLS_DIR@") -config.clang_tools_dir = path(r"@CLANG_TOOLS_DIR@") -config.libdevice_src_dir = path(r"@LIBDEVICE_SOURCE_DIR@") -config.libdevice_binary_dir = path(r"@LIBDEVICE_BINARY_DIR@") -config.libdevice_library_dir = path(r"@LIBDEVICE_LIBRARY_DIR@") -config.libdevice_runtime_dir = path(r"@LIBDEVICE_RUNTIME_DIR@") -config.has_libsycldevice = "@LLVM_HAS_LIBSYCLDEVICE@" - -import sys - -import lit.llvm -lit.llvm.initialize(lit_config, config) - -# Let the main config do the real work. -lit_config.load_config( - config, os.path.join(path(r"@CMAKE_CURRENT_SOURCE_DIR@"), "lit.cfg.py")) diff --git a/libdevice/test/sycl_noinline.txt b/libdevice/test/sycl_noinline.txt deleted file mode 100644 index a0261ef5f8d1a..0000000000000 --- a/libdevice/test/sycl_noinline.txt +++ /dev/null @@ -1,74 +0,0 @@ -UNSUPPORTED: system-windows -REQUIRES: libsycldevice - -Verify that the wrapper functions and the fallback functions are not marked -with noinline attribute. - -RUN: llvm-spirv -r %libsycldevice_spv_dir/libsycl-fallback-cassert.spv -o %t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: llvm-spirv -r %libsycldevice_spv_dir/libsycl-fallback-cmath.spv -o %t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: llvm-spirv -r %libsycldevice_spv_dir/libsycl-fallback-cmath-fp64.spv -o %t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: llvm-spirv -r %libsycldevice_spv_dir/libsycl-fallback-complex.spv -o %t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: llvm-spirv -r %libsycldevice_spv_dir/libsycl-fallback-complex-fp64.spv -o %t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -input=%libsycldevice_obj_dir/libsycl-fallback-cassert.o -output=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -input=%libsycldevice_obj_dir/libsycl-fallback-cmath.o -output=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -input=%libsycldevice_obj_dir/libsycl-fallback-cmath-fp64.o -output=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -input=%libsycldevice_obj_dir/libsycl-fallback-complex.o -output=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -input=%libsycldevice_obj_dir/libsycl-fallback-complex-fp64.o -output=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -input=%libsycldevice_obj_dir/libsycl-crt.o -output=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -input=%libsycldevice_obj_dir/libsycl-cmath.o -output=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -input=%libsycldevice_obj_dir/libsycl-cmath-fp64.o -output=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -input=%libsycldevice_obj_dir/libsycl-complex.o -output=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -input=%libsycldevice_obj_dir/libsycl-complex-fp64.o -output=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -CHECK: target triple ={{.*}}spir64 -CHECK-NOT: ; Function Attrs:{{.*}}noinline -CHECK-NOT: attributes #{{[0-9]+}} ={{.*}}noinline diff --git a/libdevice/test/sycl_noinline_win.txt b/libdevice/test/sycl_noinline_win.txt deleted file mode 100644 index 01efbfaddae15..0000000000000 --- a/libdevice/test/sycl_noinline_win.txt +++ /dev/null @@ -1,74 +0,0 @@ -REQUIRES: system-windows -REQUIRES: libsycldevice - -Verify that the wrapper functions and the fallback functions are not marked -with noinline attribute. - -RUN: llvm-spirv -r %libsycldevice_spv_dir/libsycl-fallback-cassert.spv -o %t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: llvm-spirv -r %libsycldevice_spv_dir/libsycl-fallback-cmath.spv -o %t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: llvm-spirv -r %libsycldevice_spv_dir/libsycl-fallback-cmath-fp64.spv -o %t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: llvm-spirv -r %libsycldevice_spv_dir/libsycl-fallback-complex.spv -o %t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: llvm-spirv -r %libsycldevice_spv_dir/libsycl-fallback-complex-fp64.spv -o %t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -inputs=%libsycldevice_obj_dir/libsycl-fallback-cassert.obj -outputs=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -inputs=%libsycldevice_obj_dir/libsycl-fallback-cmath.obj -outputs=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -inputs=%libsycldevice_obj_dir/libsycl-fallback-cmath-fp64.obj -outputs=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -inputs=%libsycldevice_obj_dir/libsycl-fallback-complex.obj -outputs=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -inputs=%libsycldevice_obj_dir/libsycl-fallback-complex-fp64.obj -outputs=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -inputs=%libsycldevice_obj_dir/libsycl-crt.obj -outputs=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -inputs=%libsycldevice_obj_dir/libsycl-cmath.obj -outputs=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -inputs=%libsycldevice_obj_dir/libsycl-cmath-fp64.obj -outputs=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -inputs=%libsycldevice_obj_dir/libsycl-complex.obj -outputs=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -RUN: clang-offload-bundler -type=o -unbundle \ -RUN: -targets=sycl-spir64-unknown-unknown \ -RUN: -inputs=%libsycldevice_obj_dir/libsycl-complex-fp64.obj -outputs=%t.bc -RUN: llvm-dis %t.bc -o - | FileCheck %s - -CHECK: target triple ={{.*}}spir64 -CHECK-NOT: ; Function Attrs:{{.*}}noinline -CHECK-NOT: attributes #{{[0-9]+}} ={{.*}}noinline