Skip to content

Commit b11d4c7

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents f2a5d38 + dbfbae8 commit b11d4c7

File tree

403 files changed

+31780
-23762
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

403 files changed

+31780
-23762
lines changed

External/HIP/CMakeLists.txt

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
include(ExternalProject)
2+
13
include(External)
24
include(GPUTestVariant)
35
llvm_externals_find(TEST_SUITE_HIP_ROOT "hip" "HIP prerequisites")
@@ -121,6 +123,67 @@ macro(create_hip_tests)
121123
create_hip_test(${_HIP_Suffix})
122124
endforeach()
123125

126+
if (EXTERNAL_HIP_TESTS_KOKKOS)
127+
set(EXTERNAL_HIP_TESTS_KOKKOS_TAG "4.5.01" CACHE STRING "Kokkos tag to download and test")
128+
ExternalProject_Add(TestKokkosHIP
129+
GIT_REPOSITORY https://github.com/kokkos/kokkos.git
130+
GIT_TAG ${EXTERNAL_HIP_TESTS_KOKKOS_TAG}
131+
CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release
132+
-DCMAKE_CXX_STANDARD=17
133+
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
134+
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
135+
-DKokkos_ENABLE_HIP=ON
136+
-DKokkos_ARCH_AMD_GFX90A=ON
137+
-DCMAKE_PREFIX_PATH=/opt/rocm
138+
-DKokkos_ENABLE_TESTS=ON
139+
INSTALL_COMMAND ""
140+
TEST_COMMAND ""
141+
)
142+
add_custom_target(build-kokkos DEPENDS TestKokkosHIP)
143+
ExternalProject_Get_Property(TestKokkosHIP BINARY_DIR)
144+
add_custom_target(test-kokkos ${CMAKE_COMMAND} -E env GTEST_FILTER=-hip.atomics:hip.bit_manip_bit_ceil "ctest" WORKING_DIRECTORY "${BINARY_DIR}" DEPENDS build-kokkos)
145+
endif()
146+
147+
if (EXTERNAL_HIP_TESTS_GINKGO)
148+
set(EXTERNAL_HIP_TESTS_GINKGO_TAG "v1.9.0" CACHE STRING "Ginkgo tag to download and test")
149+
ExternalProject_Add(TestGinkgoHIP
150+
GIT_REPOSITORY https://github.com/ginkgo-project/ginkgo.git
151+
GIT_TAG ${EXTERNAL_HIP_TESTS_GINKGO_TAG}
152+
CMAKE_ARGS -DGINKGO_BUILD_HIP=ON
153+
-DCMAKE_PREFIX_PATH=/opt/rocm
154+
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
155+
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
156+
-DGINKGO_BUILD_MPI=OFF
157+
-DCMAKE_HIP_COMPILER=${CMAKE_CXX_COMPILER}
158+
-DGINKGO_WITH_CCACHE=OFF
159+
-DGINKGO_BUILD_EXAMPLES=OFF
160+
INSTALL_COMMAND ""
161+
TEST_COMMAND ""
162+
)
163+
164+
add_custom_target(build-ginkgo DEPENDS TestGinkgoHIP)
165+
ExternalProject_Get_Property(TestGinkgoHIP BINARY_DIR)
166+
add_custom_target(test-ginkgo COMMAND "ctest" "-R hip" WORKING_DIRECTORY "${BINARY_DIR}" DEPENDS build-ginkgo)
167+
endif()
168+
169+
if (EXTERNAL_HIP_TESTS_ROCPRIM)
170+
ExternalProject_Add(BuildRocPrim
171+
GIT_REPOSITORY https://github.com/ROCm/rocPRIM.git
172+
GIT_TAG ae4d27e # Staging for ROCm 6.4
173+
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
174+
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
175+
-DCMAKE_HIP_COMPILER=${CMAKE_CXX_COMPILER}
176+
-DBUILD_TEST=ON
177+
-DAMDGPU_TARGETS="${AMDGPU_ARCHS}"
178+
-DCMAKE_BUILD_TYPE=Release
179+
INSTALL_COMMAND ""
180+
TEST_COMMAND ""
181+
)
182+
183+
add_custom_target(build-rocprim DEPENDS BuildRocPrim)
184+
185+
endif()
186+
124187
add_custom_target(hip-tests-all DEPENDS hip-tests-simple
125188
COMMENT "Build all HIP tests.")
126189

