Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
3 changes: 2 additions & 1 deletion srock-bin/srock_common_vars
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
18 changes: 18 additions & 0 deletions test/smoke-fort-dev/device_intrinsics_map/Makefile
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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