Commit Graph

54 Commits

Author SHA1 Message Date
Edward Smyth
75f21182bd GTestSuite: IIT and ERS test improvements
Various improvements:
- Where appropriate, test both:
  - with nullptr for suitable arguments that should never
    be touched.
  - with all arguments correct except the one we want to
    test, to check we are not returning early because
    another argument is a nullptr.
- Test incorrect values for order argument in CBLAS calls.
- Test early exits with limited data changes, e.g. set
  C to 0 or scale C in GEMM when alpha = 0.
- Bugfix in gemmt test when alpha is 0 and beta is 1.
- Use reference library gemmt for comparison when library
  is not netlib BLAS.

AMD-Internal: [CPUPL-4500]
Change-Id: Ibde7eaba5a484a87674044ca44855c6f6ee4ff4b
2024-07-31 15:36:01 -04:00
Edward Smyth
b90e12dfa4 GTestSuite: copyright notice
Standardize format of copyright notice.

AMD-Internal: [CPUPL-4500]
Change-Id: I6bde64c15ff639492dd0de95423c660112a37e2c
2024-07-26 15:34:41 -04:00
Edward Smyth
ea286cf6f6 GTestSuite: whitespace at end of lines
Unnecessary whitespace (spaces, tabs) at the end of lines
has been removed.

AMD-Internal: [CPUPL-4500]
Change-Id: Ice5f5504232cb22460c14ac47e6a3a43309cba22
2024-07-26 12:12:56 -04:00
Edward Smyth
4183efa722 GTestSuite: No newline at end of file
Add missing newline at the end of these files.

AMD-Internal: [CPUPL-4500]
Change-Id: I835cc73de0008b66ae3cf77fbb3daa1c8fcaaa7f
2024-07-26 11:42:57 -04:00
Vignesh Balasubramanian
6165001658 Bugfix and optimizations for ?AXPBYV API
- Updated the existing code-path for ?AXPBYV to
  reroute the inputs to the appropriate L1 kernel,
  based on the alpha and beta value. This is done
  in order to utilize sensible optimizations with
  regards to the compute and memory operations.

- Updated the typed API interface for ?AXPBYV to include
  an early exit condition(when n is 0, or when alpha is
  0 and beta is 1). Further updated this layer to query
  the right kernel from context, based on the input values
  of alpha and beta.

- Added the necessary L1 vector kernels(i.e, ?SETV, ?ADDV,
  ?SCALV, ?SCAL2V and ?COPYV) to be used as part of special
  case handling in ?AXPBYV.

- Moved the early return with negative increments from ?SCAL2V
  kernels to its typed API interface.

- Updated the zen, zen2 and zen3 context to include function
  pointers for all these vector kernels.

- Updated the existing ?AXPBYV vector kernels to handle only
  the required computation. Additional cleanup was done to
  these kernels.

- Added accuracy and memory tests for AVX2 kernels of ?SETV
  ?COPYV, ?ADDV, ?SCALV, ?SCAL2V, ?AXPYV and ?AXPBYV APIs

- Updated the existing thresholds in ?AXPBYV tests for complex
  types. This is due to the fact that every complex multiplication
  involves two mul ops and one add op. Further added test-cases
  for API level accuracy check, that includes special cases of
  alpha and beta.

- Decomposed the reference call to ?AXPBYV with several other
  L1 BLAS APIs(in case of the reference not supporting its own
  ?AXPBYV API). The decomposition is done to match the exact
  operations that is done in BLIS based on alpha and/or beta
  values. This ensures that we test for our own compliance.

AMD-Internal: [CPUPL-4861]
Change-Id: Ia6d48f12f059f52b31c0bef6c75f47fd364952c6
2024-06-20 16:22:07 +05:30
Arnav Sharma
91bdf9a3eb Gtestsuite: Bugfix for DOTXF, Changes to AXPYF
- Fixed bug in ddotxf generic tests where the parameters lda_inc and
  inca were being read incorrectly.

- Fixed bug in dotxf test wherein the y vector was being generated with
  length m instead of b.

- Corrected function signatures to use type gtint_t instead of gint_t.

