[test-suite] r261816 - cmake/lit: Add SPEC CPU2006 floating point benchmarks
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 24 17:59:02 PST 2016
Author: matze
Date: Wed Feb 24 19:59:02 2016
New Revision: 261816
URL: http://llvm.org/viewvc/llvm-project?rev=261816&view=rev
Log:
cmake/lit: Add SPEC CPU2006 floating point benchmarks
This does not include the fortran benchmarks.
Added:
test-suite/trunk/External/SPEC/CFP2006/433.milc/CMakeLists.txt
test-suite/trunk/External/SPEC/CFP2006/444.namd/CMakeLists.txt
test-suite/trunk/External/SPEC/CFP2006/447.dealII/CMakeLists.txt
test-suite/trunk/External/SPEC/CFP2006/450.soplex/CMakeLists.txt
test-suite/trunk/External/SPEC/CFP2006/453.povray/CMakeLists.txt
test-suite/trunk/External/SPEC/CFP2006/470.lbm/CMakeLists.txt
test-suite/trunk/External/SPEC/CFP2006/482.sphinx3/CMakeLists.txt
test-suite/trunk/External/SPEC/CFP2006/CMakeLists.txt
Modified:
test-suite/trunk/External/SPEC/CMakeLists.txt
test-suite/trunk/cmake/modules/CopyDir.cmake
Added: test-suite/trunk/External/SPEC/CFP2006/433.milc/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CFP2006/433.milc/CMakeLists.txt?rev=261816&view=auto
==============================================================================
--- test-suite/trunk/External/SPEC/CFP2006/433.milc/CMakeLists.txt (added)
+++ test-suite/trunk/External/SPEC/CFP2006/433.milc/CMakeLists.txt Wed Feb 24 19:59:02 2016
@@ -0,0 +1,20 @@
+include_directories(${BENCHMARK_DIR}/src)
+add_definitions(-DFN -DFAST -DCONGRAD_TMP_VECTORS -DDSLASH_TMP_LINKS)
+
+macro(test_input run_type)
+ llvm_test_run(RUN_TYPE ${run_type}
+ < ${BENCHMARK_DIR}/data/${run_type}/input/su3imp.in
+ > ${CMAKE_CURRENT_BINARY_DIR}/su3imp.out
+ )
+ llvm_test_verify(RUN_TYPE ${run_type} ${FPCMP}
+ -r 0.0001 -a 0.0000002
+ ${BENCHMARK_DIR}/data/${run_type}/output/su3imp.out
+ ${CMAKE_CURRENT_BINARY_DIR}/su3imp.out
+ )
+endmacro()
+
+test_input(test)
+test_input(train)
+test_input(ref)
+
+llvm_multisource()
Added: test-suite/trunk/External/SPEC/CFP2006/444.namd/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CFP2006/444.namd/CMakeLists.txt?rev=261816&view=auto
==============================================================================
--- test-suite/trunk/External/SPEC/CFP2006/444.namd/CMakeLists.txt (added)
+++ test-suite/trunk/External/SPEC/CFP2006/444.namd/CMakeLists.txt Wed Feb 24 19:59:02 2016
@@ -0,0 +1,37 @@
+set(SourceNames
+ Compute.C
+ ComputeList.C
+ ComputeNonbondedUtil.C
+ LJTable.C
+ Molecule.C
+ Patch.C
+ PatchList.C
+ ResultSet.C
+ SimParameters.C
+ erf.C
+ spec_namd.C
+)
+set(Source "")
+foreach(FILENAME ${SourceNames})
+ list(APPEND Source ${BENCHMARK_DIR}/src/${FILENAME})
+endforeach()
+
+macro(test_input run_type iters)
+ llvm_test_run(RUN_TYPE ${run_type}
+ --input ${BENCHMARK_DIR}/data/all/input/namd.input
+ --iterations ${iters}
+ --output ${CMAKE_CURRENT_BINARY_DIR}/namd.out
+ > ${CMAKE_CURRENT_BINARY_DIR}/namd.stdout
+ )
+ llvm_test_verify(RUN_TYPE ${run_type} ${FPCMP}
+ -a 0.00001
+ ${BENCHMARK_DIR}/data/${run_type}/output/namd.out
+ ${CMAKE_CURRENT_BINARY_DIR}/namd.out
+ )
+endmacro()
+
+test_input(test 1)
+test_input(train 1)
+test_input(ref 38)
+
+llvm_multisource()
Added: test-suite/trunk/External/SPEC/CFP2006/447.dealII/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CFP2006/447.dealII/CMakeLists.txt?rev=261816&view=auto
==============================================================================
--- test-suite/trunk/External/SPEC/CFP2006/447.dealII/CMakeLists.txt (added)
+++ test-suite/trunk/External/SPEC/CFP2006/447.dealII/CMakeLists.txt Wed Feb 24 19:59:02 2016
@@ -0,0 +1,42 @@
+include_directories(${BENCHMARK_DIR}/src/include)
+add_definitions(-DBOOST_DISABLE_THREADS -Ddeal_II_dimension=3)
+list(APPEND CXXFLAGS -stdlib=libstdc++)
+list(APPEND LDFLAGS -stdlib=libstdc++ -lm)
+
+macro(verify_n run_type dir n)
+ llvm_test_verify(RUN_TYPE ${run_type} ${FPCMP}
+ -a .0000001
+ ${BENCHMARK_DIR}/data/${dir}/output/grid-${n}.eps
+ ${CMAKE_CURRENT_BINARY_DIR}/grid-${n}.eps
+ )
+ llvm_test_verify(RUN_TYPE ${run_type} ${FPCMP}
+ -a .0000001
+ ${BENCHMARK_DIR}/data/${dir}/output/solution-${n}.gmv
+ ${CMAKE_CURRENT_BINARY_DIR}/solution-${n}.gmv
+ )
+endmacro()
+
+macro(test_input run_type size)
+ llvm_test_run(RUN_TYPE ${run_type}
+ ${size}
+ > ${CMAKE_CURRENT_BINARY_DIR}/log
+ )
+ llvm_test_verify(RUN_TYPE ${run_type} ${FPCMP}
+ ${BENCHMARK_DIR}/data/${run_type}/output/log
+ ${CMAKE_CURRENT_BINARY_DIR}/log
+ )
+ foreach(i RANGE 0 8)
+ verify_n(${run_type} all ${i})
+ endforeach()
+ if (${size} GREATER 8)
+ foreach(i RANGE 9 ${size})
+ verify_n(${run_type} ${run_type} ${i})
+ endforeach()
+ endif()
+endmacro()
+
+test_input(test 8)
+test_input(train 10)
+test_input(ref 23)
+
+llvm_multisource()
Added: test-suite/trunk/External/SPEC/CFP2006/450.soplex/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CFP2006/450.soplex/CMakeLists.txt?rev=261816&view=auto
==============================================================================
--- test-suite/trunk/External/SPEC/CFP2006/450.soplex/CMakeLists.txt (added)
+++ test-suite/trunk/External/SPEC/CFP2006/450.soplex/CMakeLists.txt Wed Feb 24 19:59:02 2016
@@ -0,0 +1,37 @@
+list(APPEND LDFLAGS -lm)
+
+macro(test_input run_type input outname stdout_reltol info_reltol)
+ llvm_test_run(RUN_TYPE ${run_type}
+ ${ARGN} ${input}
+ > ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input/${outname}
+ WORKDIR ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input
+ )
+ llvm_test_verify(RUN_TYPE ${run_type} ${FPCMP}
+ -r ${stdout_reltol} -a 1.0e-5
+ ${BENCHMARK_DIR}/data/${run_type}/output/${outname}
+ ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input/${outname}
+ )
+ llvm_test_verify(RUN_TYPE ${run_type} ${FPCMP}
+ -r ${info_reltol} -a 20
+ ${BENCHMARK_DIR}/data/${run_type}/output/${input}.info
+ ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input/${input}.info
+ )
+endmacro()
+
+test_input(test test.mps test.out 0.0001 1.0 -m10000)
+test_input(train train.mps train.out 0.02 0.0001 -m1200)
+test_input(train pds-20.mps pds-20.mps.out 0.02 0.0001 -s1 -e -m5000)
+test_input(ref ref.mps ref.out 0.02 0.0001 -m3500)
+test_input(ref pds-50.mps pds-50.mps.out 0.02 0.0001 -s1 -e -m45000)
+
+llvm_multisource()
+
+macro(prepare_data run_type)
+ llvm_copy_dir(450.soplex
+ ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input
+ ${BENCHMARK_DIR}/data/${run_type}/input
+ )
+endmacro()
+prepare_data(test)
+prepare_data(train)
+prepare_data(ref)
Added: test-suite/trunk/External/SPEC/CFP2006/453.povray/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CFP2006/453.povray/CMakeLists.txt?rev=261816&view=auto
==============================================================================
--- test-suite/trunk/External/SPEC/CFP2006/453.povray/CMakeLists.txt (added)
+++ test-suite/trunk/External/SPEC/CFP2006/453.povray/CMakeLists.txt Wed Feb 24 19:59:02 2016
@@ -0,0 +1,37 @@
+list(APPEND LDFLAGS -lm)
+
+macro(test_input run_type stdout_reltol)
+ llvm_test_run(RUN_TYPE ${run_type}
+ SPEC-benchmark-${run_type}.ini
+ WORKDIR ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input
+ )
+ llvm_test_verify(RUN_TYPE ${run_type} ${FPCMP}
+ -r ${stdout_reltol}
+ ${BENCHMARK_DIR}/data/${run_type}/output/SPEC-benchmark.log
+ ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input/SPEC-benchmark.log
+ )
+ llvm_test_verify(RUN_TYPE ${run_type} ${FPCMP}
+ ${BENCHMARK_DIR}/data/${run_type}/output/SPEC-benchmark.tga
+ ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input/SPEC-benchmark.tga
+ )
+endmacro()
+
+test_input(test 0.0002)
+test_input(train 0.00005)
+test_input(ref 0.00005)
+
+llvm_multisource()
+
+include(CopyDir)
+llvm_copy_dir(453.povray ${CMAKE_CURRENT_BINARY_DIR}/data/test/input
+ ${BENCHMARK_DIR}/data/test/input
+ ${BENCHMARK_DIR}/data/all/input
+)
+llvm_copy_dir(453.povray ${CMAKE_CURRENT_BINARY_DIR}/data/train/input
+ ${BENCHMARK_DIR}/data/train/input
+ ${BENCHMARK_DIR}/data/all/input
+)
+llvm_copy_dir(453.povray ${CMAKE_CURRENT_BINARY_DIR}/data/ref/input
+ ${BENCHMARK_DIR}/data/ref/input
+ ${BENCHMARK_DIR}/data/all/input
+)
Added: test-suite/trunk/External/SPEC/CFP2006/470.lbm/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CFP2006/470.lbm/CMakeLists.txt?rev=261816&view=auto
==============================================================================
--- test-suite/trunk/External/SPEC/CFP2006/470.lbm/CMakeLists.txt (added)
+++ test-suite/trunk/External/SPEC/CFP2006/470.lbm/CMakeLists.txt Wed Feb 24 19:59:02 2016
@@ -0,0 +1,22 @@
+include_directories(${BENCHMARK_DIR}/src)
+
+list(APPEND LDFLAGS -lm)
+
+macro(test_input run_type)
+ llvm_test_run(RUN_TYPE ${run_type}
+ ${ARGN}
+ > ${CMAKE_CURRENT_BINARY_DIR}/lbm.out
+ WORKDIR ${BENCHMARK_DIR}/data/${run_type}/input
+ )
+ llvm_test_verify(RUN_TYPE ${run_type} ${FPCMP}
+ -a 0.0000001
+ ${BENCHMARK_DIR}/data/${run_type}/output/lbm.out
+ ${CMAKE_CURRENT_BINARY_DIR}/lbm.out
+ )
+endmacro()
+
+test_input(test 20 reference.dat 0 1 100_100_130_cf_a.of)
+test_input(train 300 reference.dat 0 1 100_100_130_cf_b.of)
+test_input(ref 3000 reference.dat 0 0 100_100_130_ldc.of)
+
+llvm_multisource()
Added: test-suite/trunk/External/SPEC/CFP2006/482.sphinx3/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CFP2006/482.sphinx3/CMakeLists.txt?rev=261816&view=auto
==============================================================================
--- test-suite/trunk/External/SPEC/CFP2006/482.sphinx3/CMakeLists.txt (added)
+++ test-suite/trunk/External/SPEC/CFP2006/482.sphinx3/CMakeLists.txt Wed Feb 24 19:59:02 2016
@@ -0,0 +1,78 @@
+add_definitions(-DHAVE_CONFIG_H)
+include_directories(${BENCHMARK_DIR}/src ${BENCHMARK_DIR}/src/libutil)
+list(APPEND LDFLAGS -lm)
+
+macro(test_input run_type)
+ llvm_test_run(RUN_TYPE ${run_type}
+ ctlfile . args.an4
+ > ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input/an4.log
+ WORKDIR ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input
+ )
+ llvm_test_verify(RUN_TYPE ${run_type} ${FPCMP}
+ -r .0004
+ ${BENCHMARK_DIR}/data/${run_type}/output/considered.out
+ ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input/considered.out
+ )
+ llvm_test_verify(RUN_TYPE ${run_type} ${FPCMP}
+ -r 1e-6
+ ${BENCHMARK_DIR}/data/${run_type}/output/total_considered.out
+ ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input/total_considered.out
+ )
+ llvm_test_verify(RUN_TYPE ${run_type} ${FPCMP}
+ -r .001
+ ${BENCHMARK_DIR}/data/${run_type}/output/an4.log
+ ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input/an4.log
+ )
+endmacro()
+
+test_input(test)
+test_input(train)
+test_input(ref)
+
+# The benchmark includes the filenames of the .c files in its output and we
+# cannot have full paths in there so hack around...
+foreach(s ${Source})
+ get_filename_component(basename ${s} NAME)
+ set_source_files_properties(${s} PROPERTIES COMPILE_DEFINITIONS __FILE__="${basename}")
+endforeach()
+
+llvm_multisource()
+set(TARGET 482.sphinx3)
+
+macro(prepare_data run_type)
+ set(DESTDIR ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input)
+ llvm_copy_dir(${TARGET} ${DESTDIR}/model
+ ${BENCHMARK_DIR}/data/all/input/model
+ )
+ llvm_copy(${TARGET} ${DESTDIR} ${BENCHMARK_DIR}/data/${run_type}/input/args.an4)
+ llvm_copy(${TARGET} ${DESTDIR} ${BENCHMARK_DIR}/data/${run_type}/input/beams.dat)
+ # Create ctlfile and copy .raw files depending on endianess
+ if (IS_BIGENDIAN)
+ file(GLOB files "${BENCHMARK_DIR}/data/${run_type}/input/*.be.raw")
+ else()
+ file(GLOB files "${BENCHMARK_DIR}/data/${run_type}/input/*.le.raw")
+ endif()
+ set(CTLFILE "")
+ foreach(f ${files})
+ get_filename_component(basename ${f} NAME)
+ string(REGEX REPLACE ".(be|le).raw$" "" basename "${basename}")
+ llvm_copy(${TARGET} ${DESTDIR}/${basename}.raw ${f})
+ # Determine file size...
+ file(READ ${f} content HEX)
+ string(LENGTH ${content} content_length)
+ math(EXPR filesize "${content_length} / 2")
+ # Append line to ctlfile
+ set(CTLFILE "${CTLFILE}${basename} ${filesize}\n")
+ endforeach()
+ file(GENERATE OUTPUT ${DESTDIR}/ctlfile CONTENT "${CTLFILE}")
+endmacro()
+
+prepare_data(test)
+prepare_data(train)
+prepare_data(ref)
+
+# Data comes with *.test files which should not be read by lit.
+file(GENERATE
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/data/lit.local.cfg
+ CONTENT "config.suffixes = []"
+)
Added: test-suite/trunk/External/SPEC/CFP2006/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CFP2006/CMakeLists.txt?rev=261816&view=auto
==============================================================================
--- test-suite/trunk/External/SPEC/CFP2006/CMakeLists.txt (added)
+++ test-suite/trunk/External/SPEC/CFP2006/CMakeLists.txt Wed Feb 24 19:59:02 2016
@@ -0,0 +1,49 @@
+list(APPEND CPPFLAGS -DSPEC_CPU)
+
+if(TARGET_OS STREQUAL "Darwin")
+ list(APPEND CPPFLAGS -DSPEC_CPU_MACOSX)
+elseif(TARGET_OS STREQUAL "Linux")
+ list(APPEND CPPFLAGS -DSPEC_CPU_LINUX)
+endif()
+
+if(ARCH STREQUAL "x86")
+ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ list(APPEND CPPFLAGS -DSPEC_CPU_X64)
+ else()
+ list(APPEND CPPFLAGS -DSPEC_CPU_IA32)
+ endif()
+endif()
+
+include(TestBigEndian)
+test_big_endian(IS_BIGENDIAN)
+if(IS_BIGENDIAN)
+ list(APPEND CPPFLAGS -DSPEC_CPU_BIGENDIAN)
+else()
+ list(APPEND CPPFLAGS -DSPEC_CPU_LITTLEENDIAN)
+endif()
+
+if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ list(APPEND CPPFLAGS -DSPEC_CPU_LP64)
+endif()
+
+macro(cpu2006_subdir)
+ foreach(BENCHMARK ${ARGN})
+ set(BENCHMARK_DIR ${TEST_SUITE_SPEC2006_ROOT}/benchspec/CPU2006/${BENCHMARK})
+ set(PROG ${BENCHMARK})
+ file(GLOB Source ${BENCHMARK_DIR}/src/*.c ${BENCHMARK_DIR}/src/*.cpp ${BENCHMARK_DIR}/src/*.cc)
+ if(NOT DEFINED RUN_TYPE)
+ set(RUN_TYPE "train")
+ endif()
+ llvm_add_subdirectories(${BENCHMARK})
+ endforeach()
+endmacro()
+
+cpu2006_subdir(
+ 433.milc
+ 444.namd
+ 447.dealII
+ 450.soplex
+ 453.povray
+ 470.lbm
+ 482.sphinx3
+)
Modified: test-suite/trunk/External/SPEC/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CMakeLists.txt?rev=261816&r1=261815&r2=261816&view=diff
==============================================================================
--- test-suite/trunk/External/SPEC/CMakeLists.txt (original)
+++ test-suite/trunk/External/SPEC/CMakeLists.txt Wed Feb 24 19:59:02 2016
@@ -16,7 +16,7 @@ endif()
llvm_externals_find(TEST_SUITE_SPEC2006_ROOT "speccpu2006" "SPEC CPU2006")
if(TEST_SUITE_SPEC2006_ROOT)
- llvm_add_subdirectories(CINT2006)
+ llvm_add_subdirectories(CINT2006 CFP2006)
endif()
file(COPY lit.local.cfg DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
Modified: test-suite/trunk/cmake/modules/CopyDir.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/cmake/modules/CopyDir.cmake?rev=261816&r1=261815&r2=261816&view=diff
==============================================================================
--- test-suite/trunk/cmake/modules/CopyDir.cmake (original)
+++ test-suite/trunk/cmake/modules/CopyDir.cmake Wed Feb 24 19:59:02 2016
@@ -8,3 +8,10 @@ macro(llvm_copy_dir target to) # args: d
${COPY_COMMAND}
)
endmacro()
+
+macro(llvm_copy target to from)
+ add_custom_command(
+ TARGET ${target} POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy ${from} ${to}
+ )
+endmacro()
More information about the llvm-commits
mailing list