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 #21

Merged
merged 3 commits into from
May 22, 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
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,15 @@ if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
testsweeper PRIVATE TESTSWEEPER_ID="${testsweeper_id}" )
endif()

# Use and export -std=c++11; don't allow -std=gnu++11 extensions.
target_compile_features( testsweeper PUBLIC cxx_std_11 )
set_target_properties( testsweeper PROPERTIES CXX_EXTENSIONS false )
# Use and export -std=c++17.
# CMake inexplicably allows gnu++17 or "decay" to earlier c++; prohibit those.
target_compile_features( testsweeper PUBLIC cxx_std_17 )
set_target_properties(
testsweeper PROPERTIES
CXX_STANDARD_REQUIRED true # prohibit < c++17
CXX_EXTENSIONS false # prohibit gnu++17
WINDOWS_EXPORT_ALL_SYMBOLS ON
)

if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.15)
# Conditionally add -Wall. See CMake tutorial.
Expand Down
12 changes: 6 additions & 6 deletions test/ref/003.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ Usage: test [-h|--help]

Parameters for sort:
--check check the results; default y; valid: [ny]
--ref run reference; sometimes check -> ref; default n; valid: [ny]
--ref run reference; sometimes check implies ref; default n; valid: [ny]
--tol tolerance (e.g., error < tol*epsilon to pass); default 50
--repeat times to repeat each test; default 1
--verbose verbose level; default 0
--cache total cache size, in MiB; default 20

Parameters that take comma-separated list of values and may be repeated:
--type One of: s, r32, single, float; d, r64, double; c, c32, complex<float>; z, c64, complex<double>; i, int, integer; default d
--nb block size; default 32
--dim m x n x k dimensions
--alpha alpha value
--beta beta value; default 2.72
--type one of: r16, h, or half; r32, s, single, or float; r64, d, or double; c32, c, or complex-float; c64, z, or complex-double; i, int, or integer; default d
--dim m by n by k dimensions
--nb block size; default 384
--alpha scalar alpha; default 3.1+1.4i
--beta scalar beta; default 2.7
12 changes: 6 additions & 6 deletions test/ref/004.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ Usage: test [-h|--help]

Parameters for sort:
--check check the results; default y; valid: [ny]
--ref run reference; sometimes check -> ref; default n; valid: [ny]
--ref run reference; sometimes check implies ref; default n; valid: [ny]
--tol tolerance (e.g., error < tol*epsilon to pass); default 50
--repeat times to repeat each test; default 1
--verbose verbose level; default 0
--cache total cache size, in MiB; default 20