- Updated the tests to use conjugate values of type char and convert to
  conj_t type only while invoking BLIS tests for both DOTXF and AXPYF.

AMD-Internal: [CPUPL-5117]
Change-Id: I0ef7af429057583a1cbf34827802e72401181caf
2024-06-07 15:05:10 +05:30
Edward Smyth
bc7d2df832 GTestSuite: misc corrections 2
- Correct value of alpha in ger ERS test.
- rename ERS_IIT.cpp files to match naming convention
  used for other APIs.
- Change all cases of gint_t to gtint_t except for
  dotxf, which is fixed in another commit.
- Add TEST_UPPERCASE_ARGS to imatcopy and omatcopy{2}
  headers.
- Corrected typo.

AMD-Internal: [CPUPL-4500]
Change-Id: I8844bb8c5941785e64daa9df5569092c19f91838
2024-05-20 03:51:21 -04:00
Edward Smyth
782e009b66 GTestSuite: check data that should just be set is not read 2
Correction to commit 8657e661fc
to allocate matrix or vector correctly when special read-only
case occurs.

Also define a set_matrix generator for symmetric matrices
to only set upper or lower triangle to the supplied value,
while setting the unused elements to a large value to help
catch incorrect access to those elements.

AMD-Internal: [CPUPL-4548]
Change-Id: I22b3a20e2ce8be70eb27179247cd47fdb2d87b9d
2024-05-15 11:56:16 -04:00
Edward Smyth
8657e661fc GTestSuite: check data that should just be set is not read
Some BLAS routines do not require matrices or vectors to be
initialized in certain use cases. For example, in GEMM when
beta=zero, C is set rather than updated, thus input values of
C should not be used. In these cases set the inital values of
such matrices or vectors to an extreme value, to help detect
if these are incorrectly being read.

The extreme value can be NaN or Inf. The default is Inf,
change it by running

   cmake ... -DEXT_VALUE=NaN

AMD-Internal: [CPUPL-4548]
Change-Id: I4a665363779d2496b8247f6357e970b7f23cd1eb
2024-05-10 06:29:03 -04:00
vignbala
ca6276d52b Accuracy and memory testing of AVX512 ?SETV, ZAXPYV and ZAXPYF kernels
- Added accuracy and memory tests for AVX2 and AVX512 ?SETV kernels,
  AVX512 ZAXPYV kernel and AVX512 ZAXPYF kernels, with fuse-factors
  2, 4 and 8.

- Cleanup of the code-section that declares and defines the reference
  compute for AXPYF operation. Corrected the type mismatch with the
  arguments that reference AXPYV would expect(this is used to decompose
  AXPYF as part of reference). Ensured usage of GTestSuite's internal
  alias for integer types.

- Updated the API level testsuite and testing interface for AXPYF,
  based on the cleaup done to the reference code.

AMD-Internal: [CPUPL-4974]
Change-Id: I71de6c09d3877cd3dd1eaa20ab4f90e7c33eb1e1
2024-05-09 00:24:02 -04:00
Arnav Sharma
89a06cf252 Gtestsuite: Unit Tests for ZDOTV AVX512 Kernel
- Updated DOTV Gtestsuite interface to invoke C/ZDOTC when conjx='c'
  and testing interface is either BLAS or CBLAS.

- Added ukr tests for bli_zdotv_zen4_asm_avx512( ... ) and
  bli_zdotv_zen_int_avx512( ... ) kernels.

AMD-Internal: [CPUPL-5011]
Change-Id: I32fb69027a35d9ea92f997a095d412c8242a4b68
2024-05-08 09:20:31 -04:00
Edward Smyth
82e628b833 GTestSuite: seg faults in data generator
Following a recent change to the data generators to allow a stride
to be specified (60cc23f3d3), seg
faults can occur if m<=0 for column storage or n<=0 for row storage.
Prevent this by having separarate code paths to handle these
scenarios.

