Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For enums, use to_string, from_string. #165

Merged
merged 5 commits into from
May 27, 2024
Merged
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
3 changes: 2 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ else ifeq ($(blas),libsci)
# no LIBS to add
SCALAPACK_LIBRARIES ?=
else
$(error ERROR: unknown `blas=$(blas)`. Set blas to one of mkl, essl, openbblas, libsci.)
$(error ERROR: unknown `blas=$(blas)`. Set blas to one of mkl, essl, openbblas, libsci)
endif

# If not set by user or above, set default.
Expand Down Expand Up @@ -445,6 +445,7 @@ libslate_src += \
src/auxiliary/Debug.cc \
src/auxiliary/Trace.cc \
src/core/Memory.cc \
src/core/enums.cc \
src/core/types.cc \
src/version.cc \
# End. Add alphabetically.
Expand Down
2 changes: 1 addition & 1 deletion blaspp
Submodule blaspp updated 113 files
32 changes: 25 additions & 7 deletions examples/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import subprocess
import io
import time
import sys

timer = time.time()

Expand All @@ -30,10 +31,26 @@

opts = parser.parse_args()

# ------------------------------------------------------------------------------
# When stdout is redirected to file instead of TTY console,
# and stderr is still going to a TTY console,
# print extra summary messages to stderr.
output_redirected = sys.stderr.isatty() and not sys.stdout.isatty()

# ------------------------------------------------------------------------------
# if output is redirected, prints to both stderr and stdout;
# otherwise prints to just stdout.
def print_tee( *args ):
global output_redirected
print( *args )
if (output_redirected):
print( *args, file=sys.stderr )
# end

#-------------------------------------------------------------------------------
def run_test( cmd ):
print( '-' * 80 )
print( ' '.join( cmd ) )
print_tee( '-' * 80 )
print_tee( ' '.join( cmd ) )
p = subprocess.Popen( cmd, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT )
p_out = io.TextIOWrapper( p.stdout, encoding='utf-8' )
Expand All @@ -46,9 +63,9 @@ def run_test( cmd ):
err = p.wait()

if (err != 0):
print( 'FAILED, exit code', err )
print_tee( 'FAILED, exit code', err )
else:
print( 'passed' )
print_tee( 'passed' )

print( output )
return err
Expand Down Expand Up @@ -118,16 +135,17 @@ def run_test( cmd ):

