---
include: rocblas_common.yaml
include: known_bugs.yaml

Definitions:
  - &small_matrix_size_range
    - { N:     5, lda:   4 }
    - { N:     1, lda:  10 }
    - { N:    10, lda:  11 }
    - { N:    16, lda:  20 }
    - { N:    33, lda:  33 }
    - { N:    65, lda:  65 }

  - &special_case_range
    # Quick return
    - { N: 0, lda: 1, incx: 1, incy: 1, batch_count: 1 }
    - { N: 1, lda: 1, incx: 1, incy: 1, batch_count: 0 }
    # invalid_arg checks
    - { N: -1, lda: 1, incx: 1, incy: 1, batch_count:  0 }
    - { N:  0, lda: 0, incx: 1, incy: 1, batch_count:  0 }
    - { N:  2, lda: 1, incx: 1, incy: 1, batch_count:  0 }
    - { N:  0, lda: 1, incx: 0, incy: 1, batch_count:  0 }
    - { N:  0, lda: 1, incx: 1, incy: 0, batch_count:  0 }
    - { N:  0, lda: 1, incx: 1, incy: 1, batch_count: -1 }

  - &medium_matrix_size_range
    - { N:  1000, lda: 1003 }
    - { N:  2011, lda: 2048 }

  - &large_matrix_size_range
    - { N:  3000, lda: 3000 }
    - { N:  4011, lda: 4012 }

  - &incx_incy_range
    - { incx:  1, incy:  1 }
    - { incx:  1, incy: -2 }
    - { incx: -2, incy:  1 }

  - &incx_incy_range_small
    - { incx:  2, incy:  1 }

  - &alpha_range
    - { alpha:    0, alphai:   0 }
    - { alpha:    0, alphai: 2.0 }
    - { alpha:  1.0, alphai:   0 }
    - { alpha: -1.5, alphai: 2.5 }

  - &alpha_range_small
    - { alpha: 1.5, alphai: -0.5 }

  - &alpha_nan
    - { alpha: .NaN, alphai: .NaN }

Tests:

- name: syr2_bad_arg
  category: pre_checkin
  function:
  - syr2_bad_arg: *single_double_precisions_complex_real
  - syr2_batched_bad_arg: *single_double_precisions_complex_real
  - syr2_strided_batched_bad_arg: *single_double_precisions_complex_real
  fortran: [ false, true ]

- name: syr2_arg_check
  category: quick
  function:
  - syr2: *single_double_precisions_complex_real
  - syr2_batched: *single_double_precisions_complex_real
  - syr2_strided_batched: *single_double_precisions_complex_real
  uplo: L
  matrix_size: *special_case_range

- name: syr2_fortran
  category: quick
  function: syr2
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha_beta: *alpha_range_small
  fortran: true

- name: syr2_NaN
  category: quick
  function: syr2
  precision: *single_double_precisions_complex_real
  uplo: [ U ]
  N: [ 32 ]
  lda: [ 32 ]
  incx: [ 1 ]
  alpha_beta: *alpha_nan

- name: syr2_small
  category: quick
  function: syr2
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range
  alpha_beta: *alpha_range

- name: syr2_medium
  category: pre_checkin
  function: syr2
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *medium_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha_beta: *alpha_range_small

- name: syr2_large
  category: nightly
  function: syr2
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *large_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha_beta: *alpha_range_small

# batched
- name: syr2_batched_fortran
  category: quick
  function: syr2_batched
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha_beta: *alpha_range_small
  batch_count: [ -1, 0, 3 ]
  fortran: true

- name: syr2_batched_small
  category: quick
  function: syr2_batched
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range
  alpha_beta: *alpha_range
  batch_count: [ -1, 0, 1, 5 ]

- name: syr2_batched_medium
  category: pre_checkin
  function: syr2_batched
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *medium_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha_beta: *alpha_range_small
  batch_count: [ 1, 3 ]

- name: syr2_batched_large
  category: nightly
  function: syr2_batched
  precision: *single_double_precisions_complex_real
  uplo: [ U ]
  matrix_size: *large_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha_beta: *alpha_range_small
  batch_count: [ 1, 3 ]

# strided batched
- name: syr2_batched_fortran
  category: quick
  function: syr2_batched
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha_beta: *alpha_range_small
  batch_count: [ -1, 0, 3 ]
  stride_scale: [ 2 ]
  fortran: true

- name: syr2_strided_batched_small
  category: quick
  function: syr2_strided_batched
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range
  alpha_beta: *alpha_range
  stride_scale: [ 1.0, 2.5 ]
  batch_count: [ -1, 0, 1, 5 ]

- name: syr2_strided_batched_medium
  category: pre_checkin
  function: syr2_strided_batched
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *medium_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha_beta: *alpha_range_small
  stride_scale: [ 1.0 ]
  batch_count: [ 1, 3 ]

- name: syr2_strided_large
  category: nightly
  function: syr2_strided_batched
  precision: *single_double_precisions_complex_real
  uplo: [ L ]
  matrix_size: *large_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha_beta: *alpha_range_small
  stride_scale: [ 1.0 ]
  batch_count: [ 1, 3 ]

...