AMD-Internal: [CPUPL-4500]
Change-Id: I23ed8b2dccaaca140e2ddfda45bcdb4c888d5708
2024-05-01 05:46:52 -04:00
Edward Smyth
c2d4f1d7a5 GTestSuite: Avoid infinite recursion in generators
Previous commit introduced an infinite recursion problem in
generators for symmetric matrices. This was reported as a
compiler warning by gcc 12.2 but not by gcc 11.4.

AMD-Internal: [CPUPL-4862]
Change-Id: I8642b81a62f0643b5a9ebedb4fcc83b25542de1b
2024-04-04 19:46:18 +05:30
Vignesh Balasubramanian
60cc23f3d3 Test-case development for ?IMATCOPY and ?OMATCOPY2 APIs
- Added test-cases to verify the functional behaviour
  of the BLAS-extension API ?imatcopy_() and ?omatcopy2_().
  The test-cases cover the following categories for the
  supported datatypes :
  - Functional and memory testing.
  - Negative parameter testing with invalid inputs.
  - Early return scenarios.
  - Exception value testing.

- Updated functions in testinghelpers to include strides
  in addition to leading-dimension, when initializing
  a matrix. The default value for stride is set as 1.

- Implemented functions to load the reference symbol, based
  on the choice of the reference library. The function definition
  is overloaded due to different API standards being exposed by
  different libraries.

- Code cleanup of files for ?OMATCOPY API.

AMD-Internal: [CPUPL-4862]
Change-Id: If63b348f517e2cde1fe48f3a195808b33a91c312
2024-04-04 16:26:20 +05:30
Nimmy Krishnan
9226641585 Gtestsuite: Added overflow and underflow tests for dgemm
- Added overflow and underflow tests for dgemm

  These tests cause floating point overflow and underflow by feeding
  values close to DBL_MAX and DBL_MIN values to matrices
  DBL_MAX = 1.7976931348623158e+308
  DBL_MIN = 2.2250738585072014e-308

  When computations result in values beyond the range [DBL_MIN, DBL_MAX],
  it leads to an overflow or underflow condition

  Two new arguments are added to test_gemm routine - over_under and input_range

  over_under = 0 indicates overflow
  over_under = 1 indicates underflow

  input_range = -1 indicates values within overflow or underflow limits
  input_range = 0  indicates values very close to DBL_MIN or DBL_MAX
  input_range = 1  indicates values beyond DBL_MIN or DBL_MAX

- New file: dgemm_ovr_undr.cpp

  Overflow and underflow tests are called from this file
  dgemm_overflow and dgemm_underflow. This file uses
  cfloat header file for DBL_MIN and DBL_MAX values

Signed-off-by: Nimmy Krishnan <nimmy.krishnan@amd.com>
AMD-Internal: [CPUPL-4492]
Change-Id: I4bbd519abacc56f322c73d6c0187ed6e1abbbf2b
2024-04-01 11:21:10 +00:00
Vignesh Balasubramanian
70b57cd16f Test-case development for ?OMATCOPY APIs
- Added test-cases to verify the functional behaviour
  of the BLAS-extension API ?omatcopy_(). The test-cases
  cover the following categories for the supported datatypes :
  - Functional and memory testing.
  - Negative parameter testing with invalid inputs.
  - Early return scenarios.
  - Exception value testing.

- Implemented a function to load the reference symbol, based
  on the choice of the reference library. The function definition
  is overloaded due to different API standards being exposed by
  different libraries.

AMD-Internal: [CPUPL-4810][SWLCSG-2706]
Change-Id: I8dcaeeaa36d392b752eb0685e32583a12ddc4220
2024-03-27 23:34:47 -04:00
Edward Smyth
21e66b667d GTestSuite: Misc corrections
- Handle -0.0 separately in get_value_string()
- Avoid unused variable warning when not TEST_BLIS_TYPED in
  subv_evt_testing.cpp
- Remove unused variables in dgemm_ukernel.cpp
- Remove unnecessary local copies of greenzone1 in test
  programs now that greenzone_1 and greenzone_2 will
  not overlap.
- Protect tests of haswell kernels by ifdef on
  BLIS_KERNELS_HASWELL rather than BLIS_KERNELS_ZEN.