types = opts.type.split()
for test in tests:
t = time.time()
cmd = runner + test.split() + types
err = run_test( cmd )
t = time.time() - t
print_tee( 'Elapsed %02d:%05.2f mm:ss' % (t // 60, t % 60) )
if (err):
failed_tests.append( test )
# end

timer = time.time() - timer
mins = timer // 60
secs = timer % 60
print( 'Elapsed %02d:%02d' % (mins, secs) )
print_tee( 'Total Elapsed %02d:%05.2f mm:ss' % (timer // 60, timer % 60) )

# print summary of failures
nfailed = len( failed_tests )
Expand Down
62 changes: 54 additions & 8 deletions include/slate/c_api/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,62 @@ const slate_Target slate_Target_HostBatch = 'B'; ///< slate::Target::HostBatch
const slate_Target slate_Target_Devices = 'D'; ///< slate::Target::Devices
// end slate_Target

typedef char slate_MethodEig; /* enum */ ///< slate::MethodEig
const slate_MethodEig slate_MethodEig_QR = 'Q'; ///< slate::MethodEig::QR
const slate_MethodEig slate_MethodEig_DC = 'D'; ///< slate::MethodEig::DC
typedef char slate_MethodTrsm; /* enum */ ///< slate::MethodTrsm
const slate_MethodTrsm slate_MethodTrsm_Auto = '*'; ///< slate::MethodTrsm::Auto
const slate_MethodTrsm slate_MethodTrsm_A = 'A'; ///< slate::MethodTrsm::A
const slate_MethodTrsm slate_MethodTrsm_B = 'B'; ///< slate::MethodTrsm::B
// end slate_MethodTrsm

typedef char slate_MethodGemm; /* enum */ ///< slate::MethodGemm
const slate_MethodGemm slate_MethodGemm_Auto = '*'; ///< slate::MethodGemm::Auto
const slate_MethodGemm slate_MethodGemm_A = 'A'; ///< slate::MethodGemm::A
const slate_MethodGemm slate_MethodGemm_C = 'C'; ///< slate::MethodGemm::C
// end slate_MethodGemm

typedef char slate_MethodHemm; /* enum */ ///< slate::MethodHemm
const slate_MethodHemm slate_MethodHemm_Auto = '*'; ///< slate::MethodHemm::Auto
const slate_MethodHemm slate_MethodHemm_A = 'A'; ///< slate::MethodHemm::A
const slate_MethodHemm slate_MethodHemm_C = 'C'; ///< slate::MethodHemm::C
// end slate_MethodHemm

typedef char slate_MethodCholQR; /* enum */ ///< slate::MethodCholQR
const slate_MethodCholQR slate_MethodCholQR_Auto = '*'; ///< slate::MethodCholQR::Auto
const slate_MethodCholQR slate_MethodCholQR_GemmA = 'A'; ///< slate::MethodCholQR::GemmA
const slate_MethodCholQR slate_MethodCholQR_GemmC = 'C'; ///< slate::MethodCholQR::GemmC
const slate_MethodCholQR slate_MethodCholQR_HerkA = 'R'; ///< slate::MethodCholQR::HerkA
const slate_MethodCholQR slate_MethodCholQR_HerkC = 'K'; ///< slate::MethodCholQR::HerkC
// end slate_MethodCholQR

typedef char slate_MethodGels; /* enum */ ///< slate::MethodGels
const slate_MethodGels slate_MethodGels_Auto = '*'; ///< slate::MethodGels::Auto
const slate_MethodGels slate_MethodGels_QR = 'Q'; ///< slate::MethodGels::QR
const slate_MethodGels slate_MethodGels_CholQR = 'C'; ///< slate::MethodGels::CholQR
// end slate_MethodGels

typedef char slate_MethodLU; /* enum */ ///< slate::MethodLU
const slate_MethodLU slate_MethodLU_Auto = '*'; ///< slate::MethodLU::Auto
const slate_MethodLU slate_MethodLU_PartialPiv = 'P'; ///< slate::MethodLU::PartialPiv
const slate_MethodLU slate_MethodLU_CALU = 'C'; ///< slate::MethodLU::CALU
const slate_MethodLU slate_MethodLU_NoPiv = 'N'; ///< slate::MethodLU::NoPiv
const slate_MethodLU slate_MethodLU_RBT = 'R'; ///< slate::MethodLU::RBT
const slate_MethodLU slate_MethodLU_BEAM = 'B'; ///< slate::MethodLU::BEAM
// end slate_MethodLU

typedef char slate_MethodEig; /* enum */ ///< slate::MethodEig
const slate_MethodEig slate_MethodEig_Auto = '*'; ///< slate::MethodEig::Auto
const slate_MethodEig slate_MethodEig_QR = 'Q'; ///< slate::MethodEig::QR
const slate_MethodEig slate_MethodEig_DC = 'D'; ///< slate::MethodEig::DC
const slate_MethodEig slate_MethodEig_Bisection = 'B'; ///< slate::MethodEig::Bisection
const slate_MethodEig slate_MethodEig_MRRR = 'M'; ///< slate::MethodEig::MRRR
// end slate_MethodEig

typedef char slate_MethodSVD; /* enum */ ///< slate::MethodSVD
const slate_MethodSVD slate_MethodSVD_Auto = '*'; ///< slate::MethodSVD::Auto
const slate_MethodSVD slate_MethodSVD_QR = 'Q'; ///< slate::MethodSVD::QR
const slate_MethodSVD slate_MethodSVD_DC = 'D'; ///< slate::MethodSVD::DC
const slate_MethodSVD slate_MethodSVD_Bisection = 'B'; ///< slate::MethodSVD::Bisection
// end slate_MethodSVD

// todo: auto sync with include/slate/enums.hh
typedef char slate_Option; /* enum */ ///< slate::Option
const slate_Option slate_Option_ChunkSize = 0; ///< slate::Option::ChunkSize
Expand Down Expand Up @@ -66,11 +117,6 @@ const slate_Option slate_Option_MethodTrsm = 66; ///< slate::Option::M

typedef short slate_MOSI_State;

//------------------------------------------------------------------------------
// slate/include/slate/types.hh

typedef int slate_Method;

//------------------------------------------------------------------------------
// blaspp/include/blas_util.hh

Expand Down
Loading
Loading