Use model name as exe prefix
Drop C++17 requirement for OMP
This commit is contained in:
parent
14aefecc57
commit
fc6d032d7f
@ -99,8 +99,6 @@ register_flag_optional(OFFLOAD_APPEND_LINK_FLAG
|
|||||||
|
|
||||||
|
|
||||||
macro(setup)
|
macro(setup)
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
|
||||||
|
|
||||||
find_package(OpenMP REQUIRED)
|
find_package(OpenMP REQUIRED)
|
||||||
register_link_library(OpenMP::OpenMP_CXX)
|
register_link_library(OpenMP::OpenMP_CXX)
|
||||||
|
|
||||||
|
|||||||
@ -50,13 +50,16 @@ run_build() {
|
|||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
||||||
-DMODEL="$model" $flags &>>"$log"
|
-DMODEL="$model" $flags &>>"$log"
|
||||||
|
local model_lower=$(echo "$model" | awk '{print tolower($0)}')
|
||||||
|
|
||||||
local cmake_code=$?
|
local cmake_code=$?
|
||||||
|
|
||||||
"$CMAKE_BIN" --build "$build" --target babelstream -j "$(nproc)" &>>"$log"
|
"$CMAKE_BIN" --build "$build" -j "$(nproc)" &>>"$log"
|
||||||
local cmake_code=$?
|
local cmake_code=$?
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
local bin="./$build/babelstream"
|
local bin="./$build/$model_lower-stream"
|
||||||
|
echo "Checking for final executable: $bin"
|
||||||
if [[ -f "$bin" ]]; then
|
if [[ -f "$bin" ]]; then
|
||||||
echo "$(tput setaf 2)[PASS!]($model->$build)$(tput sgr0): -DMODEL=$model $flags"
|
echo "$(tput setaf 2)[PASS!]($model->$build)$(tput sgr0): -DMODEL=$model $flags"
|
||||||
# shellcheck disable=SC2002
|
# shellcheck disable=SC2002
|
||||||
@ -119,7 +122,7 @@ build_gcc() {
|
|||||||
if [ "$MODEL" = "all" ] || [ "$MODEL" = "OMP" ]; then
|
if [ "$MODEL" = "all" ] || [ "$MODEL" = "OMP" ]; then
|
||||||
# sanity check that it at least runs
|
# sanity check that it at least runs
|
||||||
echo "Sanity checking GCC OMP build..."
|
echo "Sanity checking GCC OMP build..."
|
||||||
"./$BUILD_DIR/OMP_$name/babelstream" -s 1048576 -n 10
|
"./$BUILD_DIR/OMP_$name/omp-stream" -s 1048576 -n 10
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# some distributions like Ubuntu bionic implements std par with TBB, so conditionally link it here
|
# some distributions like Ubuntu bionic implements std par with TBB, so conditionally link it here
|
||||||
|
|||||||
@ -136,5 +136,11 @@ macro(load_model MODEL)
|
|||||||
include(${MODEL_FILE})
|
include(${MODEL_FILE})
|
||||||
list(APPEND IMPL_SOURCES ${IMPL_${MODEL_UPPER}_SOURCES})
|
list(APPEND IMPL_SOURCES ${IMPL_${MODEL_UPPER}_SOURCES})
|
||||||
list(APPEND IMPL_DEFINITIONS ${IMPL_${MODEL_UPPER}_DEFINITIONS})
|
list(APPEND IMPL_DEFINITIONS ${IMPL_${MODEL_UPPER}_DEFINITIONS})
|
||||||
|
|
||||||
|
string(TOLOWER ${MODEL} MODEL_LOWER)
|
||||||
|
set(EXE_NAME ${MODEL_LOWER}-stream)
|
||||||
|
|
||||||
|
else ()
|
||||||
|
message(FATAL_ERROR "Unsupported model: ${MODEL}")
|
||||||
endif ()
|
endif ()
|
||||||
endmacro()
|
endmacro()
|
||||||
Loading…
Reference in New Issue
Block a user