- Added GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST
  statements in TRSM kernel tests.
- Correct descriptions of trsm and trmm operations.
- Correct typos.

AMD-Internal: [CPUPL-4500]
Change-Id: If8520347e417785e6aa953a0c8a65d4f5f3c1591
2024-03-25 09:32:50 -04:00
Mangala V
220c7bb627 Gtestsuite: Added test for ?SWAPV
- Added API tests
  - Added Invalid input test cases (IIT).
  - Added memory testing for SWAPV API.
  - Added micro kernel testing for single and double precision
  - Added reference swapv functionality in testinghelpers
  - Added binary comparison method for two vectors with different
    increments in check_error.h

AMD-Internal: [CPUPL-4814]

Change-Id: I32bcca51b4e998d51ede70869035da76a7f6dbca
2024-03-25 22:56:31 +05:30
Shubham Sharma
9c40473a96 GTestSuite: Added Tests for DTRSV
- Added API tests for DTRSV.
  - Added Extreme Value Test cases (EVT) for DTRSV.
    - Tests for various combinations of INFs
       and NANs for X vector and B matrix are added.
  - Added Invalid input test cases (IIT).
  - Added memory testing for DTRSV
    kernels.
  - Fixed a bug in alphax function where scaling
    of a vector with a scalar was not handled
    correctly when incx was negative.

AMD-Internal: [CPUPL-4715]
Change-Id: I84c873e98f845e05b11860e7ef6083d1184489b4
2024-03-20 01:05:57 -04:00
Eleni Vlachopoulou
068c2f6ba6 GTestSuite: Generic changes so that GTestSuite builds and runs as expected.
- Updating printing functionality for vectors and matrices.
- Adding macro definition checks so that GTestSuite builds successfully for shared libraries on zen3.
- Casting integers so that code builds for ILP64.

AMD-Internal: [CPUPL-4500]
Change-Id: I03afd08d5ad8ae50193d9559cf4ab8fc1d08753c
2024-03-14 23:47:33 +05:30
Edward Smyth
d61a74ec8f GTestSuite: Allow fp values in test names
Modifications to testinghelpers::get_value_string() to allow
floating point values (e.g. for alpha and beta) to be used in
generating test names. Values will be generated in the form
1p3 or m2p4, or 3p0_4p5i for complex data. One decimal place
is currently enabled but this can be increased if needed. This
helps prevent duplicate test name errors when the list of values
for alpha or beta includes e.g. 1.0 and 1.3.

Also add support in testinghelpers::get_value_string() for
variables of type gtint_t.

AMD-Internal: [CPUPL-4500]
Change-Id: Icc8ca3c3cfacd7d46fffefee5a6e05452f704d4e
2024-03-14 11:01:58 -04:00
Harsh Dave
51e1bfc1f1 Added dotxf reference implementation for gtestsuite
- dotxf is a blis specific kernel, which performs dotxv 
operation but in multiple of fused factors to speed up
the operations.

- So dotxf reference function is implemented for gtestsuite,
where dotxf computation compared against computation done by
looping over dotxv function.

AMD-Internal: [CPUPL-4764]
Change-Id: I342dab066ceb1710649e54bb73afc5a23e2a8177
2024-03-14 05:05:49 -04:00
Harsh Dave
f10d6eced6 Added axpyf reference implementation for gtestsuite
- axpyf is a blis specific kernel, which performs axpy 
operation but in multiple of fused factors to speed up
the operations.

- So axpyf reference function is implemented for gtestsuite,
where axpyf computation compared against computation done by
looping over axpy function.

AMD-Internal: [CPUPL-4763]
Change-Id: I4713fd0b0d9e9cf688c9aaa82ac0e6ae07a05989
2024-03-14 02:54:36 -04:00
Shubham Sharma
9968821ed9 GTestSuite: Added tests for STRSM
- Added API tests for STRSM.
  - Added Extreme Value Test cases (EVT) for STRSM.
    - Tests for various combinations of (+/-) INFs
       and NANs in A and B matrix are added.
  - Added micro kernel testing
    - Added unit tests for small and native
      path kernels.
 - Added memory testing for STRSM
   kernels.
 - Edited the protected buffer in memory testing to
   make sure that greenzone1 and greenzone2 do not
   intersect.

