mirror of
https://github.com/amd/blis.git
synced 2026-05-04 14:31:12 +00:00
Details: - Replaced critical sections that were conditional upon multithreading being enabled (via pthreads or OpenMP) with unconditional use of pthreads mutexes. (Why pthreads? Because BLIS already requires it for its initialization mechanism: pthread_once().) This was done in bli_error.c, bli_gks.c, bli_l3_ind.c. Also, replaced usage of BLIS's mtx_t object and bli_mutex_*() API with pthread mutexes in bli_thread.c. The previous status quo could result in a race condition if the application called BLIS from more than one thread. The new pthread-based code should be completely agnostic to the application's threading configuration. Thanks to AMD for bringing to our attention the need for a thread-safety review. - Added an option to the testsuite to simulate application-level multithreading. Specifically, each thread maintains a counter that is incremented after each experiment. The thread only executes the experiment if: counter % n_threads == thread_id. In other words, the threads simply take turns executing each problem experiment. Also, POSIX guarantees that fprintf() will not intermingle output, so output was switched to fprintf() instead of libblis_test_fprintf(). - Changed membrk_t objects to use pthread_mutex_t intead of mtx_t and replaced use of bli_mutex_init()/_finalize() in bli_membrk.c with wrappers to pthread_mutex_init()/_destroy(). - Changed the implementation of bli_l3_ind_oper_enable_only() to fix a race condition; specifically, two threads calling the function with the same parameters could lead to a non-deterministic outcome. - Added #include <pthread.h> to bli_cpuid.c and moved the same in bli_arch.c. - Added 'const' to declaration of OPT_MARKER in bli_getopt.c. - Added #include <pthread.h> to bli_system.h. - Added add-copyright.py script to automate adding new copyright lines to (and updating existing lines of) source files.
48 lines
2.2 KiB
Plaintext
48 lines
2.2 KiB
Plaintext
# ----------------------------------------------------------------------
|
|
#
|
|
# input.general
|
|
# BLIS test suite
|
|
#
|
|
# This file contains input values that control how BLIS operations are
|
|
# tested. Comments explain the purpose of each parameter as well as
|
|
# accepted values.
|
|
#
|
|
|
|
1 # Number of repeats per experiment (best result is reported)
|
|
rc # Matrix storage scheme(s) to test:
|
|
# 'c' = col-major storage; 'g' = general stride storage;
|
|
# 'r' = row-major storage
|
|
cj # Vector storage scheme(s) to test:
|
|
# 'c' = colvec / unit stride; 'j' = colvec / non-unit stride;
|
|
# 'r' = rowvec / unit stride; 'i' = rowvec / non-unit stride
|
|
0 # Test all combinations of storage schemes?
|
|
1 # Perform all tests with alignment?
|
|
# '0' = do NOT align buffers/ldims; '1' = align buffers/ldims
|
|
0 # Randomize vectors and matrices using:
|
|
# '0' = real values on [-1,1];
|
|
# '1' = powers of 2 in narrow precision range
|
|
32 # General stride spacing (for cases when testing general stride)
|
|
sdcz # Datatype(s) to test:
|
|
# 's' = single real; 'c' = single complex;
|
|
# 'd' = double real; 'z' = double complex
|
|
100 # Problem size: first to test
|
|
500 # Problem size: maximum to test
|
|
100 # Problem size: increment between experiments
|
|
# Complex level-3 implementations to test:
|
|
0 # 3mh ('1' = enable; '0' = disable)
|
|
0 # 3m1 ('1' = enable; '0' = disable)
|
|
0 # 4mh ('1' = enable; '0' = disable)
|
|
0 # 4m1b ('1' = enable; '0' = disable)
|
|
0 # 4m1a ('1' = enable; '0' = disable)
|
|
1 # 1m ('1' = enable; '0' = disable)
|
|
1 # native ('1' = enable; '0' = disable)
|
|
1 # Simulate application-level threading:
|
|
# '1' = disable / use one testsuite thread;
|
|
# 'n' = enable and use n testsuite threads
|
|
1 # Error-checking level:
|
|
# '0' = disable error checking; '1' = full error checking
|
|
i # Reaction to test failure:
|
|
# 'i' = ignore; 's' = sleep() and continue; 'a' = abort
|
|
0 # Output results in matlab/octave format? ('1' = yes; '0' = no)
|
|
0 # Output results to stdout AND files? ('1' = yes; '0' = no)
|