-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: sync; rename examples; update
make test
- Loading branch information
Showing
10 changed files
with
155 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,14 +32,14 @@ export top=$(pwd) | |
|
||
shopt -s expand_aliases | ||
|
||
|
||
print "======================================== Load compiler" | ||
quiet module load [email protected] | ||
quiet which g++ | ||
g++ --version | ||
|
||
quiet module load intel-oneapi-mkl | ||
echo "MKLROOT=${MKLROOT}" | ||
print "MKLROOT=${MKLROOT}" | ||
|
||
quiet module load python | ||
quiet which python | ||
quiet which python3 | ||
python --version | ||
python3 --version | ||
|
||
quiet module load pkgconf | ||
quiet which pkg-config | ||
|
@@ -59,37 +59,51 @@ else | |
export blas_int=int32 | ||
fi | ||
|
||
#----------------------------------------------------------------- Compiler | ||
if [ "${device}" = "gpu_intel" ]; then | ||
print "======================================== Load Intel oneAPI compiler" | ||
quiet module load intel-oneapi-compilers | ||
else | ||
print "======================================== Load GNU compiler" | ||
quiet module load [email protected] | ||
fi | ||
print "---------------------------------------- Verify compiler" | ||
print "CXX = $CXX" | ||
print "CC = $CC" | ||
print "FC = $FC" | ||
${CXX} --version | ||
${CC} --version | ||
${FC} --version | ||
|
||
#----------------------------------------------------------------- GPU | ||
if [ "${device}" = "gpu_nvidia" ]; then | ||
print "======================================== Load CUDA" | ||
export CUDA_HOME=/usr/local/cuda/ | ||
quiet module load cuda | ||
print "CUDA_HOME=${CUDA_HOME}" | ||
export PATH=${PATH}:${CUDA_HOME}/bin | ||
export gpu_backend=cuda | ||
quiet which nvcc | ||
nvcc --version | ||
fi | ||
|
||
if [ "${device}" = "gpu_amd" ]; then | ||
elif [ "${device}" = "gpu_amd" ]; then | ||
print "======================================== Load ROCm" | ||
export PATH=${PATH}:/opt/rocm/bin | ||
export ROCM_PATH=/opt/rocm | ||
# Some hip utilities require /usr/sbin/lsmod | ||
export PATH=${PATH}:${ROCM_PATH}/bin:/usr/sbin | ||
export gpu_backend=hip | ||
quiet which hipcc | ||
hipcc --version | ||
fi | ||
|
||
if [ "${device}" = "gpu_intel" ]; then | ||
print "======================================== Load Intel oneAPI" | ||
elif [ "${device}" = "gpu_intel" ]; then | ||
# Intel oneAPI SYCL compiler loaded above | ||
export gpu_backend=sycl | ||
quiet module load intel-oneapi-compilers | ||
quiet which icpx | ||
icpx --version | ||
fi | ||
|
||
#----------------------------------------------------------------- CMake | ||
if [ "${maker}" = "cmake" ]; then | ||
print "======================================== Load cmake" | ||
quiet module load cmake | ||
quiet which cmake | ||
cmake --version | ||
cd build | ||
fi | ||
|
||
quiet module list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Copyright (c) 2017-2022, University of Tennessee. All rights reserved. | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# This program is free software: you can redistribute it and/or modify it under | ||
# the terms of the BSD 3-Clause license. See the accompanying LICENSE file. | ||
|
||
# CXX compiler must match the one used to compiler LAPACK++. | ||
# Set it in your environment. | ||
|
||
cmake_minimum_required( VERSION 3.8 ) | ||
|
||
project( | ||
lapackpp_example | ||
LANGUAGES CXX | ||
) | ||
|
||
#------------------------------------------------------------------------------- | ||
# Enforce out-of-source build | ||
string( TOLOWER "${CMAKE_CURRENT_SOURCE_DIR}" source_dir ) | ||
string( TOLOWER "${CMAKE_CURRENT_BINARY_DIR}" binary_dir ) | ||
if ("${source_dir}" STREQUAL "${binary_dir}") | ||
message( FATAL_ERROR | ||
"Compiling with CMake requires an out-of-source build. To proceed: | ||
rm -rf CMakeCache.txt CMakeFiles/ # delete files in ${CMAKE_CURRENT_SOURCE_DIR} | ||
mkdir build | ||
cd build | ||
cmake .. | ||
make" ) | ||
endif() | ||
|
||
#------------------------------------------------------------------------------- | ||
find_package( lapackpp REQUIRED ) | ||
|
||
#-------------------- | ||
add_executable( | ||
example_potrf | ||
example_potrf.cc | ||
) | ||
|
||
target_link_libraries( | ||
example_potrf | ||
lapackpp | ||
) | ||
|
||
#------------------------------------------------------------------------------- | ||
# CTest | ||
|
||
# Get precisions to test. See .github/workflows/test.sh | ||
set( test_args $ENV{test_args} ) | ||
if (NOT test_args) | ||
set( test_args "s d c z" ) | ||
endif() | ||
string( REPLACE " " ";" test_args ${test_args} ) # convert to list | ||
|
||
enable_testing() | ||
add_test( NAME example_gemm COMMAND ./example_potrf ${test_args} ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.