Parameters that take comma-separated list of values and may be repeated:
--type One of: s, r32, single, float; d, r64, double; c, c32, complex<float>; z, c64, complex<double>; i, int, integer; default d
--nb block size; default 32
--dim m x n x k dimensions
--alpha alpha value
--beta beta value; default 2.72
--type one of: r16, h, or half; r32, s, single, or float; r64, d, or double; c32, c, or complex-float; c64, z, or complex-double; i, int, or integer; default d
--dim m by n by k dimensions
--nb block size; default 384
--alpha scalar alpha; default 3.1+1.4i
--beta scalar beta; default 2.7
14 changes: 7 additions & 7 deletions test/ref/005.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
TestSweeper version NA, id NA
input: ./tester sort
SLATE SLATE LAPACK Reference LAPACK
type nb m n k alpha beta error time (ms) gflop/s time (ms) reference gflop/s status
d 32 100 100 100 3.14+1.41i 2.72 1.2346e-15 ----------- ----------- ---------------- ----------------- pass
d 32 200 200 200 3.14+1.41i 2.72 2.4691e-15 ----------- ----------- ---------------- ----------------- pass
d 32 300 300 300 3.14+1.41i 2.72 3.7037e-15 ----------- ----------- ---------------- ----------------- pass
d 32 400 400 400 3.14+1.41i 2.72 4.9382e-15 ----------- ----------- ---------------- ----------------- pass
d 32 500 500 500 3.14+1.41i 2.72 6.1728e-15 ----------- ----------- ---------------- ----------------- pass
SLATE LAPACK Reference LAPACK
type m n k nb alpha beta error time (ms) gflop/s time (ms) reference gflop/s status
d 100 100 100 384 3.1+1.4i 2.7 1.23e-15 --------- ------------ ---------------- ----------------- pass
d 200 200 200 384 3.1+1.4i 2.7 2.47e-15 --------- ------------ ---------------- ----------------- pass
d 300 300 300 384 3.1+1.4i 2.7 3.70e-15 --------- ------------ ---------------- ----------------- pass
d 400 400 400 384 3.1+1.4i 2.7 4.94e-15 --------- ------------ ---------------- ----------------- pass
d 500 500 500 384 3.1+1.4i 2.7 6.17e-15 --------- ------------ ---------------- ----------------- pass
All tests passed.
24 changes: 12 additions & 12 deletions test/ref/006.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
TestSweeper version NA, id NA
input: ./tester --dim '100:1000:100' sort
SLATE SLATE LAPACK Reference LAPACK
type nb m n k alpha beta error time (ms) gflop/s time (ms) reference gflop/s status
d 32 100 100 100 3.14+1.41i 2.72 1.2346e-15 ----------- ----------- ---------------- ----------------- pass
d 32 200 200 200 3.14+1.41i 2.72 2.4691e-15 ----------- ----------- ---------------- ----------------- pass
d 32 300 300 300 3.14+1.41i 2.72 3.7037e-15 ----------- ----------- ---------------- ----------------- pass
d 32 400 400 400 3.14+1.41i 2.72 4.9382e-15 ----------- ----------- ---------------- ----------------- pass
d 32 500 500 500 3.14+1.41i 2.72 6.1728e-15 ----------- ----------- ---------------- ----------------- pass
d 32 600 600 600 3.14+1.41i 2.72 7.4074e-15 ----------- ----------- ---------------- ----------------- pass
d 32 700 700 700 3.14+1.41i 2.72 8.6419e-15 ----------- ----------- ---------------- ----------------- pass
d 32 800 800 800 3.14+1.41i 2.72 9.8765e-15 ----------- ----------- ---------------- ----------------- pass
d 32 900 900 900 3.14+1.41i 2.72 1.1111e-14 ----------- ----------- ---------------- ----------------- FAILED
d 32 1000 1000 1000 3.14+1.41i 2.72 1.2346e-14 ----------- ----------- ---------------- ----------------- FAILED
SLATE LAPACK Reference LAPACK
type m n k nb alpha beta error time (ms) gflop/s time (ms) reference gflop/s status
d 100 100 100 384 3.1+1.4i 2.7 1.23e-15 --------- ------------ ---------------- ----------------- pass
d 200 200 200 384 3.1+1.4i 2.7 2.47e-15 --------- ------------ ---------------- ----------------- pass
d 300 300 300 384 3.1+1.4i 2.7 3.70e-15 --------- ------------ ---------------- ----------------- pass
d 400 400 400 384 3.1+1.4i 2.7 4.94e-15 --------- ------------ ---------------- ----------------- pass
d 500 500 500 384 3.1+1.4i 2.7 6.17e-15 --------- ------------ ---------------- ----------------- pass
d 600 600 600 384 3.1+1.4i 2.7 7.41e-15 --------- ------------ ---------------- ----------------- pass
d 700 700 700 384 3.1+1.4i 2.7 8.64e-15 --------- ------------ ---------------- ----------------- pass
d 800 800 800 384 3.1+1.4i 2.7 9.88e-15 --------- ------------ ---------------- ----------------- pass
d 900 900 900 384 3.1+1.4i 2.7 1.11e-14 --------- ------------ ---------------- ----------------- FAILED
d 1000 1000 1000 384 3.1+1.4i 2.7 1.23e-14 --------- ------------ ---------------- ----------------- FAILED
2 tests FAILED.
24 changes: 12 additions & 12 deletions test/ref/100.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
TestSweeper version NA, id NA
input: ./tester --type 's,d' sort
SLATE SLATE LAPACK Reference LAPACK
type nb m n k alpha beta error time (ms) gflop/s time (ms) reference gflop/s status
s 32 100 100 100 3.14+1.41i 2.72 1.2346e-15 ----------- ----------- ---------------- ----------------- pass
s 32 200 200 200 3.14+1.41i 2.72 2.4691e-15 ----------- ----------- ---------------- ----------------- pass
s 32 300 300 300 3.14+1.41i 2.72 3.7037e-15 ----------- ----------- ---------------- ----------------- pass
s 32 400 400 400 3.14+1.41i 2.72 4.9382e-15 ----------- ----------- ---------------- ----------------- pass
s 32 500 500 500 3.14+1.41i 2.72 6.1728e-15 ----------- ----------- ---------------- ----------------- pass
SLATE LAPACK Reference LAPACK
type m n k nb alpha beta error time (ms) gflop/s time (ms) reference gflop/s status
s 100 100 100 384 3.1+1.4i 2.7 1.23e-15 --------- ------------ ---------------- ----------------- pass
s 200 200 200 384 3.1+1.4i 2.7 2.47e-15 --------- ------------ ---------------- ----------------- pass
s 300 300 300 384 3.1+1.4i 2.7 3.70e-15 --------- ------------ ---------------- ----------------- pass
s 400 400 400 384 3.1+1.4i 2.7 4.94e-15 --------- ------------ ---------------- ----------------- pass
s 500 500 500 384 3.1+1.4i 2.7 6.17e-15 --------- ------------ ---------------- ----------------- pass

