diff --git a/srock-bin/patches/amd-staging/_TheRock_00_compiler-srock.patch b/srock-bin/patches/amd-staging/_TheRock_00_compiler-srock.patch index d2c849e15..c19c95e65 100644 --- a/srock-bin/patches/amd-staging/_TheRock_00_compiler-srock.patch +++ b/srock-bin/patches/amd-staging/_TheRock_00_compiler-srock.patch @@ -1,10 +1,10 @@ diff --git a/compiler/CMakeLists.txt b/compiler/CMakeLists.txt -index bf625919..cdc6c493 100644 +index 7279cdbb3..103eb2332 100644 --- a/compiler/CMakeLists.txt +++ b/compiler/CMakeLists.txt -@@ -13,6 +13,10 @@ if(THEROCK_ENABLE_COMPILER) - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - list(APPEND _extra_llvm_cmake_args "-DLLVM_ENABLE_PEDANTIC=OFF") +@@ -22,6 +22,10 @@ if(THEROCK_ENABLE_COMPILER) + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + list(APPEND _extra_llvm_cmake_args "-DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON") endif() + if (DEFINED ENV{SROCK_VERSION_MOD}) + list(APPEND _extra_llvm_cmake_args "-DLLVM_VERSION_SUFFIX=_SROCK") diff --git a/srock-bin/srock_common_vars b/srock-bin/srock_common_vars index c5b97072f..b17f4048b 100644 --- a/srock-bin/srock_common_vars +++ b/srock-bin/srock_common_vars @@ -84,7 +84,8 @@ SROCK_MAJOR_VERSION=${SROCK_VERSION%.*} # Set SROCK_COMPILER_BRANCH to develop to get a native TheRock build SROCK_COMPILER_BRANCH=${SROCK_COMPILER_BRANCH:-amd-staging} -SROCK_THEROCK_BRANCH=${SROCK_THEROCK_BRANCH:-compiler/amd-staging} +#SROCK_THEROCK_BRANCH=${SROCK_THEROCK_BRANCH:-compiler/amd-staging} +SROCK_THEROCK_BRANCH=${SROCK_THEROCK_BRANCH:-main} SROCK_CONFIG=${SROCK_CONFIG:-minimal} # Set default value for ROCm install directory SROCK_INSTALL_DIR. diff --git a/test/smoke-fort-dev/device_intrinsics_map/Makefile b/test/smoke-fort-dev/device_intrinsics_map/Makefile new file mode 100644 index 000000000..baf06b793 --- /dev/null +++ b/test/smoke-fort-dev/device_intrinsics_map/Makefile @@ -0,0 +1,18 @@ +#NOOPT = 1 +#NOOMP = 1 +#OMP_FLAGS = -fopenmp +include ../../Makefile.defs + +TESTNAME = device_intrinsics_map +TESTSRC_MAIN = device_intrinsics_map.f90 +TESTSRC_AUX = +TESTSRC_ALL = $(TESTSRC_MAIN) $(TESTSRC_AUX) + +FLANG ?= flang +OMP_BIN = $(AOMP)/bin/$(FLANG) +CC = $(OMP_BIN) $(VERBOSE) +CFLAGS = $(FLANG_GPU_LINK_FLAGS) +#-ccc-print-phases +#"-\#\#\#" + +include ../Makefile.rules diff --git a/test/smoke-fort-dev/device_intrinsics_map/device_intrinsics_map.f90 b/test/smoke-fort-dev/device_intrinsics_map/device_intrinsics_map.f90 new file mode 100644 index 000000000..61c494744 --- /dev/null +++ b/test/smoke-fort-dev/device_intrinsics_map/device_intrinsics_map.f90 @@ -0,0 +1,48 @@ +! +!Copyright © Advanced Micro Devices, Inc., or its affiliates. +! +!SPDX-License-Identifier: MIT +! +module mod + implicit none +contains + subroutine assgn(a, ma, mi, ms) + implicit none + real, dimension(:), allocatable :: a + real :: ma, mi, ms + !$omp target map(tofrom: a,ma,mi,ms) + ma = maxval(a) + mi = minval(a) + ms = sum(a) + !$omp end target + end subroutine assgn +end module mod + +program device_intrinsics + use mod + implicit none + + integer, parameter :: n = 1024 + integer :: i + real, dimension(:), allocatable :: a + real, dimension(:), allocatable :: b + real :: ma, mi, ms + + allocate(a(n)) + allocate(b(n)) + + a = [( real(i),i=1,n )] + b = [( real(i),i=1,n )] + + !$omp target enter data map(to:a) map(alloc:ma,mi,ms) + call assgn(a, ma, mi, ms) + !$omp target exit data map(delete:a) map(from:ma,mi,ms) + + if (mi /= minval(b) .or. ma /= maxval(b) .or. ms /= sum(b)) then + print '(a)', 'ERROR' + stop 1 + end if + print '(a)', 'SUCCESS' + + deallocate(a) +end program device_intrinsics