AMD-Internal: [CPUPL-4640]
Change-Id: Ic48590d3b4ad12c4f2f6beaec2e1106a7aaa5213
2024-02-29 23:40:17 -05:00
Arnav Sharma
98b28368d8 Functional Tests for ZSCALV and ZDSCALV
- Updated test_scalv and ref_scalv templates for SCALV gtestsuite to
  support unit-tests for mixed precision SCALV.

- Added unit-tests for the following kernels:
  ZSCALV
	- bli_zscalv_zen_int( ... )

  ZDSCALV
	- bli_zdscalv_zen_int10( ... )
	- bli_zdscalv_zen_int_avx512( ... )

- Also, added API level unit-tests for the following cases:
	- Unit Positive Increments
	- Non-Unit Positive Increments

- Updated comments in DSCALV unit-tests with the correct kernel name.

AMD-Internal: [CPUPL-4624]
Change-Id: I96db8d3612687be07cd0e638a3119d41c3641ce8
2024-02-28 12:21:05 +05:30
Edward Smyth
936a0a29df GTestSuite: BLAS2 thresholds
Modify thresholds to reflect number of operations that
accumulate results into each output element. Different
limits are set for early return and special cases.

Constants are still subject to experimentation and change.

AMD-Internal: [CPUPL-4378]
Change-Id: Ic4540a2f1f6cd6380228b6a2884ac62850d6d8c6
2024-02-27 11:52:48 -05:00
Arnav Sharma
38af5752c4 Simplified and Fixed gtestsuite get_value_string
- Simplified the get_value_string( ... ) for complex types.

AMD-Internal: [CPUPL-4653]
Change-Id: I5bf8f6fe5753d0037b52bc4e31f87ad27b5d2c1c
2024-02-27 10:37:41 -05:00
Shubham Sharma
de92fb0680 Added Memory testing for DTRSM
- Added framework for memory testing.
- Out of bound reads and writes can be
  detected in both C and assembly.
- Added memory tests for DTRSM.
- Test methodology:
  - Use linux's protected pages to set some memory
    before and after the required buffer as protected.
  - Set the first and last page_size bytes as
    read, write and execute protected (red_zones).
  - If any part of code tries to read/write
    in redzones, a SIGSEGV signal will be
    generated, which can be used to detect a
    out of bounds read and write.
  - Page protection can only be set per page.
    If required size for buffer is not a multiple
    of pagesize we have to allocate more memory
    than required in order make sure the start and
    end of redzones align with page boundaries.
  - Overwrite malloc(size) to allocate
    'buffer_size+(2*pagesize)' where buffer_size =
    minimum size such that buffer_size > 'size' and
    buffer_size is multiple of pagesize.
  - Use first and last page_size bytes of allocated
    buffer as redzones, use first 'size' of the middle
    buffer as first greenzone and last 'size' bytes as
    second greenzone.
  - Call test code once with first geenzone and then
    with second greenzone. Greenzones are surrounded
    by redzones, if test code read/writes before or after
    greenzones, it will be detected.

   |_____________________________________________________|
   |  red_zone1 |  green_zone1    greenzone_2 | red_zone2|
   |_____________________________________________________|

AMD-Internal: [CPUPL-4403]
Change-Id: Ic5c22a9adf8f833c77510686eee886485e894354
2024-02-19 23:41:28 -05:00
Edward Smyth
00accfb3b1 GTestSuite: option to test with threshold = zero
Add cmake option to override thresholds and set them all to zero.
In this case we don't switch to binary comparison as we want the
error to be calculated and printed. This functionality is intended for:
- Helping to determine or alter thresholds.
- To compare different max errors between different reference libraries.
- To test when we expect identical results, e.g. some comparisons of
  BLIS vs BLIS.

To simplify coding, this is implemented by setting epsilon to zero
in the testinghelpers function.

