Commit Graph

1396 Commits

Author SHA1 Message Date
Mathieu Poumeyrol
4e7d06700f second __APPLE__ 2018-09-06 23:48:31 +02:00
Mathieu Poumeyrol
24ecc0d94a use _POSIX_BARRIERS instead of __APPLE__ 2018-09-06 22:10:16 +02:00
Mathieu Poumeyrol
a6802eab7d reinstantiate test on macos 2018-09-06 17:16:35 +02:00
Mathieu Poumeyrol
d688a2b7e5 add an adhoc impl for pthread_barrier 2018-09-06 15:31:14 +02:00
Field G. Van Zee
ab9f9e684d CHANGELOG update (0.4.1) 2018-08-30 15:14:02 -05:00
Field G. Van Zee
10fd614031 Version file update (0.4.1) 0.4.1 2018-08-30 15:13:59 -05:00
Field G. Van Zee
08dd67c4b2 ReleaseNotes.md update in advance of next version. 2018-08-30 15:12:13 -05:00
Field G. Van Zee
4fa4cb0734 Trivial comment header updates.
Details:
- Removed four trailing spaces after "BLIS" that occurs in most files'
  commented-out license headers.
- Added UT copyright lines to some files. (These files previously had
  only AMD copyright lines but were contributed to by both UT and AMD.)
- In some files' copyright lines, expanded 'The University of Texas' to
  'The University of Texas at Austin'.