d 32 100 100 100 3.14+1.41i 2.72 1.2346e-15 ----------- ----------- ---------------- ----------------- pass
d 32 200 200 200 3.14+1.41i 2.72 2.4691e-15 ----------- ----------- ---------------- ----------------- pass
d 32 300 300 300 3.14+1.41i 2.72 3.7037e-15 ----------- ----------- ---------------- ----------------- pass
d 32 400 400 400 3.14+1.41i 2.72 4.9382e-15 ----------- ----------- ---------------- ----------------- pass
d 32 500 500 500 3.14+1.41i 2.72 6.1728e-15 ----------- ----------- ---------------- ----------------- pass
d 100 100 100 384 3.1+1.4i 2.7 1.23e-15 --------- ------------ ---------------- ----------------- pass
d 200 200 200 384 3.1+1.4i 2.7 2.47e-15 --------- ------------ ---------------- ----------------- pass
d 300 300 300 384 3.1+1.4i 2.7 3.70e-15 --------- ------------ ---------------- ----------------- pass
d 400 400 400 384 3.1+1.4i 2.7 4.94e-15 --------- ------------ ---------------- ----------------- pass
d 500 500 500 384 3.1+1.4i 2.7 6.17e-15 --------- ------------ ---------------- ----------------- pass
All tests passed.
14 changes: 7 additions & 7 deletions test/ref/101.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Error: --type: invalid value 'x'
Error: --type: invalid datatype 'x'
TestSweeper version NA, id NA
input: ./tester --type 's,x,d' sort
Usage: test [-h|--help]
Expand All @@ -8,15 +8,15 @@ Usage: test [-h|--help]

Parameters for sort:
--check check the results; default y; valid: [ny]
--ref run reference; sometimes check -> ref; default n; valid: [ny]
--ref run reference; sometimes check implies ref; default n; valid: [ny]
--tol tolerance (e.g., error < tol*epsilon to pass); default 50
--repeat times to repeat each test; default 1
--verbose verbose level; default 0
--cache total cache size, in MiB; default 20

