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

Definitions:
  - &quick_matrix_size_range
    - { N:  -1,  lda:   1,  K:  1,  ldc:  1 } # bad n
    - { N:   2,  lda:   2,  K: -1,  ldc:  1 } # bad k
    - { N:   0,  lda:   3,  K:  3,  ldc:  3 } # n==0
    - { N:   3,  lda:   3,  K:  0,  ldc:  3 } # k==0
    - { N:   3,  lda:   1,  K:  1,  ldc:  3 } # bad lda if not transpose
    - { N:   1,  lda:   1,  K:  3,  ldc:  3 } # bad lda if transpose
    - { N:   3,  lda:   3,  K:  3,  ldc:  1 } # bad ldc
    - { N:   33, lda:  33,  K: 33,  ldc: 33 } # okay

  - &tiny_matrix_size
    - { N:   199, lda:  199, K:  32,   ldc: 199 }

  - &medium_matrix_size_range
    - { N:   199, lda:  199, K:  32,   ldc: 199 }
    - { N:    88, lda:  200, K:  200,  ldc: 88 }

  - &large_matrix_size_range
    - { N:  2011, lda:  2011, K:  253, ldc: 2048 }
    - { N:  5000, lda:  5008, K:  164, ldc: 5000 }

  - &alpha_beta_range
    - { alpha:  1.5, beta:  0.0 }
    - { alpha: -2.0, beta: -1.0 }
    - { alpha:  0.0, beta:  1.0 } # quick success
    - { alpha:  0.0, beta:  2.0 } # scale step only

  - &alpha_beta_range_small
    - { alpha:  0.5, beta:  1.0 }

Tests:
- name: herk_bad
  category: pre_checkin
  function: herk_bad_arg
  precision: *single_double_precisions_complex
  fortran: [ false, true ]

- name: herk_quick
  category: quick
  function: herk
  precision: *single_double_precisions_complex
  uplo: [ U ]
  transA: [ N, C ]
  matrix_size: *quick_matrix_size_range
  alpha: [ 0, 1 ]
  beta: [ 0, 1 ]

- name: herk_medium
  category: pre_checkin
  function: herk
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  transA: [N, C]
  matrix_size: *medium_matrix_size_range
  alpha_beta: *alpha_beta_range
  fortran: [ false, true ]

- name: herk_NaN
  category: pre_checkin
  function: herk
  precision: *single_double_precisions_complex
  uplo: [ U ]
  transA: [N, C]
  matrix_size: *tiny_matrix_size
  alpha: [ 1.0, .NaN ]  # NaN is converted to 0.0 in test code
  beta: [ 0.5, 1.0, .NaN ]


- name: herk_large
  category: nightly
  function: herk
  precision: *single_double_precisions_complex
  uplo: [ U ]
  transA: [N, C]
  matrix_size: *large_matrix_size_range
  alpha_beta: *alpha_beta_range_small

  # batched
- name: herk_batched_bad
  category: pre_checkin
  function: herk_batched_bad_arg
  precision: *single_precision
  fortran: [ false, true ]

- name: herk_batched_quick
  category: quick
  function: herk_batched
  precision: *single_double_precisions_complex
  uplo: [ U ]
  transA: [ N, C ]
  matrix_size: *quick_matrix_size_range
  alpha: [ 0, 1 ]
  beta: [ 0, 1 ]
  batch_count: [ 0, 1 ]

- name: herk_batched_medium
  category: pre_checkin
  function: herk_batched
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  transA: [N, C]
  matrix_size: *medium_matrix_size_range
  alpha_beta: *alpha_beta_range
  batch_count: [ 1, 7 ]
  fortran: [ false, true ]

- name: herk_batched_large
  category: nightly
  function: herk_batched
  precision: *single_double_precisions_complex
  uplo: [ L ]
  transA: [N]
  matrix_size: *large_matrix_size_range
  alpha_beta: *alpha_beta_range_small
  batch_count: [ 2 ]

  # strided batched
- name: herk_strided_batched_bad
  category: pre_checkin
  function: herk_strided_batched_bad_arg
  precision: *single_precision
  fortran: [ false, true ]

- name: herk_strided_batched_quick
  category: quick
  function: herk_strided_batched
  precision: *single_double_precisions_complex
  uplo: [ U ]
  transA: [ N, C ]
  matrix_size: *quick_matrix_size_range
  alpha: [ 0, 1 ]
  beta: [ 0, 1 ]
  batch_count: [ 0, 1 ]

- name: herk_strided_batched_medium
  category: pre_checkin
  function: herk_strided_batched
  precision: *single_double_precisions_complex
  uplo: [ U, L ]
  transA: [N, C]
  matrix_size: *medium_matrix_size_range
  alpha_beta: *alpha_beta_range
  batch_count: [ 2 ]
  fortran: [ false, true ]

- name: herk_strided_batched_large
  category: nightly
  function: herk_strided_batched
  precision: *single_double_precisions_complex
  uplo: [ U ]
  transA: [N]
  matrix_size: *large_matrix_size_range
  alpha_beta: *alpha_beta_range_small
  batch_count: [ 5 ]



...