- Fixed various typos/misspellings in some license headers.
2018-08-29 18:06:41 -05:00
Field G. Van Zee
b051ffb815 Merge branch 'dev' 2018-08-29 17:06:48 -05:00
Mathieu Poumeyrol
6f33d9de21 fix compilation of armv7a kernels (#242) 2018-08-29 16:48:22 -05:00
Field G. Van Zee
8199e339ae Added testsuite threading to input.general.fast.
Details:
- Added lines associated with the testsuite's new threading option to
  input.general.fast. This change was intended for the previous commit
  (10d0735).
2018-08-27 07:00:12 -05:00
Field G. Van Zee
10d07357af Better thread safety; added threading to testsuite.
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.
2018-08-26 20:34:30 -05:00
Field G. Van Zee
aaa549f4d1 Minor update to configure --help (--sharedir option).
Details:
- Fixed/tweaked description for --sharedir=SHAREDIR option.
2018-08-26 20:13:51 -05:00
Field G. Van Zee
573b8ac373 Fixed copy-paste typo in previous commit.
Details:
- Fixed a typo in travis/do_testsuite.sh introduced in 62ea1d3.
2018-08-26 13:51:32 -05:00
Field G. Van Zee
62ea1d33d3 Fixed broken out-of-tree builds.
Details:
- Fixed stale filepaths to check-blastest.sh and check-blistest.sh in
  travis/do_testsuite.sh and travis/do_sde.sh.
- Create a symbolic link to the 'config' directory so that the top-level
  Makefile can find the configs' make_defs.mk files during out-of-tree
  builds.
- Added additional case handling to out-of-tree scenario to handle
  situations where files 'Makefile', 'common.mk', or 'config' exist but
  are not symbolic links. In such cases, configure warns the user and
  exits.
- Homogenized various error messages throughout configure.
- Belated thanks to Victor Eijkhout for requesting the feature added
  in 0f491e9 whereby lesser Makefiles can compile and link against
  an existing installation of BLIS.
2018-08-26 13:35:53 -05:00
Field G. Van Zee
0f491e994a Allow lesser Makefiles to reference installed BLIS.
Details:
- Updated the build system so that "lesser" Makefiles, such as those in
  belonging to example code or the testsuite, may be run even if the
  directory is orphaned from the original build tree. This allows a
  user to configure, compile, and install BLIS, delete the build tree
  (that is, the source distribution, or the build directory for out-
  of-tree builds) and then compile example or testsuite code and link
  against the installed copy of BLIS (provided the example or testsuite
  directory was preserved or obtained from another source). The only
  requirement is that make be invoked while setting the
  BLIS_INSTALL_PATH variable to the same installation prefix used when
  BLIS was configured. The easiest syntax is:

    make BLIS_INSTALL_PATH=/install/prefix

  though it's also permissible to set BLIS_INSTALL_PATH as an
  environment variable prior to running 'make'.
- Updated all lesser Makefiles to implement the new aforementioned build
  behavior.
- Relocated check-blastest.sh and check-blistest.sh from build to
  blastest and testsuite, respectively, so that if those directories are
  copied elsewhere the user can still run 'make check' locally.
- Updated docs/Testsuite.md with language that mentions this new option
  of building/linking against an installed copy of BLIS.
2018-08-25 20:12:36 -05:00
Field G. Van Zee
36ff92ce0d Missing C++ compiler no longer fatal to configure.
Details:
- Changed configure so that the absence of any C++ compiler from the
  pre-defined search list does not result in an exit. Instead, in this
  situation, the found_cxx variable is assigned 'c++notfound' and the
  error message is changed to remind the user that C++ will not be
  available in the sandbox. Thanks to Devangi Parikh for reporting this
  issue.
- Also tweaked the message when a C++ compiler *is* found to remind any
  would-be confused user that BLIS will only use C++ if it is needed by
  code in the sandbox.
2018-08-24 18:26:09 -05:00
Field G. Van Zee
658f0a129b Fixed obscure integer size bug in va_arg() usage.
Details:
- Fixed a bug in the way that the variadic bli_cntx_set_l3_nat_ukrs()
  function was defined. This function is meant to take a microkernel id,
  microkernel datatype, microkernel address, and microkernel preference
  as arguments, and is typically called within the bli_cntx_init_*()
  function defined within a sub-configuration for initializing an
  appropriate context. The problem is with the final argument: the
  microkernel preference. These preferences are actually boolean values,
  0 or 1 (encoded as FALSE or TRUE). Since the variadic function does
  not give the compiler any type information for any variadic arguments,
  they are "promoted" in the course of internal (macroized) processing
  according to default argument promotion rules. Thus, integer literals
  such as 0 and 1 become int and floating-point literals (such as 0.0 or
  1.0) become double. Previous to this commit, we indicated to va_arg()
  that the ukernel preference was a 'bool_t', which is a typedef of
  int64_t on 64-bit systems. On systems where int is defined as 64 bits,
  no problems manifest since int is the same size as the type we passed
  in to va_arg(), but on systems where int is 32 bits, the ukernel
  preference could be misinterpreted as a garbage value. (This was
  observed on a modern armv8 system.) The fix was to interpret the
  bool_t value as int and then immediately typecast it to and store it
  as a bool_t. Special thanks to Devangi Parikh for helping track down
  this issue, including deciphering the use of va_arg() and its
  byzantine treatment of types.
- Added explicit typecasts for all invocations of va_arg() in
  bli_cntx.c.
2018-08-24 17:49:37 -05:00
Field G. Van Zee
e71dc38912 Fixed a very minor memory leak in gks.
Details:
- Fixed a memory leak in the global kernel structure that resulted in 56
  bytes per configured architecture (of which only 18 are presently
  supported by BLIS). The leak would only manifest if BLIS was
  initialized and then finalized before the application terminated.
  Thanks to Devangi Parikh for helping track down this leak.
2018-08-24 15:56:04 -05:00
Field G. Van Zee
a7e3a5f975 Fixed uncallable bli_finalize().
Details:
- Previously, bli_finalize_once()--which, like bli_init_once(), was
  implemented in terms of pthread_once()--was using the same
  pthread_once_t control object being used by bli_init(), thus
  guaranteeing that it would never be called as long as BLIS had already
  been initialized. This could manifest as a rather large memory leak to
  any application that attempted to finalize BLIS midway through its
  execution (since BLIS reserves several megabytes of storage for
  packing buffers per thread used). The fix entailed giving each
  function its own pthread_once_t object. Thanks to Devangi Parikh for
  helping track down this very quiet bug.
2018-08-24 14:51:11 -05:00
Field G. Van Zee
a79c21c7c1 Fixed cleanmk target post-1b0f8d6.
Details:
- Changed the cleanmk target to delete makefile fragments from their new
  home in obj/$(CONFIG_NAME). The old definition worked only because of
  a typo (REFERKN_PATH instead of REFKERN_PATH), and only in the
  non-verbose (V != 1) case.
2018-08-23 14:40:46 -05:00
Field G. Van Zee
ffb57242f3 Cosmetic output changes to configure.
Details:
- Disable sandbox-related obj directory creation, directory mirroring,
  and makefile fragment generation when a sandbox is not enabled.
- Prevent various duplicate actions by configure (such as those
  mentioned above for sandboxes above).
2018-08-22 18:22:41 -05:00
Field G. Van Zee
ac17454aae Merge branch 'master' into dev 2018-08-22 15:34:53 -05:00
Field G. Van Zee
a77bec766a Whitespace changes, minor renames in build system.
Details:
- Minor whitespace cleanup, mostly in the form of spaces -> tabs.
- Shortened certain variables' _FRAGMENT_ infixes to _FRAG_ in
  common.mk.
2018-08-22 15:31:29 -05:00
Devin Matthews
1b0f8d60d1 Generate makefile fragments in build tree (#240)
* Make src dir read-only in out-of-tree build test.

* Generate makefile fragments in the build tree.
2018-08-22 15:19:29 -05:00
Field G. Van Zee
7afd095af3 Removed skx from code snippet in previous commit.
Details:
- The docs/ConfigurationHowTo.md document was written with examples that
  did not yet contain the skx sub-configuration, but the previous commit
  included bli_arch.c code copied and pasted from a recent commit that
  does support skx. To keep things consistent, I've removed skx from the
  recently-added ConfigurationHowTo.md code snippet.
2018-08-22 14:58:24 -05:00
Field G. Van Zee
48211a980d Update to docs/ConfigurationHowTo.md.
Details:
- Added missing language directing the reader to modify the config_name
  string array in bli_arch.c when adding a new sub-configuration. Thanks
  to Devangi Parikh for reporting this missing section.
2018-08-22 14:55:02 -05:00
Field G. Van Zee
65c9096c6e Fixed broken -p option to configure.
Details:
- Fixed some stale code that was preventing the -p option to configure
  from working as expected (though the --prefix option was unaffected).
  This bug was was most likely introduced in  7e5648c (May 7 2018).
  Thanks to Dave Love for reporting this issue.
2018-08-17 11:44:12 -05:00
Field G. Van Zee
e358d5e497 README.md update (Funding section). 2018-08-16 12:18:45 -05:00
Field G. Van Zee
a61dd5e7bc Changed 'test' target to be more like 'check'.
Details:
- Redefined the 'test' make target in the top-level Makefile so that the
  final result ("everything passed" or at "least one failure") is echoed
  to stdout. Note that 'check' is unchanged, and thus is now effectively
  a fast version of 'test'.
- Updated docs/BuildSystem.md to reflect the above change.
2018-08-14 17:08:03 -05:00
Field G. Van Zee
ce5c3a198a Merge branch 'master' of github.com:flame/blis 2018-08-14 16:52:19 -05:00
Field G. Van Zee
4f6745d68a Fixed link error when building only shared library.
Details:
- Fixed a linker error that occurred when attempting to compile and link
  the testsuite and/or BLAS test drivers after having configured BLIS to
  only generate a shared library (no static library). The chosen
  solution involved
  (1) adding the local library path, $(BASE_LIB_PATH), to the search
      paths for the shared library via the link option
      -Wl,-rpath,$(BASE_LIB_PATH).
  (2) adding a local symlink to $(BASE_LIB_PATH) that uses the .so major
      version number so that ld would find the shared library at
      execution time.
  Thanks to Sajid Ali for reporting this issue, to Devin Matthews for
  pointing out the need for the -rpath option, and to Devangi Parikh for
  helping Sajid isolate the problem.
- Added #include <ctype.h> to bli_system.h to avoid a compiler warning
  resulting from using toupper() from bli_string.c without a prototype.
  Thanks again to Sajid Ali, whose build log revealed this compiler
  warning.
- Added '*.so.*' to .gitignore.
- CREDITS file update.
2018-08-14 16:50:47 -05:00
Devangi N. Parikh
0bbe69d5ed Updated plotting scripts in test/studies.
Details:
- Fixed indexing on plots to correspond to the removal of dtime in
  the test drivers.
2018-08-14 14:49:58 -05:00
Field G. Van Zee
e93e0e149e Removed redefinition of axpyv, scal2v func types.
Details:
- Removed a stray/accidental redefinition of axpyv and scal2v function
  types in frame/1d/bli_l1d_ft.h (probably a copy/paste leftover during
  development).
2018-08-07 15:54:30 -05:00
Field G. Van Zee
1deb33bd16 Updated penryn kernels to use new _ker_ft type names.
Details:
- Updated older _ft kernel type suffixes used within penryn level-1v
  and -1f kernels to use the newer _ker_ft suffix that was introduced
  in 0175483. (Thank you Travis CI.)
2018-08-07 15:02:50 -05:00
Field G. Van Zee
9cb0b023ca INSTALL file update. 2018-08-07 14:21:07 -05:00
Field G. Van Zee
017548314f Replaced function chooser macros w/ func ptr arrays.
Details:
- Previously, most object API functions (_oapi.c) used a function
  chooser macro that would expand out to an if-elseif-elseif-else
  conditional that used a num_t datatype to call the appropriate
  type-specific API (_tapi.c). This always felt a little hackish, and
  would get in the way somewhat of addig support for new num_t datatypes
  in the future. So, I've replaced that functionality with code that
  queries a function pointer that is then typecast appropriately. This
  model of function calling was already pervasive for kernels queried
  from the cntx_t structure. It was also already in use in various other
  functions, such as macrokernels, and this commit simply extends that
  pattern.
- The above change required many new files, mostly header files, that
  define the function types (mostly _ft.h) for the queriable functions
  as well as some source files to define the function pointer arrays and
  their corresponding query functions (_fpa.c). Various other function
  types, mostly for kernel function types, were renamed to reduce the
  potential for confusion with the function types for expert and basic
  (non-expert) typed API functions.
- Removed definitions for all of the "bli_call_ft_*()" function chooser
  macros from bli_misc_macro_defs.h.
2018-08-07 14:13:25 -05:00
Field G. Van Zee
addce08966 Format spec and other updates in test, test/3m4m.
Details:
- Removed the dtime (delta time, or wallclock time) column from the
  matlab output of all test drivers in test, test/3m4m, test/studies.
  This value was rarely (if ever) really needed and usually only served
  to take up screen space.
- Updated format specifier in test/studies/skx to use %7.2f instead of
  %6.3f.
- For the test drivers in 'test' directory, added an initial line of
  output that sets last entry of matlab matrix to zero in order to
  induce a pre-allocation of the entire array of performance results.
2018-08-06 13:18:20 -05:00
Field G. Van Zee
94d5ef42c8 Adjusted gflops format spec in testsuite, test/3m4m.
Details:
- Changed the format specifier for the gflops column in the testsuite
  output from %7.3f to %7.2f. This was done mainly to keep the output
  aligned properly when the expected perfomance exceeded 1000 gflops.
  Also, two decimal places still conveys plenty of precision for all
  practical applications, including just eyeballing performance deltas
  between two executions (let alone two implementations).
- Changed the format specifier for gflops in the test/3m4m drivers
  from %6.3f to %7.2f (for the same reasons listed above).
2018-08-04 15:57:17 -05:00
Devangi N. Parikh
c7ff06bae9 Merge branch 'master' of https://github.com/flame/blis 2018-08-01 14:20:41 -05:00
Devangi N. Parikh
6074082cd3 Fixed bug in bli_cntx_set_packm_ker_dt() implementation.
Details:
- Fixed bug in static function bli_cntx_set_[packm/unpackm]_ker_dt(), which
   were incorrectly calling bli_cntx_get_[packm/unpackm]_ker_dt to get the
   corresponding func_t.
2018-08-01 13:30:51 -05:00
Field G. Van Zee
ebe998d06c Fixed typos in BuildSystem.md from previuos commit. 2018-08-01 13:24:00 -05:00
Field G. Van Zee
e72a344e94 Added table of 'make' targets to BuildSystem.md.
Details:
- Added a new section to BuildSystem.md that describes the most useful
  make targets defined in the top-level Makefile.
2018-08-01 13:00:38 -05:00
Field G. Van Zee
4f60d0288e README.md, comment updates.
Details:
- Added links, and sandbox language to README.md.
- Adjusted some comments in high-level level-3 object functions to make
  clear what bli_thread_init_rntm() does.
2018-07-30 19:22:57 -05:00
Field G. Van Zee
455d3f49e5 Edits to object/typed API, multithreading docs. 2018-07-29 18:31:29 -05:00
Field G. Van Zee
922a1c05e0 More tweaks to README.md. 2018-07-28 20:15:55 -05:00
Field G. Van Zee
a7a0cf2b5d More edits to docs/Multithreading.md. 2018-07-28 16:59:31 -05:00
Field G. Van Zee
be21d0cf68 Fixed typos in docs/Multithreading.md. 2018-07-28 16:46:51 -05:00
Field G. Van Zee
eac07c7b4f Edits to docs/Multithreading.md. 2018-07-28 16:45:28 -05:00
Field G. Van Zee
5438375a03 Fixed link in README.md. 2018-07-28 16:34:21 -05:00