AMD-Internal: [CPUPL-4400]
Change-Id: I2cf021e0cc24c62e7600ba80fd810f3aa55a6ea5
2024-02-08 11:06:25 -05:00
Edward Smyth
ee91b032ab GTestSuite: Ensure all elements are initialized in generators
Rather than relying on implicit initialization of arrays, ensure all
elements are explicitly set. Array elements that are not supposed
to be altered by the BLAS or BLIS API are set to a large magnitude
value to aid identication of incorrect usage. This includes:
- Intervening elements in vectors when incx/incy > 1.
- Extra elements in column/row when lda > matrix size.
- Also set unused upper/lower values in triangular matrices to
  similar large magnitude value.

AMD-Internal: [CPUPL-4430]
Change-Id: Id5e8c1a4e80687f5f462e6b5aa2accac0ab8ec21
2024-02-05 10:29:56 -05:00
Eleni Vlachopoulou
b9a808e5d8 GTestSuite: Updating datagenerators helper functions.
- Moved function definitions in the header to avoid explicit template
  instantiations.
- Templatized from and to bounds to enable combinations of integer of
  floating-point values.
- Used an enum class for the element type instead of a char to make it
  more robust since chars get casted to integers. Now we should be
  getting better error messages if there is a missmatch.
- Deleted argument for datatypes that was a leftover from the past.
  Default argument is used instead.

Change-Id: I3f95d73f03028de46324b310826edca8057e561d
2024-01-31 07:08:25 -05:00
Vignesh Balasubramanian
ddec0c1de0 Negative parameter testing for ?COPY, ?AXPY and ?AXPBY APIs
- As per the standard compliance, the ?copy(), ?axpy() and
  ?axpby() APIs do not require invalid input testing(IIT)
  with respect to the input parameters they receive, as part
  of BLAS and CBLAS calls.

- Thus, test-cases have been added to verify early return scenarios
  (ERS) as per the compliance. The testsuite is type-parameterized,
  since the compliance for early return cases is the same across the
  datatypes.

- Updated the conditional directives in micro-kernel(ukr) test files
  to include the new set of macros generated as part of the
  buildsystem in GTestsuite.

- Updated the conditional macro to enable the appropriate code
  section for compilation of ref_axpbyv(), based on our choice
  of reference library when building GTestsuite.

AMD-Internal: [CPUPL-4402]
Change-Id: Ibea2bc34469b008f4d4558ce359717c08b92e978
2024-01-29 06:31:18 -05:00
Arnav Sharma
823e8bfb2d Functional Testing for DDOTV, DSCALV and DASUMV
- Added unit-tests for the following kernels:
  DDOTV
	- bli_ddotv_zen_int( ... )
	- bli_ddotv_zen_int10( ... )
	- bli_ddotv_zen_int_avx512( ... )
  DSCALV
	- bli_dscalv_zen_int( ... )
	- bli_dscalv_zen_int10( ... )
	- bli_dscalv_zen_int_avx512( ... )

- Added API level unit-tests for the following cases:
	- Unit Positive Increments
	- Non-Unit Positive Increments
	- Negative Increments

- Added gtestsuite framework for (s/d/sc/dz)ASUMV.

AMD-Internal: [CPUPL-4406]
Change-Id: I086c51c563fecc7a7e67791c4c4eee8b56c5417b
2024-01-19 07:05:11 -05:00
Eleni Vlachopoulou
79ad303902 GTestSuite: Clean-up on build system.
- and a small bugfix so that it works again on Windows.

Change-Id: I986b81d74d0f00c55eee497712aed5b268211d5f
2023-11-24 04:59:36 -05:00
Edward Smyth
f471615c66 Code cleanup: No newline at end of file
Some text files were missing a newline at the end of the file.
One has been added.

AMD-Internal: [CPUPL-3519]
Change-Id: I4b00876b1230b036723d6b56755c6ca844a7ffce
2023-11-22 17:11:10 -05:00
Arnav Sharma
dd1cf23090 Gtestsuite Update for Pack and Compute Extension APIs
- Pack and compute are now compared against GEMM operation of reference
  library when MKL is not used as a reference.
