Commit Graph

1150 Commits

Author SHA1 Message Date
Field G. Van Zee
3c91c7aeba Fixed 64b type mismatch warning in cblas_xerbla.c.
Details:
- Fixed a compiler warning concerning a type mismatch between the
  format specifier of the printf() call in cblas_xerbla.c and its
  corresponding (info) argument. The warning manifested when the CBLAS
  layer was enabled and the BLAS/CBLAS integer type siwas is set to 64
  (the default is 32). The warning was fixed by changing the specifier
  from %d to %jd and typecasting the argument to intmax_t. Thanks to
  Dave Love for reporting this issue and submitting the patch.
2018-04-02 12:40:25 -05:00
Field G. Van Zee
71eaf449a8 Merge branch 'dev' 2018-03-27 17:21:43 -05:00
dnp
ae9a5be56d Fixed bug in skx sgemm microkernel 2018-03-27 17:01:23 -05:00
Field G. Van Zee
3f02af0905 Row storage optimizations to zen dotxf kernels.
Details:
- Split the main loop bodies of zen's [sd]dotxf kernels into two cases:
  one to handle a column-stored matrix A and one to handle a row-stored
  matrix A. This allows vector instructions to be employed even if A is
  stored by rows (and A^T appears stored as columns). Both storage cases
  use a common edge case loop. Thanks to Devin Matthews for this idea
  and for prototyping the change needed for sdotxf kernel.
2018-03-26 17:40:04 -05:00
Field G. Van Zee
679dcc331d Make k_iter/k_left uint64_t in bulldozer fma ukrs.
Details:
- Changed the declaration of k_iter and k_left for d, c, z microkernels
  from dim_t to uint64_t. This is needed to ensure compatibility with
  the movq instruction used to load the value into registers. This
  change should have been made a long time ago, but for some reason
  only recently began showing up via Travis CI.
2018-03-26 15:35:17 -05:00
Field G. Van Zee
6a628184f6 Fixed a memkind-related compile-time bug on knl.
Details:
- Fixed a compile-time error that occurred due to the fact that
  BLIS_ENABLE_MEMKIND, defined in bli_config.h, was not being defined
  soon enough to be used in bli_system.h where it is needed to determine
  whether hbwmalloc.h should be #included. bli_system.h is now included
  after bli_config.h (and bli_config_macro_defs.h). Thanks to Dave Love
  for reporting this issue.
- Tweaked the language used by configure to echo the status of the
  --with[out]-memkind option.
2018-03-26 14:48:16 -05:00
Field G. Van Zee
e2192a8fd5 Removed vzeroupper intrinsics from zen kenels.
Details:
- Fixed a bug in the zen (also used by haswell) dotxf kernels whereby a
  vzeroupper instruction destoryed part of the intermediate result
  stored by the vdpps instructions that came right before. (The
  vzeroupper instrinsic was removed.)
- Removed remaining vzeroupper instrinsics from other zen kernels.
  Previously, the vzeroupper instructions were included because BLIS is
  typically compiled with -mfpmath=sse. But it was brought to my
  attention that inserting these vzeroupper instructions is unnecessary
  for our purposes, since (a) -mfpmath=sse results in VEX-encoded scalar
  code rather than literal SSE instructions, and (b) compilers already
  (likely) insert vzeroupper instructions where necessary. Thanks to
  Devin Matthews for zeroing in on the dotxf bug.
- Removed -malign-double from bulldozer make_defs.mk. This alignment
  was already happening by default since bulldozer is an x86_64 system.
