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

Definitions:
  - &small_matrix_size_range
    - { N: 4, lda: 4 }
    - { N: 9, lda: 9 }
    - { N: 16, lda: 16 }
    - { N: 63, lda: 63 }
    - { N: 65, lda: 65 }
    - { N: 128, lda: 128 }
    - { N:     1, lda:    1 }
    - { N:    10, lda:    9 }
    - { N:     1, lda:    1 }
    - { N:    10, lda:    2 }
    - { N:   200, lda:  200 }

  - &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:  1, lda: 0, 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 }

  - &tiny_matrix_size
    - { N:   127, lda: 127 }

  - &medium_matrix_size_range
    - { N:   400, lda:  400 }
    - { N:   500, lda:  601 }

  - &large_matrix_size_range
    - { N:  1000, lda: 1000 }
    - { N:  2000, lda: 2000 }
    - { N:  4011, lda: 4011 }

  - &incx_incy_range
    - { incx:   2, incy:   1 }
    - { incx:  -1, incy:   2 }
    - { incx:   1, incy:   1 }
    - { incx:  -1, incy:   3 }
    - { incx:   3, incy:  -1 }
    - { incx:  10, incy: 100 }

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

  - &alpha_beta_range
    - { alpha:  2.0, beta:  0.0, alphai: 1.5, betai: 0.5 }
    - { alpha: -1.0, beta: -1.0, alphai: 0.5, betai: 1.5 }
    - { alpha:  2.0, beta:  1.0, alphai: -1.5, betai: 0.5 }
    - { alpha:  0.0, beta:  1.0, alphai: -0.5, betai: 0 }

  - &alpha_beta_range_small
    - { alpha: 2.0, beta: 1.5, alphai: -0.5, betai: 2.5 }

Tests:
- name: hemv_bad_arg
  category: pre_checkin
  function:
  - hemv_bad_arg
  - hemv_batched_bad_arg
  - hemv_strided_batched_bad_arg
  precision: *single_double_precisions_complex
  uplo: N
  fortran: [ true, false ]

- name: hemv_NaN
  category: pre_checkin
  function: hemv
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *medium_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha: [ -1.0, .NaN ] # NaN is converted to 0.0 in test code
  alphai: [ 1.0 ]
  beta: [ 0.5, 1.0, .NaN ]
  betai: [ 0.5 ]

- name: hemv_fortran
  category: quick
  function: hemv
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha_beta: *alpha_beta_range_small
  fortran: true

- name: hemv_small
  category: quick
  function: hemv
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range
  alpha_beta: *alpha_beta_range

- name: hemv_medium
  category: pre_checkin
  function: hemv
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *medium_matrix_size_range
  incx_incy: *incx_incy_range
  alpha_beta: *alpha_beta_range

- name: hemv_large
  category: nightly
  function: hemv
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *large_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha_beta: *alpha_beta_range_small

# gemv_batched
- name: hemv_batched_NaN
  category: pre_checkin
  function: hemv_batched
  precision: *single_double_precisions_complex
  uplo: [ L ]
  matrix_size: *tiny_matrix_size
  incx_incy: *incx_incy_range
  alpha: [ 1.5, .NaN ] # NaN is converted to 0.0 in test code
  beta: [ 0.5, 1.0, .NaN ]
  batch_count: [ 2 ]

- name: hemv_batched_fortran
  category: quick
  function: hemv_batched
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha_beta: *alpha_beta_range_small
  batch_count: [ -1, 0, 3 ]
  fortran: true

- name: hemv_batched_small
  category: quick
  function: hemv_batched
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range
  alpha_beta: *alpha_beta_range
  batch_count: [ -1, 0, 1, 3 ]

- name: hemv_batched_medium
  category: pre_checkin
  function: hemv_batched
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *medium_matrix_size_range
  incx_incy: *incx_incy_range
  alpha_beta: *alpha_beta_range
  batch_count: [ 3 ]

- name: hemv_batched_large
  category: nightly
  function: hemv_batched
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *large_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha_beta: *alpha_beta_range_small
  batch_count: [ 3 ]

# hemv_strided_batched
- name: hemv_strided_batched_NaN
  category: pre_checkin
  function: hemv_strided_batched
  precision: *single_double_precisions_complex
  uplo: [ U ]
  matrix_size: *tiny_matrix_size
  incx_incy: *incx_incy_range
  alpha: [ 2.0, .NaN ] # NaN is converted to 0.0 in test code
  beta: [ 0.5, 1.0, .NaN ]
  batch_count: [ 2 ]
  stride_scale: [ 1.5 ]

- name: hemv_strided_batched_fortran
  category: quick
  function: hemv_strided_batched
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha_beta: *alpha_beta_range_small
  batch_count: [ -1, 0, 3 ]
  stride_scale: [ 2 ]
  fortran: true

- name: hemv_strided_batched_small
  category: quick
  function: hemv_strided_batched
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range
  alpha_beta: *alpha_beta_range
  batch_count: [ -1, 0, 1, 3 ]
  stride_scale: [ 1, 1.5, 5 ]

- name: hemv_strided_batched_medium
  category: pre_checkin
  function: hemv_strided_batched
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *medium_matrix_size_range
  incx_incy: *incx_incy_range
  alpha_beta: *alpha_beta_range
  batch_count: [ 3 ]
  stride_scale: [ 1 ]

- name: hemv_strided_batched_large
  category: nightly
  function: hemv_strided_batched
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  matrix_size: *large_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha_beta: *alpha_beta_range_small
  batch_count: [ 3 ]
  stride_scale: [ 1 ]
...
