Commit Graph

113 Commits

Author SHA1 Message Date
Field G. Van Zee
4c3dd93eba Use kernel CFLAGS for 'kernels' subdirs in addons. (#658)
Details:
- Updated Makefile and common.mk so that the targeted configuration's
  kernel CFLAGS are applied to source files that are found in a
  'kernels' subdirectory within an enabled addon. For now, this
  behavior only applies when the 'kernels' directory is at the top
  level of the addon directory structure. For example, if there is an
  addon named 'foobar', the source code must be located in
  addon/foobar/kernels/ in order for it to be compiled with the target
  configurations's kernel CFLAGS. Any other source code within
  addon/foobar/ will be compiled with general-purpose CFLAGS (the same
  ones that were used on all addon code prior to this commit). Thanks
  to AMD (esp. Mithun Mohan) for suggesting this change and catching an
  intermediate bug in the PR.
- Comment/whitespace updates.

(cherry picked from commit fd885cf98f)
Change-Id: I9a678f78bde90b23a6293ce90377004876f51067
2022-09-27 06:37:38 -04:00
mkadavil
584069bf74 Parametric ReLU post-ops support for u8s8s32 and u8s8s16 GEMM.
-Parametric ReLU is the generalization of leaky ReLU in which the
leakage coefficient is tunable. The support for the same is added
following the register-level fusion technique.
-Low precision bench enhancement to check accuracy/performance of
low precision gemm with PReLU.
-Bug fixes in low precision gemm kernels.

AMD-Internal: [CPUPL-2442]
Change-Id: I81336405b185a994297d122b2d868b758ae6dad5
2022-08-25 13:33:02 +05:30
eashdash
4e3e00fb7e Added low precision GEMM - bf16bf16f32of32
Feature Addition: Added a new variant of low precision GEMM to addon - BFloat16. The kernel takes bf16 type inputs and perform BF16 GEMM operations. The intermediate accumulation and output are in float.

1. Compute kernels will perform computations only if B matrix is reordered in accordance with the usage of AVX-512 BF16 instruction - dpbf16_ps
2. Kernel for packing B matrix is provided

Change-Id: If5d08213068869eff060c9998596d2d2703a6793
2022-08-24 03:27:00 -04:00
mkadavil
6c112632a7 Low precision gemm integrated as aocl_gemm addon.
- Multi-Threaded int8 GEMM (Input - uint8_t, int8_t, Output - int32_t).
AVX512_vnni based micro-kernel for int8 gemm. Paralellization supported
along m and n dimensions.
- Multi-Threaded B matrix reorder support for sgemm. Reordering B matrix
is packing entire B matrix upfront before sgemm. It allows sgemm to
take advantage of packed B matrix without incurring packing costs during
runtime.
- Makefile updates to addon make rules to compile avx512 code for
selected files in addon folder.
- CPU features query enhancements to check for AVX512_VNNI flag.
- Bench for int8 gemm and sgemm with B matrix reorder. Supports
performance mode for benchmarking and accuracy mode for testing code
correctness.

AMD-Internal: [CPUPL-2102]

Change-Id: I8fb25f5c2fbd97d756f95b623332cb29e3b8d182
2022-06-09 10:28:38 -04:00
Field G. Van Zee
7a0ba4194f Added support for addons.
Details:
- Implemented a new feature called addons, which are similar to
  sandboxes except that there is no requirement to define gemm or any
  other particular operation.
- Updated configure to accept --enable-addon=<name> or -a <name> syntax
  for requesting an addon be included within a BLIS build. configure now
  outputs the list of enabled addons into config.mk. It also outputs the
  corresponding #include directives for the addons' headers to a new
  companion to the bli_config.h header file named bli_addon.h. Because
  addons may wish to make use of existing BLIS types within their own
  definitions, the addons' headers must be included sometime after that
  of bli_config.h (which currently is #included before bli_type_defs.h).
  This is why the #include directives needed to go into a new top-level
  header file rather than the existing bli_config.h file.
- Added a markdown document, docs/Addons.md, to explain addons, how to
  build with them, and what assumptions their authors should keep in
  mind as they create them.
- Added a gemmlike-like implementation of sandwich gemm called 'gemmd'
  as an addon in addon/gemmd. The code uses a 'bao_' prefix for local
  functions, including the user-level object and typed APIs.
- Updated .gitignore so that git ignores bli_addon.h files.

Change-Id: Ie7efdea366481ce25075cb2459bdbcfd52309717
2022-03-31 12:03:27 +05:30
Dipal M Zambare
f63f78d783 Removed Arch specific code from BLIS framework.
- Removed BLIS_CONFIG_EPYC macro
- The code dependent on this macro is handled in
  one of the three ways

  -- It is updated to work across platforms.
  -- Added in architecture/feature specific runtime checks.
  -- Duplicated in AMD specific files. Build system is updated to
      pick AMD specific files when library is built for any of the
     zen architecture

AMD-Internal: [CPUPL-1960]
Change-Id: I6f9f8018e41fa48eb43ae4245c9c2c361857f43b
2022-01-18 11:51:08 +05:30
Dipal M Zambare
3364c0e4eb Binary and dynamic dispatch configuration name change
-- Reverted changes made to include lp/ilp info in binary name
     This reverts commit c5e6f885f0.

  -- Included BLAS int size in 'make showconfig'

  -- Renamed amdepyc configuration to amdzen

Change-Id: Ie87ec1c03e105f606aef1eac397ba0d8338906a6
2021-11-12 08:58:56 +05:30
Dipal M Zambare
d1fb770f1c Removed duplicate cpp and testcpp folders.
The cpp and testcpp folder exists in root directory as well as vendor
directory. Only folder in vendor directory are needed.

Removed duplicate directories and updated makefiles to pick the
sources from vendor folder.

AMD-Internal: [CPUPL-1834]
Change-Id: I178043a09fd746660938b89ecce73c53d6c53409
2021-11-12 08:58:49 +05:30
Dipal M Zambare
d2313bb4e6 Update show config to include missing info.
-- Ignore aocl dynamic configuration if multithreading is disabled.
     AOCL Dynamic will also be disabled in this case.
  -- Added following configuration settings in showconfig output
     1. Complex return scheme
     2. TRSM preinversion status
     3. AOCL dynamic active status

AOCL-Internal: [CPUPL-1565]
Change-Id: Id5a31b233fc08dcd871de4a693aab0b2a5d9f1c4
2021-06-29 12:03:47 +05:30
Dipal M Zambare
7454cca9e7 Updated makefiles to fix issues introduced in merge
- Updated Makefile to include DTL files in library build
   - Updated Makefile to include cpp header file installation
   - Updated test/makefile to include extra API added by AMD team.

AMD-Internal: [CPUPL-1559]
Change-Id: I249c6935d5ff5fb645f9deec7e0218575484be13
2021-05-05 14:59:15 +05:30
lcpu
7401effc03 BLIS:merge:
Merge conflicts araised has been fixed while downstreaming BLIS code from master to milan-3.1 branch

Implemented an automatic reduction in the number of threads when the user requests parallelism via a single number (ie: the automatic way) and (a) that number of threads is prime, and (b) that number exceeds a minimum threshold defined by the macro BLIS_NT_MAX_PRIME, which defaults to 11. If prime numbers are really desired, this feature may be suppressed by defining the macro BLIS_ENABLE_AUTO_PRIME_NUM_THREADS in the appropriate configuration family's bli_family_*.h. (Jeff Diamond)

Changed default value of BLIS_THREAD_RATIO_M from 2 to 1, which leads to slightly different automatic thread factorizations.

Enable the 1m method only if the real domain microkernel is not a reference kernel. BLIS now forgoes use of 1m if both the real and complex domain kernels are reference implementations.

Relocated the general stride handling for gemmsup. This fixed an issue whereby gemm would fail to trigger to conventional code path for cases that use general stride even after gemmsup rejected the problem. (RuQing Xu)

Fixed an incorrect function signature (and prototype) of bli_?gemmt(). (RuQing Xu)

Redefined BLIS_NUM_ARCHS to be part of the arch_t enum, which means it will be updated automatically when defining future subconfigs.

Minor code consolidation in all level-3 _front() functions.

Reorganized Windows cpp branch of bli_pthreads.c.

Implemented bli_pthread_self() and _equals(), but left them commented out (via cpp guards) due to issues with getting the Windows versions working. Thankfully, these functions aren't yet needed by BLIS.

Allow disabling of trsm diagonal pre-inversion at compile time via --disable-trsm-preinversion.

Fixed obscure testsuite bug for the gemmt test module that relates to its dependency on gemv.

AMD-internal-[CPUPL-1523]

Change-Id: I0d1df018e2df96a23dc4383d01d98b324d5ac5cd
2021-04-27 11:09:48 +05:30
Ajay Panyala
b3953b938e drop CFLAGS in the generated pkgconfig file 2021-01-12 17:07:04 -08:00
Ajay Panyala
d8d8deeb6d generate pkgconfig file 2021-01-11 17:47:50 -08:00
Devin Matthews
328b4f8872 Shared object (dylib) was not built correctly for partial build.
The SO build rule used $? instead of $^. Observed on macOS, not sure if it affected Linux or not.
2020-12-30 17:54:18 -06:00
Field G. Van Zee
88ad841434 Squash-merge 'pr' into 'squash'. (#457)
Merged contributions from AMD's AOCL BLIS (#448).
  
Details:
- Added support for level-3 operation gemmt, which performs a gemm on
  only the lower or upper triangle of a square matrix C. For now, only
  the conventional/large code path will be supported (in vanilla BLIS).
  This was accomplished by leveraging the existing variant logic for
  herk. However, some of the infrastructure to support a gemmtsup is
  included in this commit, including
  - A bli_gemmtsup() front-end, similar to bli_gemmsup().
  - A bli_gemmtsup_ref() reference handler function.
  - A bli_gemmtsup_int() variant chooser function (with variant calls
    commented out).
- Added support for inducing complex domain gemmt via the 1m method.
- Added gemmt APIs to the BLAS and CBLAS compatiblity layers.
- Added gemmt test module to testsuite.
- Added standalone gemmt test driver to 'test' directory.
- Documented gemmt APIs in BLISObjectAPI.md and BLISTypedAPI.md.
- Added a C++ template header (blis.hh) containing a BLAS-inspired
  wrapper to a set of polymorphic CBLAS-like function wrappers defined
  in another header (cblas.hh). These two headers are installed if
  running the 'install' target with INSTALL_HH is set to 'yes'. (Also
  added a set of unit tests that exercise blis.hh, although they are
  disabled for now because they aren't compatible with out-of-tree
  builds.) These files now live in the 'vendor' top-level directory.
- Various updates to 'zen' and 'zen2' subconfigurations, particularly
  within the context initialization functions.
- Added s and d copyv, setv, and swapv kernels to kernels/zen/1, and
  various minor updates to dotv and scalv kernels. Also added various
  sup kernels contributed by AMD to kernels/zen/3. However, these
  kernels are (for now) not yet used, in part because they caused
  AppVeyor clang failures, and also because I have not found time to
  review and vet them.
- Output the python found during configure into the definition of PYTHON
  in build/config.mk (via build/config.mk.in).
- Added early-return checks (A, B, or C with zero dimension; alpha = 0)
  to bli_gemm_front.c.
- Implemented explicit beta = 0 handling in for the sgemm ukernel in
  bli_gemm_armv7a_int_d4x4.c, which was previously missing. This latent
  bug surfaced because the gemmt module verifies its computation using
  gemm with its beta parameter set to zero, which, on a cortexa15 system
  caused the gemm kernel code to unconditionally multiply the
  uninitialized C data by beta. The C matrix likely contained
  non-numeric values such as NaN, which then would have resulted in a
  false failure.
- Fixed a bug whereby the implementation for bli_herk_determine_kc(),
  in bli_l3_blocksize.c, was inadvertantly being defined in terms of
  helper functions meant for trmm. This bug was probably harmless since
  the trmm code should have also done the right thing for herk.
- Used cpp macros to neutralize the various AOCL_DTL_TRACE_ macros in
  kernels/zen/3/bli_gemm_small.c since those macros are not used in
  vanilla BLIS.
- Added cpp guard to definition of bli_mem_clear() in bli_mem.h to
  accommodate C++'s stricter type checking.
- Added cpp guard to test/*.c drivers that facilitate compilation on
  Windows systems.
- Various whitespace changes.
2020-11-14 09:39:48 -06:00
prangana
3620e472e3 Replace back major version number variable in Makefile
Change-Id: I0f902e32085058ec618d08470793f5e5e49719b3
2020-06-10 13:11:14 +05:30
prangana
711f26129e Update AMD BLIS version to 2.2
Also updated Makefile to fix issue of multiple symbolic links being
created

Change-Id: Ie9a680cedd5c96fcd7f6af1ce0f849a58c3ed4d3
2020-05-31 21:37:32 +05:30
dzambare
d40edf7dac Execution and Debug trace support.
Added support add debug logging, execution trace and decode.

Change-Id: I024bf6165daa9e23a62423f2401c0f1c5de459ba
AMD-Internal: [CPUPL-806]
2020-04-07 08:48:59 +05:30
Devrajegowda, Kiran
85fa9e4107 resolved merge conflicts when merged with public repo master branch
Change-Id: Iad6ba809680ba5081cc9d7879794ef58cc8f8a40
2019-11-25 14:46:48 +05:30
prangana
3d20128aea Merge branch 'amd-staging-rome2.1' of ssh://git.amd.com:29418/cpulibraries/er/blis into amd-blis-cpp
Change-Id: I97a10ab7546d475474b0ff733bafb8248843c352
2019-11-21 00:54:16 +05:30
prangana
d63f9b7d7f checkcpp test rule in Makefile
Change-Id: If01fe55e258e563a96cd8da9ea93d21063b730c2
2019-11-21 00:52:47 +05:30
prangana
49c27040d1 Instll CPP Template headers
Change-Id: Ib15dc9bda08d1f3fdc68e31520daee90a287357c
2019-11-20 21:52:22 +05:30
Field G. Van Zee
bc16ec7d1e Set execute bits of shared library at install-time.
Details:
- Modified the 0644 octal code used during installation of shared
  libraries to 0755 (for Linux/OSX only). Thanks to Adam J. Stewart
  for reporting this issue via #343.
- CREDITS file update.
2019-09-23 15:37:33 -05:00
Field G. Van Zee
184ba1b3d5 GNU-like handling of installation prefix et al.
Details:
- Changed the default installation prefix from $HOME/lib to /usr/local.
- Modified the way configure internally handles the prefix, libdir,
  includedir, and sharedir (and also added an --exec-prefix option).
  The defaults to these variables are set as follows:
    prefix:      /usr/local
    exec_prefix: ${prefix}
    libdir:      ${exec_prefix}/lib
    includedir:  ${prefix}/include
    sharedir:    ${prefix}/share
  The key change, aside from the addition of exec_prefix and its use to
  define the default to libdir, is that the variables are substituted
  into config.mk with quoting that delays evaluation, meaning the
  substituted values may contain unevaluated references to other
  variables (namely, ${prefix} and ${exec_prefix}). This more closely
  follows GNU conventions, including those used by GNU autoconf, and
  also allows make to override any one of the variables *after*
  configure has already been run (e.g. during 'make install').
- Updates to build/config.mk.in pursuant to above changes.
- Updates to output of 'configure --help' pursuant to above changes.
- Updated docs/BuildSystem.md to reflect the new default installation
  prefix, as well as mention EXECPREFIX and SHAREDIR.
- Changed the definitions of the UNINSTALL_OLD_* variables in the
  top-level Makefile to use $(wildcard ...) instead of 'find'. This
  was motivated by the new way of handling prefix and friends, which
  leads to the 'find' command being run on /usr/local (by default),
  which can take a while almost never yielding any benefit (since the
  user will very rarely use the uninstall-old targets).
- Removed periods from the end of descriptive output statements (i.e.,
  non-verbose output) since those statements often end with file or
  directory paths, which get confusing to read when puctuated by a
  period.
- Trival change to 'make showconfig' output.
- Removed my name from 'configure --help'. (Many have contributed to it
  over the years.)
- In configure script, changed the default state of threading_model
  variable from 'no' to 'off' to match that of debug_type, where there
  are similarly more than two valid states. ('no' is still accepted
  if given via the --enable-debug= option, though it will be
  standardized to 'off' prior to config.mk being written out.)
- Minor variable name change in flatten-headers.py that was intended for
  32812ff.
- CREDITS file update.
2019-08-23 14:18:08 +05:30
Field G. Van Zee
89a70cccf8 GNU-like handling of installation prefix et al.
Details:
- Changed the default installation prefix from $HOME/lib to /usr/local.
- Modified the way configure internally handles the prefix, libdir,
  includedir, and sharedir (and also added an --exec-prefix option).
  The defaults to these variables are set as follows:
    prefix:      /usr/local
    exec_prefix: ${prefix}
    libdir:      ${exec_prefix}/lib
    includedir:  ${prefix}/include
    sharedir:    ${prefix}/share
  The key change, aside from the addition of exec_prefix and its use to
  define the default to libdir, is that the variables are substituted
  into config.mk with quoting that delays evaluation, meaning the
  substituted values may contain unevaluated references to other
  variables (namely, ${prefix} and ${exec_prefix}). This more closely
  follows GNU conventions, including those used by GNU autoconf, and
  also allows make to override any one of the variables *after*
  configure has already been run (e.g. during 'make install').
- Updates to build/config.mk.in pursuant to above changes.
- Updates to output of 'configure --help' pursuant to above changes.
- Updated docs/BuildSystem.md to reflect the new default installation
  prefix, as well as mention EXECPREFIX and SHAREDIR.
- Changed the definitions of the UNINSTALL_OLD_* variables in the
  top-level Makefile to use $(wildcard ...) instead of 'find'. This
  was motivated by the new way of handling prefix and friends, which
  leads to the 'find' command being run on /usr/local (by default),
  which can take a while almost never yielding any benefit (since the
  user will very rarely use the uninstall-old targets).
- Removed periods from the end of descriptive output statements (i.e.,
  non-verbose output) since those statements often end with file or
  directory paths, which get confusing to read when puctuated by a
  period.
- Trival change to 'make showconfig' output.
- Removed my name from 'configure --help'. (Many have contributed to it
  over the years.)
- In configure script, changed the default state of threading_model
  variable from 'no' to 'off' to match that of debug_type, where there
  are similarly more than two valid states. ('no' is still accepted
  if given via the --enable-debug= option, though it will be
  standardized to 'off' prior to config.mk being written out.)
- Minor variable name change in flatten-headers.py that was intended for
  32812ff.
- CREDITS file update.
2019-04-11 18:33:08 -05:00
Field G. Van Zee
c665eb9b88 Minor updates to docs, Makefiles.
Details:
- Changed all occurrances of
    micro-kernel -> microkernel
    macro-kernel -> macrokernel
    micro-panel  -> micropanel
  in all markdown documents in 'docs' directory. This change is being
  made since we've reached the point in adoption and acceptance of
  BLIS's insights where words such as "microkernel" are no longer new,
  and therefore now merit being unhyphenated.
- Updated "Implementation Notes" sections of KernelsHowTo.md, which
  still contained references to nonexistent cpp macros such as
  BLIS_DEFAULT_MR_? and BLIS_PACKDIM_MR_?.
- Added 'run-fast' and 'check-fast' targets to testsuite/Makefile.
- Minor updates to Testsuite.md, including suggesting use of
  'make check' and 'make check-fast' when running from the local
  testsuite directory.
- Added a comment to top-level Makefile explaining the purpose behind
  the TESTSUITE_WRAPPER variable, which at first glance appears to serve
  no purpose.
2019-01-28 16:22:23 -06:00
Field G. Van Zee
0645f239fb Remove UT-Austin from copyright headers' clause 3.
Details:
- Removed explicit reference to The University of Texas at Austin in the
  third clause of the license comment blocks of all relevant files and
  replaced it with a more all-encompassing "copyright holder(s)".
- Removed duplicate words ("derived") from a few kernels' license
  comment blocks.
- Homogenized license comment block in kernels/zen/3/bli_gemm_small.c
  with format of all other comment blocks.
2018-12-04 14:31:06 -06:00
Isuru Fernando
cfbdb58de2 Move LDFLAGS to the end
Otherwise the linker will drop flags like -lpthread
2018-11-21 14:23:39 -06:00
Field G. Van Zee
6fbc456fb3 Added SALT testing to Travis CI.
Details:
- Modified .travis.yml to automatically employ the simulation of
  application-level threading within the testsuite, with supporting
  changes to common.mk, the top-level Makefile, and
  travis/do_testsuite.sh.
- Added a new pair of input files to testsuite directory with the
  '.salt' suffix (similar to those with the '.fast' suffix) for
  testing application-level threading.
- Updated docs/BuildSystem.md to document the new make targets
  'testblis-salt' and 'checkblis-salt'.
2018-10-25 13:20:25 -05:00
Field G. Van Zee
4ee986f0a7 Added mixed-datatype testing to Travis CI (#271).
Details:
- Modified .travis.yml to automatically test the mixed-datatype support
  of the gemm operation, with supporting changes to common.mk, the
  top-level Makefile, and travis/do_testsuite.sh.
- Added a new pair of input files to testsuite directory with the
  '.mixed' suffix (similar to those with the '.fast' suffix) for testing
  mixed-datatype gemm.
- Updated docs/BuildSystem.md to document the new make targets
  'testblis-md' and 'checkblis-md'.
2018-10-22 14:09:44 -05:00
Field G. Van Zee
c03728f1f4 Various minor cleanups.
Details:
- Rewrote bli_winsys.c to define bli_setenv() and bli_sleep()
  unconditionally, but differently for Windows and non-Windows, but
  then disabled the definition of bli_setenv() entirely since BLIS
  no longer needs to set environment variables. Updated bli_winsys.h
  accordingly, and call bli_sleep() from within testsuite instead of
  sleep() directly.
- Use
    #if !defined(_POSIX_BARRIERS) || (_POSIX_BARRIERS != 200809L)
  instead of
    #if !defined(_POSIX_BARRIERS) || (_POSIX_BARRIERS < 0)
  when guarding against local definition of pthread barrier in
  testsuite. (The description for unistd.h implies that _POSIX_BARRIERS
  should always be set to 200809L when barriers are supported, though I
  won't be surprised if we encounter a case in the future where it is
  set to something else such as 1 while still supported.)
- Removed old _VERS_CONF_INST definitions and installation rules in
  top-level Makefile. These are no longer needed because we no longer
  output libraries with the version and configuration name as
  substrings.
- Comment/whitespace updates in Makefile, config.mk.in, common.mk,
  configure, bli_extern_defs.h, and test_libblis.h.
- Added mention of 1m to README.md and other trivial tweaks.
2018-09-10 17:54:27 -05:00
Isuru Fernando
e93b01ff60 Windows DLL support (#246)
* Enable shared

* Enable rdp

* Add support for dll

* Use libblis-symbols.def

* Fix building dlls

* Fix libblis-symbols.def

* Fix soname

* Fix Makefile error

* Fix install target

* Fix missing symbols

* Add BLIS_MINUS_TWO

* Add path to dll

* Fix OSX soname

* Add declspec for dll

* Add -DBLIS_BUILD_DLL

* Replace @enable_shared@ in config

* switch to auto for now

* blis_ -> bli_

* Remove BLIS_BUILD_DLL in make check

* change auto->haswell

* enable_shared_01

* Add wno-macro-redefined

* print out.cblat3

* BLIS_BUILD_DLL -> BLIS_IS_BUILDING_LIBRARY

* Use V=1

* Remove fpic for windows

* Remember LIBPTHREAD

* Remove libm for windows

* Remember AR

* Fix remembering libpthread

* Add Wno-maybe-uninitialized in only gcc

* Don't do blastest for shared for now

* Fix install target

And remove unnecessary change

* test auto and x86_64

* Fix install target again

* Use IS_WIN variable

* Remove leading dot from LIBBLIS_SO_MAJ_EXT

* Make is_win yes/no

* Add comments for windows builds

* Change if else blocks location
2018-09-09 15:57:43 -05:00
Field G. Van Zee
1330d5c4bc Employ "user" cflags for tl Makefile test targets.
Details:
- Use get-user-cflags-for() to generate cflags when compiling BLAS test
  drivers and BLIS testsuite from top-level Makefile. Meant to include
  these changes in previous commit (4b5437e). Thanks to Isuru Fernando
  for pointing out this oversight.
2018-09-07 19:37:59 -05:00
Mathieu Poumeyrol
97965b0905 cortexa9 and cortexa53 travis build + qemu test (#245) 2018-09-06 14:10:29 -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
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
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
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
Field G. Van Zee
2c7960c841 Implemented ARG_MAX hack in configure, Makefile.
Details:
- Added support for --enable-arg-max-hack to configure, which will
  change the behavior of make when building BLIS so that rather than
  invoke the archiver/linker with all of the object files as command
  line arguments, those object files are echoed to a temporary file
  and then the archiver/linker is fed that temporary file via the @
  notation. An example of this can be found in the GNU make docs at
  https://www.gnu.org/software/make/manual/make.html#File-Function
- Thanks to Isuru Fernando for prompting this feature.
2018-07-05 14:38:33 -05:00
Field G. Van Zee
2b4a447526 Initial implementation of c99 "reference" sandbox.
Details:
- Added a c99 sandbox (in sandbox/c99) to serve as a starting point for
  others looking to experiment with alternative implementations of gemm
  in BLIS. Note that this sandbox implementation is a first draft and
  will be refined over time.
- Minor updates to Makefile and common.mk to restrict what source files
  get recompiled when sandbox files are touched.
- Added an initial draft of a README.md in sandbox/c99.
2018-05-25 18:51:23 -05:00
Field G. Van Zee
22deef2f54 Support alternative gemm implementation sandboxes.
Detail:
- configure:
  - add support for --enable-sandbox=NAME to configure script, where NAME
    is a subdirectory of a new 'sandbox' directory that contains an
    alternative implementation of gemm. (For now, only implementations of
    gemm may be provided via a sandbox.);
  - add support for C++ compiler. C++ compilers are handled in a manner
    similar to that of C compilers, in that a default search order is
    used, and that CXX is searched for first, if the variable is set. In
    practice, the C++ compiler that is selected should correspond to the
    selected C compiler. (Example: If gcc is selected for C, g++ should
    be selected for C++.) The result of the search is output to config.mk
    via build/config.mk.in. NOTE: The use of C++ in BLIS is still
    hypothetical, but may eventually move to being experimental. This
    support was intended only for use of C++ within a gemm sandbox.
- build/config.mk.in:
  - define SANDBOX variable containing sandbox subdirectory name.
- build/bli_config.in:
  - define either of the BLIS_ENABLE_SANDBOX or BLIS_DISABLE_SANDBOX
    macros in bli_config.h.
- common.mk:
  - include makefile fragments that were propagated into the specified
    sandbox subdirectory;
  - generate different CFLAGS for sandboxes, as well as a separate
    CXXFLAGS variable for sandboxes when C++ source files are compiled;
  - isolate into a single location lists of file suffixes for various
    purposes.
  - reorganized/clean up code related to identifying header files and
    paths.
- Makefile:
  - generate object filepaths for and compile source code files found in
    sandbox sub-directory;
  - remove makefile fragments placed in sandbox sub-directory (cleanmk);
  - various other cleanups.
- Added .cc, .cpp, and .cxx to list of suffixes of files to recognize in
  makefile fragments (via build/gen-make-frags/suffix_list).
- Updated blis.h to conditionally #include bli_sandbox.h (via a new file,
  bli_sbox.h), which each sandbox is assumed to use for any type
  definitions and function prototypes it wishes to export out to blis.h.
- Conditionally disable bli_gemmnat() implementation in frame/3 when
  BLIS_ENABLE_SANDBOX is defined.
2018-05-24 14:28:55 -05:00
Alex Arslan
fcf6c6a3c8 Fix shared library builds on platforms other than Linux and macOS (#209)
* Fix detection of systems other than Linux and macOS

The way the logic is currently laid out, any platform that isn't Linux
gets assigned the .dylib shared library extension and the macOS-specific
compiler flags. This reverses the logic to check for macOS first, and
have the fallback use the Linux definitions, which apply to most other
systems as well.

* Use SHLIB_EXT instead of SO_SUF

The former is more standard, as jakirkham pointed out in a comment.
2018-05-14 20:41:03 -05:00
Field G. Van Zee
af1d8470b5 Better handling of shared libraries on OS X.
Details:
- Use the .dylib shared library suffix on OS X (instead of .so in Linux).
- Link with the -dynamiclib and -install_name options on OS X (instead of
  -shared and -soname in Linux).
- Determine operating system (e.g. Linux, Darwin) during configure and
  substitute into config.mk.in rather than run 'uname -s' during make.
- Echo operating system during configure.
2018-05-11 17:49:58 -05:00
Field G. Van Zee
4b72a462d7 Enable building shared library by default.
Details:
- Tweaked configure so that the shared library is generated by default.
- Updated --help text and configure's feedback messages reporting the
  status of the static/shared builds.
- Changed the order of build product installation so that headers are
  installed last, after libraries and symlinks.
2018-05-10 18:35:38 -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
Field G. Van Zee
fc2d9ec6bf Tweaks to top-level clean and distclean targets.
Details:
- Moved the removal of bli_config.h from cleanh to distclean.
- Removed cleantest as a dependency of clean.
2018-05-09 15:19:28 -05:00
Field G. Van Zee
bf03503059 Renamed (shortened) a few build system variables.
Details:
- Renamed the following variables in config.mk (via build/config.mk.in):
    BLIS_ENABLE_VERBOSE_MAKE_OUTPUT -> ENABLE_VERBOSE
    BLIS_ENABLE_STATIC_BUILD        -> MK_ENABLE_STATIC
    BLIS_ENABLE_SHARED_BUILD        -> MK_ENABLE_SHARED
    BLIS_ENABLE_BLAS2BLIS           -> MK_ENABLE_BLAS
    BLIS_ENABLE_CBLAS               -> MK_ENABLE_CBLAS
    BLIS_ENABLE_MEMKIND             -> MK_ENABLE_MEMKIND
  and also renamed all uses of these variables in makefiles and makefile
  fragments. Notice that we use the "MK_" prefix so that those variables
  can be easily differentiated (such as via grep) from their "BLIS_" C
  preprocessor macro counterparts.
- Other whitespace changes to build/config.mk.in.
- Renamed the following C preprocessor macros in bli_config.h (via
  build/bli_config.h.in):
    BLIS_ENABLE_BLAS2BLIS        -> BLIS_ENABLE_BLAS
    BLIS_DISABLE_BLAS2BLIS       -> BLIS_DISABLE_BLAS
    BLIS_BLAS2BLIS_INT_TYPE_SIZE -> BLIS_BLAS_INT_TYPE_SIZE
  and also renamed all relevant uses of these macros in BLIS source
  files.
- Renamed "blas2blis" variable occurrences in configure to "blas", as
  was done in build/config.mk.in and build/bli_config.h.in.
- Renamed the following functions in frame/base/bli_info.c:
    bli_info_get_enable_blas2blis() -> bli_info_get_enable_blas()
    bli_info_get_blas2blis_int_type_size()
                                    -> bli_info_get_blas_int_type_size()
- Remove bli_config.h during 'make cleanh' target of top-level Makefile.
2018-05-08 16:49:22 -05:00
Field G. Van Zee
7e5648ca15 Add configure support for --libdir, --includedir.
Details:
- Added support for two new configure options: --libdir and --includedir.
  They specify the precise install directories for libraries and header
  files, respectively, and override any location implied by the --prefix
  option (including the default install prefix, if --prefix was not
  given). Thanks to Nico Schlömer for suggesting this via issue #195.
- Removed the INSTALL_PREFIX definition/anchor from build/config.mk.in
  and replaced it with corresponding definitions/anchors for libdir and
  includedir.
- Updated top-level Makefile to use the new variables, INSTALL_LIBDIR
  and INSTALL_INCDIR, instead of INSTALL_PREFIX (which is now no longer
  needed by make).
- Set default sane values for INSTALL_LIBDIR and INSTALL_INCDIR in
  common.mk when configure has not been run, as is already done for
  DIST_PATH. This is to safeguard against statements in the top-level
  Makefile that use 'find' to locate old libraries and headers for the
  uninstall targets, which run regardless of make target. Without setting
  INSTALL_LIBDIR and INSTALL_INCDIR, those variables are empty and the
  'find' ends up looking at '/', which is obviously not what we want.
  (Also enclosed those definitions in an IS_CONFIGURED guard so that they
  won't get evaluated unless configure has been run.)
- Rearranged "ifeq ($(IS_CONFIGURED),yes)" conditionals in Makefile to
  reduce occurrences and separated "local" and top-level components of
  cleanblastest and cleanblistest targets to improve readability.
- Adjusted out-of-tree builds so that they are no longer oblivious to
  the .git directories, if present, and thus now properly augment version
  strings with the appropriate patch number.
- Include missing version string in 'configure --help' output.
2018-05-07 18:59:19 -05:00
Field G. Van Zee
b09e4e8852 Allow 'make clean' and friends without configuring.
Details:
- Modified top-level Makefile so that a user can run 'make distclean',
  'make clean', or any of the other clean-related targets prior to
  running configure (or after a previous 'make distclean'). Thanks to
  Nico Schlömer for suggesting this via issue #197.
- Made the cleanblastest and cleanblistest more comprehensive in that
  they now clean out build products that would have resulted from local
  compilation (ie: builds performed within the 'blastest' or 'testsuite'
  directories).
- Added "cc" to list of expected compiler "vendors" since the CC variable
  seems to automatically be set to "cc" on Ubuntu 16.04 (which is just an
  alias to gcc).
- Comment update to build/config.mk.in.
2018-05-07 14:37:50 -05:00
Field G. Van Zee
078a852f73 Minor tweaks to top-level 'make clean' target.
Details:
- Execute 'cleanh' target as part of 'clean'
- Remove cblas.h file from 'include/<configname>/' as part of 'cleanh'
  target.
- Updated the echoed (non-verbose) text for uniformity.
2018-04-30 16:15:26 -05:00