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

Definitions:
  - &tiny_matrix
    - { N:   16, lda:   16 }

  - &small_matrix_size_range
    - { N:     4, lda:   3 } # invalid lda
    - { N:     1, lda:   1 }
    - { N:    10, lda:  10 }
    - { N:    11, lda:  15 }
    - { N:    16, lda:  16 }
    - { N:    33, lda:  33 }
    - { N:    65, lda: 100 }

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

  - &medium_matrix_size_range
    - { N:  1000, lda: 1000 }
    - { N:  2011, lda: 2012 }

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

# These sizes don't test the size_t index support
  - &size_t_index
    - { N:  23170, lda: 23170, stride_a:  1073744140, stride_x: 23170 }

  - &alpha_range
    - { alpha:  2.0 }
    - { alpha: -1.0 }
    - { alpha:  0.0 }

  - &alpha_range_small
    - { alpha: 4.0 }

Tests:

- name: her_bad_arg
  category: pre_checkin
  function:
  - her_bad_arg: *single_double_precisions_complex
  - her_batched_bad_arg: *single_double_precisions_complex
  - her_strided_batched_bad_arg: *single_double_precisions_complex
  fortran: [ false, true ]

- name: her_arg_check
  category: quick
  function:
  - her
  - her_batched
  - her_strided_batched
  precision: *single_double_precisions_complex
  uplo: U
  matrix_size: *special_case_range

# Regular her
- name: her_fortran
  category: quick
  function: her
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx: [ 2 ]
  alpha_beta: *alpha_range_small
  fortran: true

- name: her_NaN
  category: quick
  function: her
  precision: *single_double_precisions_complex
  uplo: [ U ]
  matrix_size: *tiny_matrix
  incx: [ 1 ]
  alpha: [ .NaN ]

- name: her_small
  category: quick
  function: her
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx: [ -2, 1, 99 ]
  alpha_beta: *alpha_range

- name: her_medium
  category: pre_checkin
  function: her
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *medium_matrix_size_range
  incx: [ 2 ]
  alpha_beta: *alpha_range_small

- name: her_large
  category: nightly
  function: her
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *large_matrix_size_range
  incx: [ 1 ]
  alpha_beta: *alpha_range_small

# her_batched
- name: her_batched_fortran
  category: quick
  function: her_batched
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx: [ 2 ]
  alpha_beta: *alpha_range_small
  batch_count: [ -1, 0, 3 ]
  fortran: true

- name: her_batched_small
  category: quick
  function: her_batched
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx: [ -2, 1, 99 ]
  alpha_beta: *alpha_range
  batch_count: [ 1, 5 ]

- name: her_batched_medium
  category: pre_checkin
  function: her_batched
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *medium_matrix_size_range
  incx: [ 2 ]
  alpha_beta: *alpha_range_small
  batch_count: [ 1, 3 ]

- name: her_batched_large
  category: nightly
  function: her_batched
  precision: *single_double_precisions_complex
  uplo: [ U ]
  matrix_size: *large_matrix_size_range
  incx: [ 1 ]
  alpha_beta: *alpha_range_small
  batch_count: [ 1, 3 ]

# her_strided_batched
- name: her_batched_fortran
  category: quick
  function: her_batched
  precision: *single_double_precisions_complex
  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: her_strided_batched_small
  category: quick
  function: her_strided_batched
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx: [ -2, 1, 99 ]
  alpha_beta: *alpha_range
  stride_scale: [ 1.0, 2.5 ]
  batch_count: [ 1, 5 ]

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

- name: her_strided_large
  category: nightly
  function: her_strided_batched
  precision: *single_double_precisions_complex
  uplo: [ L ]
  matrix_size: *large_matrix_size_range
  incx: [ 1 ]
  alpha_beta: *alpha_range_small
  stride_scale: [ 1.0 ]
  batch_count: [ 1, 3 ]

- name: her_size_t_M
  category: nightly
  function:
  - her: *single_precision_complex
  # shared code for size_t with non-batched
  #- her_batched: *single_precision_complex
  #- her_strided_batched: *single_precision_complex
  uplo: [ U ]
  matrix_size: *size_t_index
  incx: [ 1 ]
  alpha_beta: *alpha_range_small

...