External/HIP/workload/blender/test_blender.sh.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,20 @@ render() {
6363
echo "Render $input"
6464

6565
blender_output=$(mktemp)
66-
timeout 300 $blender_dir/blender -b $input -F PNG -o ${output}### -f $frame $blender_options 2>&1 | tee $blender_output
66+
timeout 600 $blender_dir/blender -b $input -F PNG -o ${output}### -f $frame $blender_options 2>&1 | tee $blender_output
6767
blender_return_code=${PIPESTATUS[0]}
6868

6969
average_time=$(grep -P "^\s*Path Tracing\s+\d+\.\d+\s+\d+\.\d+" $blender_output | awk '{print $4}')
7070

7171
log_kernel_compilation_time $blender_output
7272

7373
compare_output=$(mktemp)
74-
timeout 300 python3 compare_image.py --image $scene_dir/out/${out_file_full} --ref $scene_dir/ref/${out_file_full} 2>&1 | tee $compare_output
74+
timeout 600 python3 compare_image.py --image $scene_dir/out/${out_file_full} --ref $scene_dir/ref/${out_file_full} 2>&1 | tee $compare_output
7575
compare_return_code=${PIPESTATUS[0]}
7676

7777
ssim=$(grep "SSIM Index:" $compare_output | awk '{print $3}')
7878
mse=$(grep "MSE Value:" $compare_output | awk '{print $3}')
79-
79+
8080
previous_average=""
8181
percentage_difference=""
8282
perf_regress=0

External/ffmpeg/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
include(External)
22

33
# In llvm-test-suite/test-suite-externals:
4-
# git clone -b release/7.1 https://git.ffmpeg.org/ffmpeg.git
5-
# cd ffmpeg
6-
# git checkout 10aaf84f855dbcedb8ee2e3fce307e9b98320946
4+
# git clone -b n7.1.1 https://git.ffmpeg.org/ffmpeg.git
75

86
llvm_externals_find(TEST_SUITE_FFMPEG_ROOT "ffmpeg" "ffmpeg 7.1")
97

External/ffmpeg/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,10 @@ This integration of ffmpeg into llvm-test-suite works with ffmpeg 7.1
1212
7.1 release tag).
1313

1414
To include the ffmpeg library in llvm-test-suite, run
15-
`git clone -b release/7.1 https://git.ffmpeg.org/ffmpeg.git`
15+
`git clone -b n7.1.1 https://git.ffmpeg.org/ffmpeg.git`
1616
within the `llvm-test-suite/test-suite-externals` directory, or
1717
set `TEST_SUITE_FFMPEG_ROOT` to point to a similar checkout, in the
18-
CMake configuration. (As this is a branch, not a tag, you may wish
19-
to check out e.g. the commit
20-
`10aaf84f855dbcedb8ee2e3fce307e9b98320946`, in case the branch
21-
changes further.)
18+
CMake configuration.
2219

2320
For x86 targets, the `nasm` tool is used for building assembly, if
2421
the tool is found at configure time. If not found, the assembly is

