Commit Graph

4 Commits

Author SHA1 Message Date
Field G. Van Zee
31c8657f1d Added support for pre-broadcast when packing B.
Details:
- Added support for being able to duplicate (broadcast) elements in
  memory when packing matrix B (ie: the left-hand operand) in level-3
  operations. This turns out advantageous for some architectures that
  can afford the cost of the extra bandwidth and somehow benefit from
  the pre-broadcast elements (and thus being able to avoid using
  broadcast-style load instructions on micro-rows of B in the gemm
  microkernel).
- Support optionally disabling right-side hemm and symm. If this occurs,
  hemm_r is implemented in terms of hemm_l (and symm_r in terms of
  symm_l). This is needed when broadcasting during packing because the
  alternative--supporting the broadcast of B while also allowing matrix
  B to be Hermitian/symmetric--would be an absolute mess.
- Support alignment factors for packed blocks of A, B, and C separately
  (as well as for general-purpose buffers). In addition, we support
  byte offsets from those alignment values (which is different from
  aligning by align+offset bytes to begin with). The default alignment
  values are BLIS_PAGE_SIZE in all four cases, with the offset values
  defaulting to zero.
- Pass pack_t schema into bli_?packm_cxk() so that it can be then passed
  into the packm kernel, where it will be needed by packm kernels that
  perform broadcasts of B, since the idea is that we *only* want to
  broadcast when packing micropanels of B and not A.
- Added definition for variadic bli_cntx_set_l3_vir_ukrs(), which can be
  used to set custom virtual level-3 microkernels in the cntx_t, which
  would typically be done in the bli_cntx_init_*() function defined in
  the subconfiguration of interest.
- Added a "broadcast B" kernel function for use with NP/NR = 12/6,
  defined in in ref_kernels/1m/bli_packm_cxk_bb_ref.c.
- Added a gemm, gemmtrsm, and trsm "broadcast B" reference kernels
  defined in ref_kernels/3/bb. (These kernels have been tested with
  double real with NP/NR = 12/6.)
- Added #ifndef ... #endif guards around several macro constants defined
  in frame/include/bli_kernel_macro_defs.h.
- Defined a few "broadcast B" static functions in
  frame/include/level0/bb for use by "broadcast B"-style packm reference
  kernels. For now, only the real domain kernels are tested and fully
  defined.
- Output the alignment and offset values for packed blocks of A and B
  in the testsuite's "BLIS configuration info" section.
- Comment updates to various files.
- Bumped so_version to 3.0.0.
2019-09-17 17:42:10 -05:00
Field G. Van Zee
f808d829c5 Handle edge cases, zero-filling in packm kernels.
Details:
- Updated the API and semantics of packm kernels such that they must now
  handle edge cases, meaning that a c-by-k packm kernel must be able to
  pack edge cases that are fewer than c rows/columns and be able to
  zero-fill the remaining elements. They must also be able to zero-fill
  the equivalent region when copying fewer than k columns/rows (which is
  needed by trsm). The new packm kernel API is generally:

    void packm_kernel
         (
           conj_t           conja,
           dim_t            cdim,
           dim_t            n,
           dim_t            n_max,
           ctype*  restrict kappa,
           ctype*  restrict a, inc_t inca, inc_t lda,
           ctype*  restrict p,             inc_t ldp,
           cntx_t* restrict cntx
         );

  where cdim and n are the dimensions (short and long, respectively) of
  the submatrix being copied from the source matrix A, and n_max is the
  "full" long dimension (corresponding to the k dimension in gemm) of
  the micropanel. The "full" short dimension (corresponding to the
  register blocksize MR or NR) is not part of the API because it is
  known intrinsically by the packm kernel implementation. Thanks to
  Devin Matthews for prompting us to make this change (#282).
- Updated all reference packm kernels in ref_kernels/1m according to
  above changes, as well as all optimized packm kernels (which only
  consisted of those for knl).
- Bumped the major soname version number in 'so_version' to 2. At first
  I was considering leaving it unchanged, but I couldn't escape the
  reality that the packm kernel API is much closer to an expert API
  than it is some obscure helper function interface within the framework
  that nobody would ever notice.
- Removed reference packm kernels for mr/nr = 30. The only sub-config
  that would have been using those kernels is knc, which is likely no
  longer being used by very many people (if any). (This also mostly
  offset the larger object code footprint incurred by moving the edge-
  case handling into the individual packm kernels.)
- Fixed an obscure race condition for 3mh and 4mh induced methods in
  which those implementations were modifying the contexts stored in the
  gks rather than a local copy.
- Fixed a minor bug in the testsuite that prevented non-1m-based induced
  method implementations of trsm from executing.
2018-12-12 15:22:59 -06:00
Field G. Van Zee
e88aedae73 Separated expert, non-expert typed APIs.
Details:
- Split existing typed APIs into two subsets of interfaces: one for use
  with expert parameters, such as the cntx_t*, and one without. This
  separation was already in place for the object APIs, and after this
  commit the typed and object APIs will have similar expert and non-
  expert APIs. The expert functions will be suffixed with "_ex" just as
  is the case for expert interfaces in the object APIs.
- Updated internal invocations of typed APIs (functions such as
  bli_?setm() and bli_?scalv()) throughout BLIS to reflect use of the
  new explictly expert APIs.
- Updated example code in examples/tapi to reflect the existence (and
  usage) of non-expert APIs.
- Bumped the major soname version number in 'so_version'. While code
  compiled against a previous version/commit will likely still work
  (since the old typed function symbol names still exist in the new API,
  just with one less function argument) the semantics of the function
  have changed if the cntx_t* parameter the application passes in is
  non-NULL. For example, calling bli_daxpyv() with a non-NULL context
  does not behave the same way now as it did before; before, the
  context would be used in the computation, and now the context would
  be ignored since the interace for that function no longer expects a
  context argument.
2018-07-06 19:14:02 -05:00
Field G. Van Zee
b699bb1ff0 Adopt Linux-like .so versioning at install-time.
Details:
- Changed the naming conventions used for installed libraries and
  symlinks to more closely mirror patterns used by typical GNU/Linux
  libraries. Whereas previously static and shared libraries were
  installed and symlinked as follows:

    (library) libblis-0.3.2-15-haswell.a
    (library) libblis-0.3.2-15-haswell.so
    (symlink) libblis.a -> libblis-0.3.2-15-haswell.a
    (symlink) libblis.so -> libblis-0.3.2-15-haswell.so

  we now use the following naming conventions:

    (library) libblis.a
    (symlink) libblis.so -> libblis.so.0.1.2
    (symlink) libblis.so.0 -> libblis.so.0.1.2
    (library) libblis.so.0.1.2

  where 0.1.2 indicates shared library major, minor, and build versions
  of 0, 1, and 2, respectively. The conventional version string can
  still be queried by linking to the library in question and then calling
  bli_info_get_version_str(). (The testsuite binary does this
  automatically at startup.)
- Added logic to common.mk to set the soname field in the shared library
  via the -soname linker flag.
- Added a 'so_version' file to the top-level directory containing two
  lines. The first line specifies the .so major version number, and the
  second line specifies the minor and build version numbers joined with
  a '.'. This file is read by configure and those values substituted
  into build/config.mk.in to define SO_MAJOR, SO_MINORB, and SO_MMB
  variables.
2018-05-10 15:54:17 -05:00