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

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

  - &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:   400 }
    - { N:   500 }

  - &large_matrix_size_range
    - { N:  1000 }
    - { N:  2000 }
    - { N:  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: -1.5 }

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

- name: hpmv_arg_check
  category: quick
  function:
  - hpmv
  - hpmv_batched
  - hpmv_strided_batched
  precision: *single_double_precisions_complex
  uplo: L
  matrix_size: *special_case_range

- name: hpmv_NaN
  category: pre_checkin
  function: hpmv
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  N: [ 129 ]
  incx_incy: *incx_incy_range_small
  alpha: [ 2.0, .NaN ] # NaN is converted to 0.0 in test code
  beta: [ 1.0, 0.5, .NaN ]

- name: hpmv_fortran
  category: quick
  function: hpmv
  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: hpmv_small
  category: quick
  function: hpmv
  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: hpmv_medium
  category: pre_checkin
  function: hpmv
  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: hpmv_large
  category: nightly
  function: hpmv
  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

- name: hpmv_batched_bad_arg
  category: pre_checkin
  function: hpmv_batched_bad_arg
  precision: *single_double_precisions_complex
  uplo: N

- name: hpmv_batched_NaN
  category: pre_checkin
  function: hpmv_batched
  precision: *single_double_precisions_complex
  uplo: [ L ]
  N: [ 129 ]
  incx_incy: *incx_incy_range_small
  alpha: [ 2.0, .NaN ] # NaN is converted to 0.0 in test code
  beta: [ 0.5, 1.0, .NaN ]
  batch_count: [ 3 ]

- name: hpmv_batched_fortran
  category: quick
  function: hpmv_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: hpmv_batched_small
  category: quick
  function: hpmv_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: hpmv_batched_medium
  category: pre_checkin
  function: hpmv_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: hpmv_batched_large
  category: nightly
  function: hpmv_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 ]

- name: hpmv_strided_batched_bad_arg
  category: pre_checkin
  function: hpmv_strided_batched_bad_arg
  precision: *single_double_precisions_complex
  uplo: N

- name: hpmv_strided_batched_NaN
  category: pre_checkin
  function: hpmv_strided_batched
  precision: *single_double_precisions_complex
  uplo: [ U ]
  N: [ 129 ]
  incx_incy: *incx_incy_range_small
  alpha: [ 2.0, .NaN ] # NaN is converted to 0.0 in test code
  alphai: [ 0.5 ]
  beta: [ 0.5, 1.0, .NaN ]
  batch_count: [ 2 ]
  stride_scale: [ 1.5 ]

- name: hpmv_strided_batched_fortran
  category: quick
  function: hpmv_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: hpmv_strided_batched_small
  category: quick
  function: hpmv_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: hpmv_strided_batched_medium
  category: pre_checkin
  function: hpmv_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: hpmv_strided_batched_large
  category: nightly
  function: hpmv_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 ]
...