2018-03-23 12:53:48 -05:00
Field G. Van Zee
22289ad23c Added build system support for libmemkind.
Details:
- Added support for libmemkind to configure. configure attempts to
  detect the presence of libmemkind by compiling a small program
  containing #include <hbwmalloc.h> and a call to hbw_malloc(). If
  successful, it is assumed that libmemkind is present and available.
  If present, use of libmemkind is enabled by default, and otherwise
  use is disabled by default. If libmemkind is present, the user may
  explicitly disable use of the library by running configure with the
  --without-memkind option. Furthermore, a configuration may disable
  libmemkind, perhaps conditional on some aspect of the build system,
  by including -DBLIS_DISABLE_MEMKIND in the configuration's CPPROCFLAGS
  make variable and setting the BLIS_ENABLE_MEMKIND makefile variable,
  set in config.mk, to 'no'. (The knl configuration makes use of this
  latter feature; see below.)
- If enabled at configure-time, bli_system.h will #include <hbwmalloc.h>
  and bli_kernel_macro_defs.h will define BLIS_MALLOC_POOL and
  BLIS_FREE_POOL to use hbw_malloc() and hbw_free(), respectively.
- Deprecated explicit use of BLIS_NO_HBWMALLOC in
  config/knl/bli_family.knl.h and replaced use of -DBLIS_NO_HBWMALLOC in
  config/knl/make_defs.mk with -DBLIS_DISABLE_MEMKIND, which overrides
  (#undefs) the definition of BLIS_ENABLE_MEMKIND in bli_system.h, if it
  would otherwise be defined. Also, set the BLIS_ENABLE_MEMKIND makefile
  variable to 'no'.
- common.mk now adds libmemkind to LDFLAGS if libmemkind is enabled.
2018-03-22 18:21:30 -05:00
Field G. Van Zee
7dc40eafdd Updates to top-level and test driver Makefiles.
Details:
- Added logic to common.mk that will choose a BLIS library against which
  to link (LIBBLIS_LINK). The default choice is the static (.a) library;
  the shared (.so) library is chosen only if the shared library build was
  enabled and the static one was disabled.
- Updated the various test driver Makefiles to reference this common,
  pre-chosen library against which to link. (Previously, these drivers
  unconditionally linked against the static library and would have
  failed if the static library build was disabled at configure-time.)
- Renamed many of the variables in common.mk and the top-level Makefile
  so that variables relating to the libblis.[a|so] files, including
  paths to those files, begin with "LIBBLIS".
- Shuffled around some of the library definitions from the top-level
  Makefile to common.mk.
- Renamed BLIS_ENABLE_DYNAMIC_BUILD to BLIS_ENABLE_SHARED_BUILD, and
  the @enable_dynamic@ anchor to @enable_shared@ in build/config.mk.in
  and in configure.
- A few other cleanups in the top-level Makefile.
2018-03-21 18:39:16 -05:00
Field G. Van Zee
97e1eeade3 Added input.operations.fast file for 'make check'.
Details:
- Added an 'input.operations.fast' file to testsuite directory to go
  along with the 'input.general.fast' file used by the 'make check'
  target in the top-level Makefile. This will allow the "fast" check
  to prune operations and/or parameter combinations from the test
  space in order to save time.
- Currently, input.operations.fast prunes trmm3 and all transposition
  and conjugation parameters from the level-3 test space.
- Reduced problem size tested in input.general.fast to 100 and disabled
  testing of 1m method.
2018-03-21 15:47:11 -05:00
Field G. Van Zee
c441caa95a README update.
Details:
- Minor updates to README.md.
- Minor change to blastest/Makefile.
2018-03-20 17:56:02 -05:00
Field G. Van Zee
6fe018eb4a Added .gitkeep file to blastest/obj.
Details:
- Added an empty file named '.gitkeep' to blastest/obj/ so that git will
  track the otherwise empty directory. (This is already done for the BLIS
  testsuite in testsuite/obj.)
2018-03-20 15:35:45 -05:00
Field G. Van Zee
0e6d000db9 Updated .gitignore to ignore BLAS test out.* files. 2018-03-20 15:08:43 -05:00
Field G. Van Zee
40c040a31d Fixes to .travis.yml.
Details:
- Invoke the full BLIS testsuite via 'make testblis' instead of the fast
  version via 'blistest-fast' (which was wrong anyway, since the correct
  fast traget is 'testblis-fast').
- Invoke the BLAS tests via 'make testblas' instead of 'blastest'.
2018-03-20 14:33:50 -05:00
Field G. Van Zee
664ec4813d Integrated f2c'ed netlib BLAS test suite.
Details:
- Created a new test suite that exercises only the BLAS compatibility
  found in BLIS. The test suite is a straightforward port of code
  obtained from netlib LAPACK, run through f2c and linked to a stripped-
  down version of libf2c that is compiled along with the test drivers
  (to prevent any obvious ABI issues). The new BLAS test suite can be
  run from within its new local directory, 'blastest' (through its local
  'make ; make run' targets) or from the top-level Makefile (via the
  'make testblas' target). Output files are created in whatever directory
  the test drivers are run, whether it be the 'blastest' directory, the
  top-level source distribution directory, or the out-of-tree directory
  in which 'configure' was run. Also, the results of the BLAS test suite
  can be checked via 'make checkblas', which summarizes the presence or
  absence of test failures in a single line printed to stdout.
- Updated the 'test' target to run both 'testblis' and 'testblas'.
- Added a new 'testblis-fast' target that runs the BLIS testsuite with
  smaller problem sizes, allowing it to finish more quickly.
- Added a 'make check' target, which runs 'checkblis-fast' and
  'checkblas'.
- Changed .travis.yml so that Travis CI runs 'testblis-fast' instead of
  'testblis' before (calling the check-blistest.sh script to check the
  result manually).
- Renamed some targets in the top-level Makefile to be consistent between
  BLAS and BLIS.
2018-03-20 13:54:58 -05:00
Field G. Van Zee
40fa10396c Fixed a few obscure bugs in the BLAS API.
Details:
- Fixed a missing parameter in the definition of sdsdot_(). The 'sb'
  argument was missing. Strangely, the argument is omitted from dsdot_()
  in the BLAS API.
- Fixed the missing 'c' or 'u' in the "?gerc" or "?geru" operation string
  passed to xerbla_() by the bla_ger_check() macro.
- For bla_syrk_check() and bla_syr2k_check() macros, only allow
  conjugate-transpose (trans='c') as a valid argument for the real
  domain functions [sd]syrk_() and [sd]syr2k_(). (Previously, the
  argument was allowed even for the complex domain equivalents, which
  was inconsistent with the BLAS API.)
2018-03-19 18:19:43 -05:00
Field G. Van Zee
fe7d7f1e43 Fixed cpp macro parameter "ch" typo in bla_ger.c.
Details:
- Previously, the BLAS routine-generating macro in bla_ger.c was
  incorrectly passing MKSTR(ch) into the _check() macro when it
  should have been passing in the char that was available, chxy.
  I've instead changed the name of the macro parameter from chxy
  to ch. Similar change as made to bla_ger.h for consistency.
  Thanks to Dave Love in helping track this down. (NOTE: This is
  actually the root cause of the bug that was first patched by
  increasing the length of the operation name strings passed into
  xerbla_(), as defined by the constant BLIS_MAX_BLAS_FUNC_STR_LENGTH,
  in 3d1a5a7. In theory, that change could be backed out now.)
- Applied aforementioned chxy->ch change to bla_dot.[ch], as well as
  frame/compat/cblas/f77_sub/f77_dot_sub.[ch] (not because it needed
  to happen, but for naming consistency).
- Reformatted function signatures/prototypes of CBLAS functions and
  function calls to BLAS in frame/compat/cblas/f77_sub/*.c.
2018-03-18 19:43:06 -05:00
Field G. Van Zee
cb7ed90752 Convert op names to uppercase before calling xerbla_().
Details:
- Defined a new function, bli_string_mkupper(), that calls toupper() on
  every non-NULL character in a string.
- Call bli_string_mkupper() prior to calling xerbla_() in the level-2/-3
  BLAS _check() macros. This prevents the BLAS testsuite from complaining
  that the operation name (e.g. "dgemm") does not match the expected
  value (e.g. "DGEMM"). Thanks to Dave Love for reporting this issue.
2018-03-16 13:05:56 -05:00
Field G. Van Zee
3d1a5a7c08 Fixed printf() format overflow.
Details:
- Increased the length of operation name strings passed to xerbla_() in
  the level-2 and level-3 operation _check() functions, found in
  frame/compat/check. This avoids a format specifier overflow warning by
  gcc 7. Thanks to Dave Love for reporting this issue and suggesting the
  fix.
2018-03-16 12:24:07 -05:00
Field G. Van Zee
c73055f028 Return after non-zero info in BLAS checks.
Details:
- Previously, when calling the BLAS compatibility layer, discovering a
  parameter check failure would result in the proper setting of the
  info parameter (printed by xerbla_()), but would also come with an
  immediate abort() rather than a return. This was incorrect behavior
  for two overlapping reasons.
  (1) BLAS should return gracefully to the caller in the event of a
      bad set of parameters, not abort().
  (2) When BLIS was being tested via the BLAS testsuite, BLIS's
      xerbla_() would correctly get preempted/overridden by the
      xerbla_() in the BLAS testsuite, but execution would then
      erroneously continue on to the BLIS implementation with bad
      parameter values.
- The previous issue was addressed by disabling the abort() in BLIS's
  xerbla_(), changing all of the BLAS _check() functions to cpp macros,
  and adding a return statement to the end of each _check() macro's
  "if ( info != 0 )" conditional.
  Thanks to Dave Love for reporting this issue.
2018-03-15 16:08:21 -05:00
Field G. Van Zee
c4f1d18b97 Minor typo fix to printing arch in testsuite.
Details:
- Mistakenly was calling bli_cpuid_query_id() instead of
  bli_arch_query_id() in the recent addition to the testsuite output
  that prints the active sub-configuration. The former function is
  only used for multi-architecture builds, whereas the latter is the
  more general option that also works for single configuration
  (including 'configure auto') builds.
2018-03-14 19:10:09 -05:00
Devin Matthews
8f2fabec80 Make arm32 and arm64 families work. (#176) 2018-03-14 17:43:42 -05:00
Field G. Van Zee
fc6a184251 Print sub-configuration name in testsuite output.
Details:
- Added a line to the testsuite output that prints the name of the
  current/active sub-configuration. This is useful when linking the
  testsuite against multi-configuration builds because it confirms
  the sub-configuration that is actually being employed at runtime.
  Thanks to Devin Matthews for suggesting this feature.
2018-03-14 15:31:17 -05:00
Devin Matthews
9943a899d6 Merge pull request #173 from devinamatthews/dev
Fix Cortex-A9 and Cortex-A15 configs.
2018-03-14 13:27:44 -05:00
Devin Matthews
b1a15ae6ee Use BLIS_H_FLAT 2018-03-14 13:26:44 -05:00
Field G. Van Zee
290dd4a9fe Allow arbitrarily deep configuration families.
Details:
- Updated configure so that configuration families specified in the
  config_registry are no longer constrained as being only one level
  deep. For example, previously the x86_64 family could not be defined
  concisely in terms of, say, intel64 and amd64 families, and instead
  had to be defined as containing "haswell, sandybridge, penryn, zen,
  etc." In other words, families were constrained to only having
  singleton configurations as their members. That constraint is now
  lifted.
- Redefined x86_64 family in config_registry in terms of intel64 and
  amd64.
2018-03-14 13:15:37 -05:00
Devin Matthews
9cee78e006 Fix Cortex-A9 and Cortex-A15 configs.
Tested with QEMU.
2018-03-14 13:09:48 -05:00
Field G. Van Zee
1a3031740f Updates to ARM hardware detection support.
Details:
- Updated/clarified the ARM preprocessor macro branch of bli_cpuid.c.
  Going forward, cortexa57 (64-bit), cortexa15, and cortexa9 (32-bit)
  sub-configurations are supported. However, the functions that detect
  features specific to a15 and a9 are identical, and since a15 is tested
  first, it will always be chosen for arm32 hardware (even if both
  sub-configurations were enabled at configure-time and the library is
  linked and run on an a9). Thus, more work needs to be done to
  distinguish these two.
- Added cpp guard around x86_64 portions of bli_cpuid.c. Now, either
  the x86_64 or ARM code will be compiled (or neither, if neither
  environment is detected).
- In bli_arch_query_id(), call bli_cpuid_query_id() when the
  BLIS_FAMILY_ARM64 or BLIS_FAMILY_ARM32 macros are defined.
- Added arm64 and arm32 configuration families to config_registry.
- Added a note to the arch_t typedef enum in bli_type_defs.h reminding
  the developer to update the string array in bli_arch.c whenever new
  enum values are added or existing values are reordered.
2018-03-13 16:04:40 -05:00
Field G. Van Zee
1442d06886 Fixed misnamed kernels in _cntx_init_cortexa57.c.
Details:
- Changed incorrect kernel function names in bli_cntx_init_cortexa57.c:
    bli_sgemm_cortexa57_asm_8x12 -> bli_sgemm_armv8a_asm_8x12
    bli_dgemm_cortexa57_asm_6x8  -> bli_dgemm_armv8a_asm_6x8
  Thanks to Jacob Gorm Hansen for reporting this issue.
2018-03-11 16:59:50 -05:00
Field G. Van Zee
48da9f5805 Tweaked common.mk, Makefile, skx/knl make_defs.mk.
Details:
- Reorganized linker-related section of common.mk so that LDFLAGS set
  in a sub-configuration's make_defs.mk file will not be immediately
  (and erroneously) overridden by the default values.
- Re-enabled redirected (to file) output of the testsuite when run from
  the top-level Makefile via 'make test'. (For some reason, it was
  commented-out for the non-verbose case.)
- Removed old/unnecessary code from the make_defs.mk files of skx and
  knl sub-configurations.
2018-03-07 12:54:06 -06:00
Field G. Van Zee
8b0475a87d Fixed typo in attempted fix in 1a8350f7.
Details:
- Mistakenly entered 148 as knl mc blocksize for double real when the
  value should have been 144. Thanks to Dave Love for reporting this.
2018-03-06 06:39:44 -06:00
Field G. Van Zee
8912e6886b Fixed missing flags during shared object build.
Details:
- Fixed a bug in common.mk that caused warning, position-independent
  code, miscellaneous, and general preprocessor flags to be omitted
  from the configuration family-specific variables that hold those
  values, as registered by the family's make_defs.mk file. This would
  most obviously manifest when targeting a configuration family such as
  'intel64' while simultaneously configuring for a shared object build,
  as the key '-fPIC' flag would be omitted at compile-time and prevent
  successful linking. Thanks to Dave Love for reporting this bug.
- Other cleanups to common.mk for readability and clarity.
2018-03-05 18:00:45 -06:00
Field G. Van Zee
1a8350f705 Fixed cache blocksize bug in knl configuration.
Details:
- Changed the mc blocksize for double real execution in the knl sub-
  configuration from 160 to 148. The old value was not a multiple of
  mr (which is 24), and thus the safeguards in bli_gks_register_cntx()
  were tripping. Thanks for Dave Love for reporting this issue.
- Switch knl sub-configuration to use default blocksizes for datatypes
  not supported by native kernels.
- Fixed typos in bli_error.c that prevented certain error strings
  (which report maximum cache blocksizes not being multiples of their
  corresponding register blocksize) from properly initializing.
2018-03-05 13:32:00 -06:00
Field G. Van Zee
c09fffa827 Added missing cntx_t* arg in knl packm kernels.
Details:
- Added the missing cntx_t* argument to the function signature of packm
  kernels in kernels/knl/1m/. Thanks to Dave Love for reporting this
  issue.
2018-03-03 13:13:39 -06:00
Field G. Van Zee
1ef9360b1f Enable non-unit vector stride tests by default.
Details:
- Change "vector storage schemes to test" parameter in testsuite's
  input.general file to "cj". This means that both unit stride column
  vectors and non-unit stride column vectors will be tested in
  operations with vector operands (e.g. level-1v, level-1f, level-2).
- Very minor comment (typo) changes to input.operations.
2018-03-01 14:36:39 -06:00
Field G. Van Zee
8c4e55a1a1 Added individual operation overrides in testsuite.
Details:
- Updated the testsuite driver so that setting one or more individual
  operation test switches to "2" in input.operations will enable ONLY
  those operations and disable all others, regardless of the values of
  the section overrides and other operation switches. This makes it
  every easy to quickly test only one or two operations, and equally
  easy to revert back to the previous combination of operation tests.
- Added more comments to input.operations describing the use of
  individual "enable only" overrides.
2018-02-28 17:01:47 -06:00
Field G. Van Zee
34862aed89 Use zen kernels in haswell sub-configuration.
Details:
- Register use of level-1v zen intrinsic kernels for amaxv, axpyv, dotv,
  dotxv, and scalv, as well asl level-1f zen intrinsic kernels for axpyf
  and dotxf. This works because these kernels simply target AVX/AVX2,
  and therefore work without modification on haswell hardware.
- Switch to use of zen microkernels in bli_cntx_init_haswell.c. The zen
  kernels are essentially identical to those used by haswell, except that
  now zen kernels are a bit more up-to-date. In the future, I may
  continue to maintain duplicates, or I may keep the kernels named after
  one architecture (zen or haswell) but used by both sub-configurations.
- In config_registry, enable use of both haswell and zen kernels for the
  haswell sub-configuration. This is necessary in order to make zen
  kernels visible when registering kernels in bli_cntx_init_haswell.c.
- Enable use of assembly-based complex gemm microkernels for zen,
  bli_cgemm_zen_asm_3x8() and bli_zgemm_zen_asm_3x4(), in
  bli_cntx_init_zen.c. This was actually intended for 1681333.
2018-02-28 15:30:14 -06:00
Field G. Van Zee
d9079655c9 CHANGELOG update (0.3.0) 2018-02-23 17:42:48 -06:00
Field G. Van Zee
709f8361eb Version file update (0.3.0) 0.3.0 2018-02-23 17:42:48 -06:00
Field G. Van Zee
3defc7265c Applied 34b72a3 to non-active/unused microkernels.
Details:
- Applied the read-beyond-bounds bugfix in 34b72a3 to other haswell and
  zen kernels (ie: other microtile shapes) which are not used by default.
  This was done mostly in case someone decided to pick up these kernels
  and start using them, not because it affects BLIS's behavior
  out-of-the-box.
2018-02-23 17:38:19 -06:00
Field G. Van Zee
34b72a3517 Fixed obscure read-beyond-bounds bug in sgemm ukrs.
Details:
- Fixed an obscure bug in the bli_sgemm_haswell_asm_6x16 and
  bli_sgemm_zen_asm_6x16 microkernels when the input/output matrix C
  is stored with general stride (ie: both rs and cs are non-unit). The
  bug was rooted in the way those microkernels read from matrix C--
  namely, they used vmovlps/vmovhps instead of movss. By loading two
  floats at a time, even if one of them was treated as junk, the
  assembly code could be written in a more concise manner. However,
  under certain conditions--if m % mr == 0 and n % nr == 0 and the
  underlying matrix is not an internal "view" into a larger matrix--
  this could result in the very last vmovhps of the last (bottom-right)
  microkernel invocation reading beyond valid memory. Specifically, the
  low 32 bits read would always be valid, but the high 32 bits could
  reside beyond the bounds of the array in which the output C matrix is
  contained. To remedy this situation, we now selectively use movss to
  load any element that could be the last element in the matrix.
2018-02-23 16:33:32 -06:00
Field G. Van Zee
5112e1859e Added missing 'restrict' to some kernels' cntx_t*.
Details:
- Added missing 'restrict' keyword to cntx_t* argument of function
  signatures corresponding to level-1v, level-1f, and level-1m kernels.
  This affected bli_l1v_ker_prot.h, bli_l1f_ker_prot.h, and
  bli_l1m_ker_prot.h. (The 'restrict' was already being used to
  qualify cntx_t* arguments for kernels defined in bli_l3_ker_prot.h.)
- Added comments to bli_l1v_ker.h, bli_l1f_ker.h, bli_l1m_ker.h, and
  bli_l3_ukr.h that help explain how those headers function to produce
  kernel prototypes using the prototype macros defined in the files
  mentioned above.
2018-02-23 14:31:26 -06:00
Field G. Van Zee
1fa8af95d8 Merge branch 'rt' 2018-02-21 17:54:02 -06:00
Field G. Van Zee
c084b03b31 Merge branch 'rt' 2018-02-21 17:52:17 -06:00
Field G. Van Zee
16813335bd Merge branch 'amd' into rt
Details:
- Merged contributions made by AMD via 'amd' branch (see summary below).
  Special thanks to AMD for their contributions to-date, especially with
  regard to intrinsic- and assembly-based kernels.
- Added column storage output cases to microkernels in
  bli_gemm_zen_asm_d6x8.c and bli_gemmtrsm_l_zen_asm_d6x8.c. Even with
  the extra cost of transposing the microtile in registers, this is
  much faster than using the general storage case when the underlying
  matrix is column-stored.
- Added s and d assembly-based zen gemmtrsm_u microkernel (including
  column storage optimization mentioned above).
- Updated zen sub-configuration to reflect presence of new native
  kernels.
- Temporarily reverted zen sub-configuration's level-3 cache blocksizes
  to smaller haswell values.
- Temporarily disabled small matrix handling for zen configuration
  family in config/zen/bli_family_zen.h.
- Updated zen CFLAGS according to changes in 1e4365b.
- Updated haswell microkernels such that:
  - only one vzeroupper instruction is called prior to returning
  - movapd/movupd are used in leiu of movaps/movups for double-real
    microkernels. (Note that single-real microkernels still use
    movaps/movups.)
- Added kernel prototypes to kernels/zen/bli_kernels_zen.h, which is
  now included via frame/include/bli_arch_config.h.
- Minor updates to bli_amaxv_ref.c (and to inlined "test" implementation
  in testsuite/src/test_amaxv.c).
- Added early return for alpha == 0 in bli_dotxv_ref.c.
- Integrated changes from f07b176, including a fix for undefined
  behavior when executing the 1m method under certain conditions.
- Updated config_registry; no longer need haswell kernels for zen
  sub-configuration.
- Tweaked marginal and pass thresholds for dotxf.
- Reformatted level-1v, -1f, and -3 amd kernels and inserted additional
  comments.
- Updated LICENSE file to explicitly mention that parts are copyright
  UT-Austin and AMD.
- Added AMD copyright to header templates in build/templates.

Summary of previous changes from 'amd' branch.
- Added s and d assembly-based zen gemm microkernels (d6x8 and d8x6) and
  s and d assembly-based zen gemmtrsm_l microkernels (d6x8).
- Added s and d intrinsics-based zen kernels for amaxv, axpyv, dotv, dotxv,
  and scalv, with extra-unrolling variants for axpyv and scalv.
- Added a small matrix handler to bli_gemm_front(), with the handler
  implemented in kernels/zen/3/bli_gemm_small_matrix.c.
- Added additional logic to sumsqv that first attempts to compute the
  sum of the squares via dotv(). If there is a floating-point exception
  (FE_OVERFLOW), then the previous (numerically conservative) code is
  used; otherwise, the result of dotv() is square-rooted and stored as
  the result. This new implementation is only enabled when FE_OVERFLOW
  is #defined. If the macro is not #defined, then the previous
  implementation is used.
- Added axpyv and dotv standalone test drivers to test directory.
- Added zen support to old cpuid_x86.c driver in build/auto-detect/old.
- Added thread-local and __attribute__-related macros to bli_macro_defs.h.
2018-02-21 17:43:32 -06:00
Devin Matthews
5d03b6e6e1 Fix asm macro include line for KNL. Fixes #167. 2018-02-19 11:31:30 -06:00
Field G. Van Zee
f07b176c84 Fixed an obscure bug in the 1m implementation.
Details:
- Fixed a bug in the way the bli_gemm1m_cntx_ref() function (defined in
  ref_kernels/bli_cntx_ref.c) initializes its context for 1m execution.
  Previously, the function probed the context that was in the process of
  being updated for use with 1m--this context being previously
  initialized/copied from a native context--for its storage preference
  to determine which "variant" (row- or column-oriented) of 1m would be
  needed. However, the _cntx_ref() function was not updating the method
  field of the context until AFTER this query, and the conditional which
  depended on it, had taken place, meaning the storage preference query
  function would mistakenly think the context was for native execution,
  since the context's method field would still be set to BLIS_NAT. This
  would lead it to incorrectly grab the storage preference of the complex
  domain microkernel rather than the corresponding real domain
  microkernel, which could cause the storage preference predicate to
  evaluate to the wrong value, which would lead to the _cntx_ref()
  function choosing the wrong variant. This could lead to undefined
  behavior at runtime. The method is now explicitly set within the
  context prior to calling the storage preference query function.
- Updated comments in frame/ind/oapi/bli_l3_3m4m1m_oapi.c.
- Fixed a typo in the commented-out CFLAGS in config/zen/make_defs.mk,
  which are appropriate for gcc 6.x and newer. (Mistakenly used
  -march=bdver4 instead of -march=znver1.)
2018-02-15 18:36:54 -06:00
Field G. Van Zee
1f94bb7b96 Document how to enable zen-specific instructions.
Details:
- Added as a comment in config/zen/make_defs.mk the list of compiler flags
  that could be added to manually enable the instructions provided by the
  Zen microarchitecture that are not already implied by -march=bdver4.
  This information, along with the previous commit's flags to selectively
  disable Bulldozer instructions no longer present in Zen, was gathered
  from [1]. I hesitate to enable use of these instructions since I don't
  have any Zen hardware to test on yet.
  [1] https://wiki.gentoo.org/wiki/Ryzen
2018-01-19 12:46:53 -06:00
Field G. Van Zee
1e4365b21b Augment zen CFLAGS to prevent illegal instruction.
Details:
- Added various compiler flags (-mno-fma4 -mno-tbm -mno-xop -mno-lwp) so
  that compiling with -march=bdver4 on zen-based architectures does not
  result in an illegal instruction error at runtime. Note: This fix is
  only needed for gcc 5.4; gcc 6.3 or later supports the use of
  -march=znver1, which can be used in lieu of the augmented set of flags
  based on bdver4. Thanks to Nisanth Padinharepatt for reporting this
  error.
2018-01-18 12:03:51 -06:00
Field G. Van Zee
fa74af4e1f Minor labeling update for './configure -c' output.
Details:
- Print the name of the configuration in the output of the
  kernel-to-config map (and chosen pairs list) as a subtle way to remind
  the user that these only apply to the targeted configuration (whereas
  the config list and kernel list are printed without regard to which
  configuration was actually targeted).
2018-01-09 13:43:15 -06:00