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

Definitions:
  - &small_matrix_size_range
    - { N:     1 }
    - { N:    10 }
    - { N:    16 }
    - { N:    33 }
    - { N:    65 }

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

  - &medium_matrix_size_range
    - { N:  1000 }
    - { N:  2011 }

  - &large_matrix_size_range
    - { N:  2048 }
    - { N:  4011 }

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

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

Tests:

- name: spr2_bad_arg
  category: pre_checkin
  function:
  - spr2_bad_arg: *single_double_precisions
  - spr2_batched_bad_arg: *single_double_precisions
  - spr2_strided_batched_bad_arg: *single_double_precisions
  fortran: [ false, true ]

- name: spr2_arg_check
  category: quick
  function:
  - spr2: *single_double_precisions
  - spr2_batched: *single_double_precisions
  - spr2_strided_batched: *single_double_precisions
  uplo: L
  matrix_size: *special_case_range

- name: spr2_fortran
  category: quick
  function: spr2
  precision: *single_double_precisions
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha: [ 2.0 ]
  fortran: true

- name: spr2_NaN
  category: quick
  function: spr2
  precision: *single_double_precisions
  uplo: [ U ]
  N: [ 33 ]
  incx_incy: *incx_incy_range_small
  alpha: [ .NaN ]

- name: spr2_small
  category: quick
  function: spr2
  precision: *single_double_precisions
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range
  alpha: [ -0.5, 1.0, 0.0 ]

- name: spr2_medium
  category: pre_checkin
  function: spr2
  precision: *single_double_precisions
  uplo: [ U, L ]
  matrix_size: *medium_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha: [ -0.5, 2.0 ]

- name: spr2_large
  category: nightly
  function: spr2
  precision: *single_double_precisions
  uplo: [ U, L ]
  matrix_size: *large_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha: [ 1000.6 ]

# batched
- name: spr2_batched_fortran
  category: quick
  function: spr2_batched
  precision: *single_double_precisions
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha: [ 2.0 ]
  batch_count: [ -1, 0, 3 ]
  fortran: true

- name: spr2_batched_small
  category: quick
  function: spr2_batched
  precision: *single_double_precisions
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range
  alpha: [ -0.5, 2.0, 0.0 ]
  batch_count: [ 1, 5 ]

- name: spr2_batched_medium
  category: pre_checkin
  function: spr2_batched
  precision: *single_double_precisions
  uplo: [ U, L ]
  matrix_size: *medium_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha: [ -0.5, 2.0 ]
  batch_count: [ 1, 3 ]

- name: spr2_batched_large
  category: nightly
  function: spr2_batched
  precision: *single_double_precisions
  uplo: [ U ]
  matrix_size: *large_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha: [ 1000.6 ]
  batch_count: [ 1, 3 ]

# strided batched
- name: spr2_strided_batched_fortran
  category: quick
  function: spr2_strided_batched
  precision: *single_double_precisions
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha: [ 2.0 ]
  batch_count: [ -1, 0, 3 ]
  stride_scale: [ 2 ]
  fortran: true

- name: spr2_strided_batched_small
  category: quick
  function: spr2_strided_batched
  precision: *single_double_precisions
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range
  alpha: [ -0.5, 2.0, 0.0 ]
  stride_scale: [ 1.0, 2.5 ]
  batch_count: [ 1, 5 ]

- name: spr2_strided_batched_medium
  category: pre_checkin
  function: spr2_strided_batched
  precision: *single_double_precisions
  uplo: [ U, L ]
  matrix_size: *medium_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha: [ -0.5, 2.0 ]
  stride_scale: [ 1.0 ]
  batch_count: [ 1, 3 ]

- name: spr2_strided_large
  category: nightly
  function: spr2_strided_batched
  precision: *single_double_precisions
  uplo: [ L ]
  matrix_size: *large_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha: [ 1000.6 ]
  stride_scale: [ 1.0 ]
  batch_count: [ 1, 3 ]

...