- For the case where both A and B are unpacked, the reference GEMM is
  invoked with a unit-alpha scalar.
- If MKL is used as reference, then these APIs are compared against pack
  and compute operations of MKL.
- Updated description in ref_gemm_compute.cpp to reflect this behavior.

AMD-Internal: [CPUPL-4084]
Change-Id: Id0521c9cad8743a7ae471a7f3c547ceb67191f86
2023-11-03 09:45:42 -04:00
Arnav Sharma
c1612f6838 Gtestsuite Framework and Unit Tests for Pack and Compute Extension APIs
- Added framework for unit testing of BLAS and CBLAS interfaces for the
  Pack and Compute Extension APIs.
- These test the integrated functionality of the trio of
  ?gemm_pack_get_size(), ?gemm_pack() and ?gemm_compute() APIs.
- Note: Only MKL can be used as reference for now.

AMD-Internal: [CPUPL-3560]
Change-Id: I801654447a716da06c9ccf9db01d553817871571
2023-10-16 09:35:42 -04:00
Vignesh Balasubramanian
a6a67fea2d ZAXPBYV optimizations for handling unit and non-unit strides
- Updated the bli_zaxpbyv_zen_int( ... ) kernel's computational
  logic. The kernel performs two different sets of compute based
  on the value of alpha, for both unit and non-unit strides. There
  are no constraints on beta scaling of the 'y' vector.

- Updated the logic to support 'x' conjugate in the computation.
  The kernel supports conjugate/no conjugate operation through the
  usage of _mm256_fmsubadd_pd( ... ) and _mm256_addsub_pd( ... )
  intrinsics.

- Updated the early return condition in the kernel to adhere to
  the standard compliance.

- Updated the scalar computation with vector computation(using 128
  bit registers), in case of dealing with a single element(fringe case)
  in unit-stride or vectors with non-unit strides. A single dcomplex
  element occupies 128 bits in memory, thereby providing scope for
  this optimization.

- Added accuracy and extreme value testing with sufficient sizes
  and initializations, to test the required main and fringe cases
  of the computation.

AMD-Internal: [CPUPL-3623]
Change-Id: I7ae918856e7aba49424162290f3e3d592c244826
2023-10-12 06:31:08 -04:00
jagar
5d578684ea GtestSuite: Update in source code to make it compatible on MSVC(windows)
AMD-Internal: [CPUPL-2732]
Change-Id: Ifd9372bf9b0f00c2bf24442ea8519bfcf4e5db5b
2023-10-09 04:43:29 -04:00
jagar
29711dd5a3 Gtestsuite: Updated testings_basics.* to print matrix/vector name
AMD-Internal: [CPUPL-2732]
Change-Id: I89b4ffc97ea852e66f42b82058af67c16144fbf6
2023-09-26 08:27:19 -04:00
Vignesh Balasubramanian
32104c400c GTestSuite : Designing test cases for ZGEMM
- Designed test cases for unit testing of ZGEMM compute
  kernel for handling inputs when k == 1. The design
  uses value-parameterized testing for checking accuracy,
  and verifying the mandate in case of exception values
  on the inputs/output.

- The design uses type-parameterized testing for verifying
  BLAS standard for invalid input cases, and also for early
  return scenarios.

- Added the function template set_ev_mat( ... ) as part of
  testinghelpers. This function is used as a helper for
  inducing exception values onto indices specified as
  arguments to the test_gemm( ... ) interface.

- Abstracted the function definition of getValueString( ... )
  from the NRM2 testing interface to testinghelpers(renamed
  as get_value_string( ... ) for naming consistency), in order
  to use it as a helper function across all APIs in case of
  exception value testing.

AMD-Internal: [CPUPL-3823]
Change-Id: I0fea21f9c8759bbbdc88ba0a016202753e28f2a7
2023-09-08 17:36:57 +05:30
Eleni Vlachopoulou
a6641dec0b Updating GTestSuite CMake system to enable testing BLIS libraries on Windows.
- Renaming ELEMENT_TYPE to BLIS_ELEMENT_TYPE, since the first is defined on a Windows header.
- Updating refCBLAS object to have different implementation depending on the platform.
- Removing dlfcn.h from all reference headers since it's linux specific and adding it conditionally on a higher level.
- Changes on all CMakeLists.txt files to enable building on Windows.