Fortran/UnitTests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ add_subdirectory(assign-goto)
44
add_subdirectory(execute_command_line)
55
add_subdirectory(fcvs21_f95) # NIST Fortran Compiler Validation Suite
66
add_subdirectory(finalization)
7+
add_subdirectory(fp_conversions)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
include(CheckFortranSourceCompiles)
2+
3+
CHECK_FORTRAN_SOURCE_COMPILES("
4+
real(kind=16)::r
5+
integer(kind=16)::i
6+
end
7+
" FORTRAN_HAS_R16)
8+
9+
list(APPEND FFLAGS -funsigned)
10+
11+
if(FORTRAN_HAS_R16)
12+
message(STATUS "Fortran compiler supports real(kind=16)")
13+
set(Source fp_convert_r16.f90)
14+
llvm_singlesource()
15+
else()
16+
message(STATUS "Fortran compiler does not support real(kind=16)")
17+
endif()
18+
19+
set(Source fp_convert.f90)
20+
llvm_singlesource()
21+
file(COPY lit.local.cfg DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
module fp_convert_m
2+
implicit none
3+
type answer
4+
integer(kind=1) :: i8
5+
integer(kind=2) :: i16
6+
integer(kind=4) :: i32
7+
integer(kind=8) :: i64
8+
unsigned(kind=1) :: u8
9+
unsigned(kind=2) :: u16
10+
unsigned(kind=4) :: u32
11+
unsigned(kind=8) :: u64
12+
end type answer
13+
14+
contains
15+
subroutine print_answer(a)
16+
type(answer), intent(in) :: a
17+
print *, a%i8
18+
print *, a%i16
19+
print *, a%i32
20+
print *, a%i64
21+
print *, a%u8
22+
print *, a%u16
23+
print *, a%u32
24+
print *, a%u64
25+
end subroutine print_answer
26+
27+
function do_conversion(value) result(result)
28+
real(kind=8), intent(in) :: value
29+
type(answer) :: result
30+
result%i8 = int(value, kind=1)
31+
result%i16 = int(value, kind=2)
32+
result%i32 = int(value, kind=4)
33+
result%i64 = int(value, kind=8)
34+
35+
result%u8 = uint(value, kind=1)
36+
result%u16 = uint(value, kind=2)
37+
result%u32 = uint(value, kind=4)
38+
result%u64 = uint(value, kind=8)
39+
end function do_conversion
40+
41+
subroutine testcase(value)
42+
real(kind=8), intent(in) :: value
43+
type(answer) :: result
44+
result = do_conversion(value)
45+
call print_answer(result)
46+
end subroutine testcase
47+
end module fp_convert_m
48+
49+
program fp_convert
50+
use ieee_arithmetic, only: ieee_value, ieee_quiet_nan, ieee_positive_inf, ieee_negative_inf
51+
use fp_convert_m
52+
implicit none
53+
54+
real(kind=8) :: r64, nan, inf, ninf
55+
56+
nan = ieee_value(nan, ieee_quiet_nan)
57+
inf = ieee_value(inf, ieee_positive_inf)
58+
ninf = ieee_value(ninf, ieee_negative_inf)
59+
60+
print *, "huge"
61+
call testcase(huge(r64))
62+
63+
print *, "-huge"
64+
call testcase(-huge(r64))
65+
66+
print *, "tiny"
67+
call testcase(tiny(r64))
68+
69+
print *, "-tiny"
70+
call testcase(-tiny(r64))
71+
72+
print *, "inf"
73+
call testcase(inf)
74+
75+
print *, "-inf"
76+
call testcase(ninf)
77+
78+
print *, "nan"
79+
call testcase(nan)
80+
81+
end program fp_convert
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
huge
2+
127
3+
32767
4+
2147483647
5+
9223372036854775807
6+
255
7+
65535
8+
4294967295
9+
18446744073709551615
10+
-huge
11+
-128
12+
-32768
13+
-2147483648
14+
-9223372036854775808
15+
0
16+
0
17+
0
18+
0
19+
tiny
20+
0
21+
0
22+
0
23+
0
24+
0
25+
0
26+
0
27+
0
28+
-tiny
29+
0
30+
0
31+
0
32+
0
33+
0
34+
0
35+
0
36+
0
37+
inf
38+
127
39+
32767
40+
2147483647
41+
9223372036854775807
42+
255
43+
65535
44+
4294967295
45+
18446744073709551615
46+
-inf
47+
-128
48+
-32768
49+
-2147483648
50+
-9223372036854775808
51+
0
52+
0
53+
0
54+
0
55+
nan
56+
0
57+
0
58+
0
59+
0
60+
0
61+
0
62+
0
63+
0
64+
exit 0
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
module fp_convert_r16_m
2+
implicit none
3+
type answer
4+
integer(kind=1) :: i8
5+
integer(kind=2) :: i16
6+
integer(kind=4) :: i32
7+
integer(kind=8) :: i64
8+
integer(kind=16) :: i128
9+
unsigned(kind=1) :: u8
10+
unsigned(kind=2) :: u16
11+
unsigned(kind=4) :: u32
12+
unsigned(kind=8) :: u64
13+
unsigned(kind=16) :: u128
14+
end type answer
15+
contains
16+
17+
subroutine print_answer(a)
18+
type(answer), intent(in) :: a
19+
print *, a%i8
20+
print *, a%i16
21+
print *, a%i32
22+
print *, a%i64
23+
print *, a%i128
24+
print *, a%u8
25+
print *, a%u16
26+
print *, a%u32
27+
print *, a%u64
28+
print *, a%u128
29+
end subroutine print_answer
30+
31+
function do_conversion(value) result(result)
32+
real(kind=16), intent(in) :: value
33+
type(answer) :: result
34+
result%i8 = int(value, kind=1)
35+
result%i16 = int(value, kind=2)
36+
result%i32 = int(value, kind=4)
37+
result%i64 = int(value, kind=8)
38+
result%i128 = int(value, kind=16)
39+
result%u8 = uint(value, kind=1)
40+
result%u16 = uint(value, kind=2)
41+
result%u32 = uint(value, kind=4)
42+
result%u64 = uint(value, kind=8)
43+
result%u128 = uint(value, kind=16)
44+
end function do_conversion
45+
46+
subroutine testcase(value)
47+
real(kind=16), intent(in) :: value
48+
type(answer) :: result
49+
result = do_conversion(value)
50+
call print_answer(result)
51+
end subroutine
52+
end module fp_convert_r16_m
53+
54+
program fp_convert_r16
55+
use ieee_arithmetic, only: ieee_value, ieee_quiet_nan, ieee_positive_inf, ieee_negative_inf
56+
use fp_convert_r16_m
57+
implicit none
58+
59+
real(kind=16) :: r128, nan, inf, ninf
60+
61+
nan = ieee_value(nan, ieee_quiet_nan)
62+
inf = ieee_value(inf, ieee_positive_inf)
63+
ninf = ieee_value(ninf, ieee_negative_inf)
64+
65+
print *, "huge"
66+
call testcase(huge(r128))
67+
68+
print *, "-huge"
69+
call testcase(-huge(r128))
70+
71+
print *, "tiny"
72+
call testcase(tiny(r128))
73+
74+
print *, "-tiny"
75+
call testcase(-tiny(r128))
76+
77+
print *, "inf"
78+
call testcase(inf)
79+
80+
print *, "-inf"
81+
call testcase(ninf)
82+
83+
print *, "nan"
84+
call testcase(nan)
85+
86+
end program fp_convert_r16

0 commit comments

Comments
 (0)