Parameters that take comma-separated list of values and may be repeated:
--type One of: s, r32, single, float; d, r64, double; c, c32, complex<float>; z, c64, complex<double>; i, int, integer; default d
--nb block size; default 32
--dim m x n x k dimensions
--alpha alpha value
--beta beta value; default 2.72
--type one of: r16, h, or half; r32, s, single, or float; r64, d, or double; c32, c, or complex-float; c64, z, or complex-double; i, int, or integer; default d
--dim m by n by k dimensions
--nb block size; default 384
--alpha scalar alpha; default 3.1+1.4i
--beta scalar beta; default 2.7
10 changes: 5 additions & 5 deletions test/ref/200.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
TestSweeper version NA, id NA
input: ./tester --type s --dim '100:300:100' sort2
SLATE SLATE LAPACK Reference LAPACK
type nb m n k alpha beta error time (ms) gflop/s time (ms) reference gflop/s status
s 32 100 100 100 3.14+1.41i 2.72 1.2346e-15 ----------- ----------- ---------------- ----------------- pass
s 32 200 200 200 3.14+1.41i 2.72 2.4691e-15 ----------- ----------- ---------------- ----------------- pass
s 32 300 300 300 3.14+1.41i 2.72 3.7037e-15 ----------- ----------- ---------------- ----------------- pass
SLATE LAPACK Reference LAPACK
type m n k nb alpha beta error time (ms) gflop/s time (ms) reference gflop/s status
s 100 100 100 384 3.1+1.4i 2.7 1.23e-15 --------- ------------ ---------------- ----------------- pass
s 200 200 200 384 3.1+1.4i 2.7 2.47e-15 --------- ------------ ---------------- ----------------- pass
s 300 300 300 384 3.1+1.4i 2.7 3.70e-15 --------- ------------ ---------------- ----------------- pass
All tests passed.
10 changes: 5 additions & 5 deletions test/ref/201.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
TestSweeper version NA, id NA
input: ./tester --type s --dim '300:100:-100' sort2
SLATE SLATE LAPACK Reference LAPACK
type nb m n k alpha beta error time (ms) gflop/s time (ms) reference gflop/s status
s 32 300 300 300 3.14+1.41i 2.72 3.7037e-15 ----------- ----------- ---------------- ----------------- pass
s 32 200 200 200 3.14+1.41i 2.72 2.4691e-15 ----------- ----------- ---------------- ----------------- pass
s 32 100 100 100 3.14+1.41i 2.72 1.2346e-15 ----------- ----------- ---------------- ----------------- pass
SLATE LAPACK Reference LAPACK
type m n k nb alpha beta error time (ms) gflop/s time (ms) reference gflop/s status
s 300 300 300 384 3.1+1.4i 2.7 3.70e-15 --------- ------------ ---------------- ----------------- pass
s 200 200 200 384 3.1+1.4i 2.7 2.47e-15 --------- ------------ ---------------- ----------------- pass
s 100 100 100 384 3.1+1.4i 2.7 1.23e-15 --------- ------------ ---------------- ----------------- pass
All tests passed.
6 changes: 3 additions & 3 deletions test/ref/202.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TestSweeper version NA, id NA
input: ./tester --type s --dim 1234 sort2
SLATE SLATE LAPACK Reference LAPACK
type nb m n k alpha beta error time (ms) gflop/s time (ms) reference gflop/s status
s 32 1234 1234 1234 3.14+1.41i 2.72 1.5234e-14 ----------- ----------- ---------------- ----------------- pass
SLATE LAPACK Reference LAPACK
type m n k nb alpha beta error time (ms) gflop/s time (ms) reference gflop/s status
s 1234 1234 1234 384 3.1+1.4i 2.7 1.52e-14 --------- ------------ ---------------- ----------------- pass
All tests passed.
12 changes: 6 additions & 6 deletions test/ref/203.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
TestSweeper version NA, id NA
input: ./tester --type s --dim 1234 --dim '100:300:100' sort2
SLATE SLATE LAPACK Reference LAPACK
type nb m n k alpha beta error time (ms) gflop/s time (ms) reference gflop/s status
s 32 1234 1234 1234 3.14+1.41i 2.72 1.5234e-14 ----------- ----------- ---------------- ----------------- pass
s 32 100 100 100 3.14+1.41i 2.72 1.2346e-15 ----------- ----------- ---------------- ----------------- pass
s 32 200 200 200 3.14+1.41i 2.72 2.4691e-15 ----------- ----------- ---------------- ----------------- pass
s 32 300 300 300 3.14+1.41i 2.72 3.7037e-15 ----------- ----------- ---------------- ----------------- pass
SLATE LAPACK Reference LAPACK
type m n k nb alpha beta error time (ms) gflop/s time (ms) reference gflop/s status
s 1234 1234 1234 384 3.1+1.4i 2.7 1.52e-14 --------- ------------ ---------------- ----------------- pass
s 100 100 100 384 3.1+1.4i 2.7 1.23e-15 --------- ------------ ---------------- ----------------- pass
s 200 200 200 384 3.1+1.4i 2.7 2.47e-15 --------- ------------ ---------------- ----------------- pass
s 300 300 300 384 3.1+1.4i 2.7 3.70e-15 --------- ------------ ---------------- ----------------- pass
All tests passed.
Loading
Loading