AMD-Internal: [CPUPL-2732]
Change-Id: I6e35656a3779b35dc815a2409cf84c22dd27f3e7
2023-08-29 16:11:22 +05:30
Eleni Vlachopoulou
fa77d0415a Updating nrm2 GTestSuite testing
- Adding default template parameter for the type of the returned value from nrm2.
- Bugfix on NaN/Inf comparator for scalars.
- Tuning sizes of vector x to exercise the different paths for vectorized and scalar code.
- Adding wrong parameters and extreme value testing.
- Adding tests for overflow and underflow using max and min representable numbers for vectorized and scalar code.

AMD-Internal: [CPUPL-2732]
Change-Id: Ice8ee65095ecaa7b30ebd5f90ed2a890178533db
2023-07-28 05:03:00 -04:00
jagar
fb6f1380b2 Gtestsuite:Added util functions
- Functions to print matrix and vector elements.
- Functions to convert matrix to symmetric, hermitian
  triangular matrix and set diagonal elements in matrix.

AMD-Internal: [CPUPL-2732]
Change-Id: I1ffa5289329cbb8a9581bf545bdd157801cf5baa
2023-06-27 16:33:57 +05:30
jagar
003d1e9ae6 GTestSuite: Using ELEMENT_TYPE to specify generation of random numbers in tests.
Since random numbers are specified from ELEMENT_TYPE and we never generate tests for both integer and floating point numbers at the same time, we update code as described below:
- random vector/matrix generators are updated to use ELEMENT_TYPE as a default parameter.
- ::testing::Values(ELEMENT_TYPE) is removed from all test generators.

AMD-Internal: [CPUPL-2732]
Change-Id: Ibc6b05044502f541c9e8a7687931b1ca2903fb0c
2023-06-21 11:30:15 -04:00
Edward Smyth
7e50ba669b Code cleanup: No newline at end of file
Some text files were missing a newline at the end of the file.
One has been added.

Also correct file format of windows/tests/inputs.yaml, which
was missed in commit 0f0277e104

AMD-Internal: [CPUPL-2870]
Change-Id: Icb83a4a27033dc0ff325cb84a1cf399e953ec549
2023-04-21 10:02:48 -04:00
Edward Smyth
0f0277e104 Code cleanup: dos2unix file conversion
Source and other files in some directories were a mixture of
Unix and DOS file formats. Convert all relevant files to Unix
format for consistency. Some Windows-specific files remain in
DOS format.

AMD-Internal: [CPUPL-2870]
Change-Id: Ic9a0fddb2dba6dc8bcf0ad9b3cc93774a46caeeb
2023-04-21 08:41:16 -04:00
Eleni Vlachopoulou
ea484f38e6 BLIS GTestSuite fixes for ILP64.
- Adding doc regarding option setting for INT64 in README.
- Bugfix on template instantiation on helper function. Updated to use gtint_t instead of int.

AMD-Internal: [CPUPL-2732]
Change-Id: Ia52407a1ef3fdd06e905c2e3d4aa5befb80e82d6
2023-04-19 03:41:55 -04:00
jagar
f164c7fe70 Added GTestSuite helper functions
- Functions to convert to cblas enums from char.
- Functions to print matrix and vector elements.
- Functions to set matrix and vector elements with
  the given value.

AMD-Internal: [CPUPL-2732]
Change-Id: I1046b9578c8456e89eddba4a4e8577016b9361ca
2023-04-12 09:03:08 -04:00
Eleni Vlachopoulou
fa024b82ad Adding helper functionality for wrong input testing in GTestSuite.
- Added a header with correct default values to be used in tests.
- Updated README to include information on how to test for wrong parameters and some explanation on how lda increments work.

AMD-Internal: [CPUPL-2732]
Change-Id: I4f540d46013ffe91b4acb30da2b437251c09d3bc
2023-04-06 13:32:29 -04:00