From c0d6f388fed4aa3601e68926b910f5d8d7348ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=A8=8B=E5=BA=8F=E5=91=98?= <141799511+wangxin0321@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:24:42 +0800 Subject: [PATCH 01/15] Update CMakeLists.txt --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 660ea00593..15cfbe4905 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,6 +241,12 @@ include(TestSuite) include(SingleMultiSource) # Needs by External/sollve_vv. find_package(OpenMP) +# Needs by External/OpenACC_VV +if(${CMAKE_VERSION} VERSION_LESS 3.25) + message(STATUS "The cmake version must be at least 3.25 to perform OpenACC tests") +else() + find_package(OpenACC) +endif() # Fortran Helper Modules if(TEST_SUITE_FORTRAN) include(Fortran) From 2c7ac968ab68caadf5a55d71aa8a24496bc18b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=A8=8B=E5=BA=8F=E5=91=98?= <141799511+wangxin0321@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:25:35 +0800 Subject: [PATCH 02/15] Update CMakeLists.txt --- External/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/External/CMakeLists.txt b/External/CMakeLists.txt index 70e5376256..38726220db 100644 --- a/External/CMakeLists.txt +++ b/External/CMakeLists.txt @@ -6,3 +6,4 @@ add_subdirectory(Povray) add_subdirectory(SPEC) add_subdirectory(skidmarks10) add_subdirectory(sollve_vv) +add_subdirectory(OpenACC_VV) From e44459bbbd91fce82fa76577b1da4dadb85526cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=A8=8B=E5=BA=8F=E5=91=98?= <141799511+wangxin0321@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:26:13 +0800 Subject: [PATCH 03/15] Create OpenACC_VV --- External/OpenACC_VV | 1 + 1 file changed, 1 insertion(+) create mode 100644 External/OpenACC_VV diff --git a/External/OpenACC_VV b/External/OpenACC_VV new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/External/OpenACC_VV @@ -0,0 +1 @@ + From 1dee0222b941d8c16b31ed692b63b8ae3a745ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=A8=8B=E5=BA=8F=E5=91=98?= <141799511+wangxin0321@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:29:26 +0800 Subject: [PATCH 04/15] Delete External/OpenACC_VV --- External/OpenACC_VV | 1 - 1 file changed, 1 deletion(-) delete mode 100644 External/OpenACC_VV diff --git a/External/OpenACC_VV b/External/OpenACC_VV deleted file mode 100644 index 8b13789179..0000000000 --- a/External/OpenACC_VV +++ /dev/null @@ -1 +0,0 @@ - From 890de0f409e94f6ea0d63bbc401cb0d164b3c122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=A8=8B=E5=BA=8F=E5=91=98?= <141799511+wangxin0321@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:31:04 +0800 Subject: [PATCH 05/15] Create OpenACC_VV --- External/OpenACC_VV | 1 + 1 file changed, 1 insertion(+) create mode 100644 External/OpenACC_VV diff --git a/External/OpenACC_VV b/External/OpenACC_VV new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/External/OpenACC_VV @@ -0,0 +1 @@ + From 974b5c53a06c0946ed36afa93bd8c384ebbb2bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=A8=8B=E5=BA=8F=E5=91=98?= <141799511+wangxin0321@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:31:49 +0800 Subject: [PATCH 06/15] Delete External/OpenACC_VV --- External/OpenACC_VV | 1 - 1 file changed, 1 deletion(-) delete mode 100644 External/OpenACC_VV diff --git a/External/OpenACC_VV b/External/OpenACC_VV deleted file mode 100644 index 8b13789179..0000000000 --- a/External/OpenACC_VV +++ /dev/null @@ -1 +0,0 @@ - From b07cd4b51250bbe01cef0d22699bc76575d4ee43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=A8=8B=E5=BA=8F=E5=91=98?= <141799511+wangxin0321@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:34:38 +0800 Subject: [PATCH 07/15] Create README --- External/OpenACC_VV/README | 1 + 1 file changed, 1 insertion(+) create mode 100644 External/OpenACC_VV/README diff --git a/External/OpenACC_VV/README b/External/OpenACC_VV/README new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/External/OpenACC_VV/README @@ -0,0 +1 @@ + From f6f8afebe611ad4cfbff29c649131e4c65ab9d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=A8=8B=E5=BA=8F=E5=91=98?= <141799511+wangxin0321@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:36:34 +0800 Subject: [PATCH 08/15] Update README --- External/OpenACC_VV/README | 51 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/External/OpenACC_VV/README b/External/OpenACC_VV/README index 8b13789179..45a07068d0 100644 --- a/External/OpenACC_VV/README +++ b/External/OpenACC_VV/README @@ -1 +1,52 @@ +OpenACC Validation & Verification Suite +https://github.com/OpenACCUserGroup/OpenACCV-V +This directory contains a CMakeLists.txt for the OpenACC +Validation and Verification Suite so it can be built as part +of the LLVM test-suite. Its sources are not part of the test-suite but +have to be fetched separately from https://github.com/OpenACCUserGroup/OpenACCV-V + +The sources are expected either in ${TEST_SUITE_OpenACCVV_ROOT} or +where TEST_SUITE_OpenACCVV_ROOT is CMake configure variables. If none of +them are set, it will look into +${CMAKE_SOURCE_DIR}/Extern/External/OpenACC_vv where +CMAKE_SOURCE_DIR is the root directory of the test-suite sources. + +The CMakeLists.txt will search for all C 、C++ and Fortran source files of the +OpenACC V&V suite, compile and run them. That is, running llvm-lit +(or "make check") will require a compatible accelerator on the running +machine. + +OpenACC support is autodetected by CMake, but clang requires additional +flags to enable offloading. An example run is: + +$ cd /path/to/llvm-test-suit +$ mkdir build +$ cd build +$ cmake -GNinja -DTEST_SUITE_FORTRAN=ON \ + -DTEST_SUITE_BENCHMARKING_ONLY=OFF + -DTEST_SUITE_RUN_BENCHMARKS=ON + -DTEST_SUITE_COLLECT_STATS=OFF + -DTEST_SUITE_SUBDIRS="External/OpenACC_VV" + -DCMAKE_BUILD_TYPE=Release + -DTEST_SUITE_OpenACCVV_ROOT=/path/to/OpenACCV-V-master + -DTEST_SUITE_COLLECT_CODE_SIZE=OFF + -DTEST_SUITE_LIT=${HOME}/path/to/llvm-project/build/bin/llvm-lit + -DCMAKE_C_COMPILER=${HOME}/install/llvm/bin/clang + -DCMAKE_CXX_COMPILER=${HOME}/install/llvm/bin/clang++ + -DCMAKE_Fortran_COMPILER=${HOME}/install/llvm/bin/flang + -DTEST_SUITE_OpenACC_OFFLOADING_FLAGS="-fopenacc;-fopenmp-targets=amdgcn-amd-amdhsa;-Xopenmp-target=amdgcn-amd-amdhsa;-march=gfx906;" + -DTEST_SUITE_OpenACC_OFFLOADING_LDFLAGS="-fopenacc;-fopenmp-targets=amdgcn-amd-amdhsa;-Xopenmp-target=amdgcn-amd-amdhsa;-march=gfx906;" + ../ + +To make: +$ LD_LIBRARY_PATH=${HOME}/install/llvm-project/release/lib +$ ninja -k 0 check + +To run: +The test results are saved in the reule file +$ llvm-lit -svj1 --shuffle --xunit-xml-output=result-xunit.xml . + +Attention: + Because find_package(OpenACC) is used in this test case, attempting to execute this test case requires cmake version >= 3.25 + take a closer look at FindOpenACC in cmake:https://cmake.org/cmake/help/latest/module/FindOpenACC.html From bdbb340f6628c6bda48cc6c6a622a928fe148c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=A8=8B=E5=BA=8F=E5=91=98?= <141799511+wangxin0321@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:37:41 +0800 Subject: [PATCH 09/15] Create CMakeLists.txt --- External/OpenACC_VV/CMakeLists.txt | 66 ++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 External/OpenACC_VV/CMakeLists.txt diff --git a/External/OpenACC_VV/CMakeLists.txt b/External/OpenACC_VV/CMakeLists.txt new file mode 100644 index 0000000000..e54044bb8b --- /dev/null +++ b/External/OpenACC_VV/CMakeLists.txt @@ -0,0 +1,66 @@ +# OpenACCV&V Validation & Verification Suite +# https://github.com/OpenACCUserGroup/OpenACCV-V + +include(External) + +option(TEST_SUITE_FORCE_ALL "Execute all OpenACC V&V tests, even those known to be unsupported by Clang" OFF) + +set(TEST_SUITE_OpenACC_OFFLOADING_FLAGS --offload-arch=native CACHE STRING "Compiler arguments for OpenACC") +set(TEST_SUITE_OpenACC_OFFLOADING_LDFLAGS --offload-arch=native CACHE STRING "Linker arguments for OpenACC") + +function (add_OpenACC_vv LANG) + set(_includedir "${TEST_SUITE_OpenACCVV_ROOT}/" ) + if (NOT OpenACC_${LANG}_FOUND) + message(FATAL_ERROR "OpenACC for ${LANG} not found") + return () + endif () + if ("${LANG}" STREQUAL "C") + set(_langext ".c") + elseif ("${LANG}" STREQUAL "CXX") + set(_langext ".cpp") + elseif ("${LANG}" STREQUAL "Fortran") + set(_langext ".F90") + else () + message(FATAL_ERROR "Unsupported languge ${LANG}") + endif () + + file(GLOB_RECURSE _tests_sources RELATIVE "${TEST_SUITE_OpenACCVV_ROOT}/Tests" "${TEST_SUITE_OpenACCVV_ROOT}/Tests/*${_langext}" ) + foreach (_file IN LISTS _tests_sources) + get_filename_component(_ext "${_file}" EXT) + get_filename_component(_basename "${_file}" NAME_WE) + get_filename_component(_directory "${_file}" DIRECTORY) + string(REPLACE "." "" _ext "${_ext}") + set(_name "acctargetvv-${_basename}.${_ext}") + + llvm_test_run() + + llvm_test_executable(${_name} "${TEST_SUITE_OpenACCVV_ROOT}/Tests/${_file}") + target_include_directories(${_name} PRIVATE "${_includedir}") + target_link_libraries(${_name} PUBLIC OpenACC::OpenACC_${_lang} m) + + # Add -fopenacc to linker command line; for some reason this is not done by target_link_libraries. + target_link_options(${_name} PRIVATE ${OpenACC_${LANG}_FLAGS}) + + # CMake's find_package(OpenACC) currently does not not introspect flags necessary for offloading. + target_compile_options(${_name} PUBLIC ${TEST_SUITE_OpenACC_OFFLOADING_FLAGS}) + target_link_options(${_name} PUBLIC ${TEST_SUITE_OpenACC_OFFLOADING_LDFLAGS}) + endforeach () +endfunction () + + +llvm_externals_find(TEST_SUITE_OpenACCVV_ROOT "OpenACCV-V-master" "OpenACC Offloading Validation & Verification Suite") + +if(TEST_SUITE_OpenACCVV_ROOT AND NOT TEST_SUITE_BENCHMARKING_ONLY) + if(OpenACC_FOUND) + message(STATUS "Adding OpenACC Offloading Validiation & Verification") + else() + message(STATUS "NOT using OpenACC Validiation & Verification because OpenACC was not found") + return() + endif() + + foreach (_lang in C CXX Fortran) + if(CMAKE_${_lang}_COMPILER) + add_OpenACC_vv(${_lang}) + endif() + endforeach () +endif () From 0e85b3f0f9eb1c3db5d289bc0d0b57e92557076a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=A8=8B=E5=BA=8F=E5=91=98?= <141799511+wangxin0321@users.noreply.github.com> Date: Wed, 18 Oct 2023 17:25:06 +0800 Subject: [PATCH 10/15] Update README --- External/OpenACC_VV/README | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/External/OpenACC_VV/README b/External/OpenACC_VV/README index 45a07068d0..bcd854f27c 100644 --- a/External/OpenACC_VV/README +++ b/External/OpenACC_VV/README @@ -24,19 +24,19 @@ $ cd /path/to/llvm-test-suit $ mkdir build $ cd build $ cmake -GNinja -DTEST_SUITE_FORTRAN=ON \ - -DTEST_SUITE_BENCHMARKING_ONLY=OFF - -DTEST_SUITE_RUN_BENCHMARKS=ON - -DTEST_SUITE_COLLECT_STATS=OFF - -DTEST_SUITE_SUBDIRS="External/OpenACC_VV" - -DCMAKE_BUILD_TYPE=Release - -DTEST_SUITE_OpenACCVV_ROOT=/path/to/OpenACCV-V-master - -DTEST_SUITE_COLLECT_CODE_SIZE=OFF - -DTEST_SUITE_LIT=${HOME}/path/to/llvm-project/build/bin/llvm-lit - -DCMAKE_C_COMPILER=${HOME}/install/llvm/bin/clang - -DCMAKE_CXX_COMPILER=${HOME}/install/llvm/bin/clang++ - -DCMAKE_Fortran_COMPILER=${HOME}/install/llvm/bin/flang - -DTEST_SUITE_OpenACC_OFFLOADING_FLAGS="-fopenacc;-fopenmp-targets=amdgcn-amd-amdhsa;-Xopenmp-target=amdgcn-amd-amdhsa;-march=gfx906;" - -DTEST_SUITE_OpenACC_OFFLOADING_LDFLAGS="-fopenacc;-fopenmp-targets=amdgcn-amd-amdhsa;-Xopenmp-target=amdgcn-amd-amdhsa;-march=gfx906;" + -DTEST_SUITE_BENCHMARKING_ONLY=OFF \ + -DTEST_SUITE_RUN_BENCHMARKS=ON \ + -DTEST_SUITE_COLLECT_STATS=OFF \ + -DTEST_SUITE_SUBDIRS="External/OpenACC_VV" \ + -DCMAKE_BUILD_TYPE=Release \ + -DTEST_SUITE_OpenACCVV_ROOT=/path/to/OpenACCV-V-master \ + -DTEST_SUITE_COLLECT_CODE_SIZE=OFF \ + -DTEST_SUITE_LIT=${HOME}/path/to/llvm-project/build/bin/llvm-lit \ + -DCMAKE_C_COMPILER=${HOME}/install/llvm/bin/clang \ + -DCMAKE_CXX_COMPILER=${HOME}/install/llvm/bin/clang++ \ + -DCMAKE_Fortran_COMPILER=${HOME}/install/llvm/bin/flang \ + -DTEST_SUITE_OpenACC_OFFLOADING_FLAGS="-fopenacc;-lm;-foffload='-lm';" \ + -DTEST_SUITE_OpenACC_OFFLOADING_LDFLAGS="-fopenacc;-lm;-foffload='-lm';" \ ../ To make: From e0cb2632bcb036de99578335b297090ef4c1e44e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=A8=8B=E5=BA=8F=E5=91=98?= <141799511+wangxin0321@users.noreply.github.com> Date: Fri, 20 Oct 2023 11:47:16 +0800 Subject: [PATCH 11/15] Update README --- External/OpenACC_VV/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/External/OpenACC_VV/README b/External/OpenACC_VV/README index bcd854f27c..d524c2eb47 100644 --- a/External/OpenACC_VV/README +++ b/External/OpenACC_VV/README @@ -41,7 +41,7 @@ $ cmake -GNinja -DTEST_SUITE_FORTRAN=ON \ To make: $ LD_LIBRARY_PATH=${HOME}/install/llvm-project/release/lib -$ ninja -k 0 check +$ ninja check To run: The test results are saved in the reule file From 18c7e97da4db685160d3445f07f22493b90dfe65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=A8=8B=E5=BA=8F=E5=91=98?= <141799511+wangxin0321@users.noreply.github.com> Date: Fri, 20 Oct 2023 11:50:11 +0800 Subject: [PATCH 12/15] Update CMakeLists.txt --- CMakeLists.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 15cfbe4905..660ea00593 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,12 +241,6 @@ include(TestSuite) include(SingleMultiSource) # Needs by External/sollve_vv. find_package(OpenMP) -# Needs by External/OpenACC_VV -if(${CMAKE_VERSION} VERSION_LESS 3.25) - message(STATUS "The cmake version must be at least 3.25 to perform OpenACC tests") -else() - find_package(OpenACC) -endif() # Fortran Helper Modules if(TEST_SUITE_FORTRAN) include(Fortran) From a5cf0b18fdf4e4ca31ffbd202c0dc0b2efdb3ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=A8=8B=E5=BA=8F=E5=91=98?= <141799511+wangxin0321@users.noreply.github.com> Date: Fri, 20 Oct 2023 11:51:29 +0800 Subject: [PATCH 13/15] Update CMakeLists.txt --- External/OpenACC_VV/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/External/OpenACC_VV/CMakeLists.txt b/External/OpenACC_VV/CMakeLists.txt index e54044bb8b..9e54887b28 100644 --- a/External/OpenACC_VV/CMakeLists.txt +++ b/External/OpenACC_VV/CMakeLists.txt @@ -51,6 +51,11 @@ endfunction () llvm_externals_find(TEST_SUITE_OpenACCVV_ROOT "OpenACCV-V-master" "OpenACC Offloading Validation & Verification Suite") if(TEST_SUITE_OpenACCVV_ROOT AND NOT TEST_SUITE_BENCHMARKING_ONLY) + if(${CMAKE_VERSION} VERSION_LESS 3.25) + message(STATUS "The cmake version must be at least 3.25 to perform OpenACC tests") + else() + find_package(OpenACC) + endif() if(OpenACC_FOUND) message(STATUS "Adding OpenACC Offloading Validiation & Verification") else() From 458e8a9bbfb93b81f99c8702fadbc96cc0ef4299 Mon Sep 17 00:00:00 2001 From: wangxin Date: Tue, 21 Nov 2023 15:36:51 +0800 Subject: [PATCH 14/15] fix --- External/CMakeLists.txt | 2 +- External/{OpenACC_VV => OpenACCV_V}/CMakeLists.txt | 13 ++++++------- External/{OpenACC_VV => OpenACCV_V}/README | 8 ++++---- 3 files changed, 11 insertions(+), 12 deletions(-) rename External/{OpenACC_VV => OpenACCV_V}/CMakeLists.txt (77%) rename External/{OpenACC_VV => OpenACCV_V}/README (88%) diff --git a/External/CMakeLists.txt b/External/CMakeLists.txt index 38726220db..d01cb00747 100644 --- a/External/CMakeLists.txt +++ b/External/CMakeLists.txt @@ -6,4 +6,4 @@ add_subdirectory(Povray) add_subdirectory(SPEC) add_subdirectory(skidmarks10) add_subdirectory(sollve_vv) -add_subdirectory(OpenACC_VV) +add_subdirectory(OpenACCV_V) diff --git a/External/OpenACC_VV/CMakeLists.txt b/External/OpenACCV_V/CMakeLists.txt similarity index 77% rename from External/OpenACC_VV/CMakeLists.txt rename to External/OpenACCV_V/CMakeLists.txt index 9e54887b28..4cd1f0a01b 100644 --- a/External/OpenACC_VV/CMakeLists.txt +++ b/External/OpenACCV_V/CMakeLists.txt @@ -5,11 +5,10 @@ include(External) option(TEST_SUITE_FORCE_ALL "Execute all OpenACC V&V tests, even those known to be unsupported by Clang" OFF) -set(TEST_SUITE_OpenACC_OFFLOADING_FLAGS --offload-arch=native CACHE STRING "Compiler arguments for OpenACC") -set(TEST_SUITE_OpenACC_OFFLOADING_LDFLAGS --offload-arch=native CACHE STRING "Linker arguments for OpenACC") +set(TEST_SUITE_OFFLOADING_FLAGS --offload-arch=native CACHE STRING "Compiler arguments for offloading") +set(TEST_SUITE_OFFLOADING_LDFLAGS --offload-arch=native CACHE STRING "Linker arguments for offloading") function (add_OpenACC_vv LANG) - set(_includedir "${TEST_SUITE_OpenACCVV_ROOT}/" ) if (NOT OpenACC_${LANG}_FOUND) message(FATAL_ERROR "OpenACC for ${LANG} not found") return () @@ -35,20 +34,20 @@ function (add_OpenACC_vv LANG) llvm_test_run() llvm_test_executable(${_name} "${TEST_SUITE_OpenACCVV_ROOT}/Tests/${_file}") - target_include_directories(${_name} PRIVATE "${_includedir}") + target_link_libraries(${_name} PUBLIC OpenACC::OpenACC_${_lang} m) # Add -fopenacc to linker command line; for some reason this is not done by target_link_libraries. target_link_options(${_name} PRIVATE ${OpenACC_${LANG}_FLAGS}) # CMake's find_package(OpenACC) currently does not not introspect flags necessary for offloading. - target_compile_options(${_name} PUBLIC ${TEST_SUITE_OpenACC_OFFLOADING_FLAGS}) - target_link_options(${_name} PUBLIC ${TEST_SUITE_OpenACC_OFFLOADING_LDFLAGS}) + target_compile_options(${_name} PUBLIC ${TEST_SUITE_OFFLOADING_FLAGS}) + target_link_options(${_name} PUBLIC ${TEST_SUITE_OFFLOADING_LDFLAGS}) endforeach () endfunction () -llvm_externals_find(TEST_SUITE_OpenACCVV_ROOT "OpenACCV-V-master" "OpenACC Offloading Validation & Verification Suite") +llvm_externals_find(TEST_SUITE_OpenACCVV_ROOT "OpenACCV_V" "OpenACC Offloading Validation & Verification Suite") if(TEST_SUITE_OpenACCVV_ROOT AND NOT TEST_SUITE_BENCHMARKING_ONLY) if(${CMAKE_VERSION} VERSION_LESS 3.25) diff --git a/External/OpenACC_VV/README b/External/OpenACCV_V/README similarity index 88% rename from External/OpenACC_VV/README rename to External/OpenACCV_V/README index d524c2eb47..914d45ca65 100644 --- a/External/OpenACC_VV/README +++ b/External/OpenACCV_V/README @@ -27,16 +27,16 @@ $ cmake -GNinja -DTEST_SUITE_FORTRAN=ON \ -DTEST_SUITE_BENCHMARKING_ONLY=OFF \ -DTEST_SUITE_RUN_BENCHMARKS=ON \ -DTEST_SUITE_COLLECT_STATS=OFF \ - -DTEST_SUITE_SUBDIRS="External/OpenACC_VV" \ + -DTEST_SUITE_SUBDIRS="External/OpenACCV_V" \ -DCMAKE_BUILD_TYPE=Release \ - -DTEST_SUITE_OpenACCVV_ROOT=/path/to/OpenACCV-V-master \ + -DTEST_SUITE_OpenACCVV_ROOT=/path/to/OpenACCV_V \ -DTEST_SUITE_COLLECT_CODE_SIZE=OFF \ -DTEST_SUITE_LIT=${HOME}/path/to/llvm-project/build/bin/llvm-lit \ -DCMAKE_C_COMPILER=${HOME}/install/llvm/bin/clang \ -DCMAKE_CXX_COMPILER=${HOME}/install/llvm/bin/clang++ \ -DCMAKE_Fortran_COMPILER=${HOME}/install/llvm/bin/flang \ - -DTEST_SUITE_OpenACC_OFFLOADING_FLAGS="-fopenacc;-lm;-foffload='-lm';" \ - -DTEST_SUITE_OpenACC_OFFLOADING_LDFLAGS="-fopenacc;-lm;-foffload='-lm';" \ + -DTEST_SUITE_OFFLOADING_FLAGS="-fopenacc;-lm;-foffload='-lm';" \ + -DTEST_SUITE_OFFLOADING_LDFLAGS="-fopenacc;-lm;-foffload='-lm';" \ ../ To make: From 3da755694dd85b65e766b73a166e7a1f0ace5403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=A8=8B=E5=BA=8F=E5=91=98?= <141799511+wangxin0321@users.noreply.github.com> Date: Mon, 4 Dec 2023 20:20:34 +0800 Subject: [PATCH 15/15] Update CMakeLists.txt --- External/OpenACCV_V/CMakeLists.txt | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/External/OpenACCV_V/CMakeLists.txt b/External/OpenACCV_V/CMakeLists.txt index 4cd1f0a01b..5cc7b91ab2 100644 --- a/External/OpenACCV_V/CMakeLists.txt +++ b/External/OpenACCV_V/CMakeLists.txt @@ -9,10 +9,6 @@ set(TEST_SUITE_OFFLOADING_FLAGS --offload-arch=native CACHE STRING "Compiler arg set(TEST_SUITE_OFFLOADING_LDFLAGS --offload-arch=native CACHE STRING "Linker arguments for offloading") function (add_OpenACC_vv LANG) - if (NOT OpenACC_${LANG}_FOUND) - message(FATAL_ERROR "OpenACC for ${LANG} not found") - return () - endif () if ("${LANG}" STREQUAL "C") set(_langext ".c") elseif ("${LANG}" STREQUAL "CXX") @@ -35,31 +31,17 @@ function (add_OpenACC_vv LANG) llvm_test_executable(${_name} "${TEST_SUITE_OpenACCVV_ROOT}/Tests/${_file}") - target_link_libraries(${_name} PUBLIC OpenACC::OpenACC_${_lang} m) - - # Add -fopenacc to linker command line; for some reason this is not done by target_link_libraries. - target_link_options(${_name} PRIVATE ${OpenACC_${LANG}_FLAGS}) - # CMake's find_package(OpenACC) currently does not not introspect flags necessary for offloading. target_compile_options(${_name} PUBLIC ${TEST_SUITE_OFFLOADING_FLAGS}) target_link_options(${_name} PUBLIC ${TEST_SUITE_OFFLOADING_LDFLAGS}) endforeach () endfunction () - llvm_externals_find(TEST_SUITE_OpenACCVV_ROOT "OpenACCV_V" "OpenACC Offloading Validation & Verification Suite") if(TEST_SUITE_OpenACCVV_ROOT AND NOT TEST_SUITE_BENCHMARKING_ONLY) if(${CMAKE_VERSION} VERSION_LESS 3.25) message(STATUS "The cmake version must be at least 3.25 to perform OpenACC tests") - else() - find_package(OpenACC) - endif() - if(OpenACC_FOUND) - message(STATUS "Adding OpenACC Offloading Validiation & Verification") - else() - message(STATUS "NOT using OpenACC Validiation & Verification because OpenACC was not found") - return() endif() foreach (_lang in C CXX Fortran)