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

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

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

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

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

  - &alpha_range
    - { alpha: -0.5, alphai:  1.5 }
    - { alpha:  0.0, alphai:  0.0 }
    - { alpha:  0.0, alphai:  2.0 }
    - { alpha:  1.0, alphai:  0.0 }

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

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

Tests:

- name: spr_bad_arg
  category: pre_checkin
  function:
  - spr_bad_arg: *single_double_precisions
  - spr_batched_bad_arg: *single_double_precisions
  - spr_strided_batched_bad_arg: *single_double_precisions
  fortran: [ false, true ]

- name: spr_arg_check
  category: quick
  function:
  - spr
  - spr_batched
  - spr_strided_batched
  precision: *single_double_precisions
  uplo: L
  matrix_size: *special_case_range

- name: spr_fortran
  category: quick
  function: spr
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx: [ 2 ]
  alpha_beta: *alpha_range_small
  fortran: true

- name: spr_small
  category: quick
  function: spr
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx: [ 1, -2, 10 ]
  alpha_beta: *alpha_range

- name: spr_NaN
  category: quick
  function: spr
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  N: [ 33 ]
  incx: [ 1 ]
  alpha_beta: *alpha_nan

- name: spr_medium
  category: pre_checkin
  function: spr
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *medium_matrix_size_range
  incx: [ 2, -1 ]
  alpha_beta: *alpha_range_small

- name: spr_large
  category: nightly
  function: spr
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *large_matrix_size_range
  incx: [ 1 ]
  alpha_beta: *alpha_range_small

# batched
- name: spr_batched_fortran
  category: quick
  function: spr_batched
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx: [ 2 ]
  alpha_beta: *alpha_range_small
  batch_count: [ -1, 0, 3 ]
  fortran: true

- name: spr_batched_small
  category: quick
  function: spr_batched
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx: [ 1, -2, 10 ]
  alpha_beta: *alpha_range
  batch_count: [ 1, 5 ]

- name: spr_batched_medium
  category: pre_checkin
  function: spr_batched
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *medium_matrix_size_range
  incx: [ 2, -2 ]
  alpha_beta: *alpha_range_small
  batch_count: [ 1, 3 ]

- name: spr_batched_large
  category: nightly
  function: spr_batched
  precision: *single_double_precisions_complex_real
  uplo: [ L ]
  matrix_size: *large_matrix_size_range
  incx: [ 1 ]
  alpha_beta: *alpha_range_small
  batch_count: [ 1, 3 ]

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

- name: spr_strided_batched_small
  category: quick
  function: spr_strided_batched
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx: [ 1, -2, 10 ]
  alpha_beta: *alpha_range
  stride_scale: [ 1.0, 2.0 ]
  batch_count: [ 1, 5 ]

- name: spr_strided_batched_medium
  category: pre_checkin
  function: spr_strided_batched
  precision: *single_double_precisions_complex_real
  uplo: [ U, L ]
  matrix_size: *medium_matrix_size_range
  incx: [ 2, -1 ]
  alpha_beta: *alpha_range_small
  stride_scale: [ 1.0 ]
  batch_count: [ 1, 3 ]

- name: spr_strided_large
  category: nightly
  function: spr_strided_batched
  precision: *single_double_precisions_complex_real
  uplo: [ U ]
  matrix_size: *large_matrix_size_range
  incx: [ 1 ]
  alpha_beta: *alpha_range_small
  stride_scale: [ 1.0 ]
  batch_count: [ 1, 3 ]

...
