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

Definitions:
  - &tiny_matrix
    - { M:   16, N:   16, lda:   16, stride_a:  256 }

  - &small_matrix_size_range
    - { M:   11, N:   12, lda:   13, stride_a:  156 }
    - { M:   16, N:   16, lda:   16, stride_a:  256 }
    - { M:   33, N:   32, lda:   33, stride_a: 1056 }
    - { M:   10, N:   60, lda:   20, stride_a: 1200 }
    - { M:   24, N:    1, lda:   24, stride_a: 24 }
    - { M:    1, N:   11, lda:    4, stride_a: 44 }

  - &special_case_range
    # Quick return
    - { M:    0, N:   1, lda:   1, incx: 1, incy: 1, batch_count: 1 }
    - { M:    1, N:   0, lda:   1, incx: 1, incy: 1, batch_count: 1 }
    - { M:    1, N:   1, lda:   1, incx: 1, incy: 1, batch_count: 0 }

    # invalid arg checks
    - { M:   -1, N:   0, lda:   1, incx: 1, incy: 1, batch_count:  0 }
    - { M:    0, N:  -1, lda:   1, incx: 1, incy: 1, batch_count:  0 }
    - { M:    5, N:   0, lda:   4, incx: 1, incy: 1, batch_count:  0 }
    - { M:    0, N:   0, lda:   0, incx: 1, incy: 1, batch_count:  0 }
    - { M:    0, N:   0, lda:   1, incx: 0, incy: 1, batch_count:  0 }
    - { M:    0, N:   0, lda:   1, incx: 1, incy: 0, batch_count:  0 }
    - { M:    0, N:   0, lda:   1, incx: 1, incy: 1, batch_count: -1 }

  - &medium_matrix_size_range
    - { M:  600, N:  500, lda:  600, stride_a:  300000 }
    - { M:  500, N:  700, lda:  500, stride_a:  350000 }
    - { M: 1000, N: 1000, lda: 1000, stride_a: 1000100 }

  - &large_matrix_size_range
    - { M: 1025, N: 4011, lda: 1025, stride_a:   4111275 }
    - { M: 7000, N: 2000, lda: 7000, stride_a:   14000000 }

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

  - &size_t_index
    - { M: 46431, N: 46431, lda: 46431, stride_a: 2147488281 }

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


Tests:
- name: ger_bad_arg
  category: pre_checkin
  function:
  - ger_bad_arg
  - ger_batched_bad_arg
  - ger_strided_batched_bad_arg
  precision: *single_double_precisions
  fortran: [ false, true ]

- name: ger_arg_check
  category: quick
  function:
  - ger
  - ger_batched
  - ger_strided_batched
  precision: *single_double_precisions
  transA: N
  matrix_size: *special_case_range

- name: ger_size_t_M
  category: nightly
  function:
  - ger
  # shared code for size_t with non-batched
  #- ger_batched
  #- ger_strided_batched
  precision: *single_double_precisions
  matrix_size: *size_t_index
  incx_incy: *incx_incy_range_small
  alpha: [ -0.5 ]

# Regular ger
- name: ger_fortran
  category: quick
  function: ger
  precision: *single_double_precisions
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha: [ 2.0 ]
  fortran: [ true ]

- name: ger_NaN
  category: quick
  function: ger
  precision: *single_double_precisions
  transA: N
  matrix_size: *tiny_matrix
  incx_incy: *incx_incy_range_small
  alpha: [ .NaN ]

- name: ger_small
  category: quick
  function: ger
  precision: *single_double_precisions
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range
  alpha: [ -0.5, 2.0, 0.0 ]

- name: ger_medium
  category: pre_checkin
  function: ger
  precision: *single_double_precisions
  matrix_size: *medium_matrix_size_range
  incx_incy: *incx_incy_range
  alpha: [ -0.5, 2.0, 0.0 ]

- name: ger_large
  category: nightly
  function: ger
  precision: *single_double_precisions
  matrix_size: *large_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha: [ -0.5, 2.0, 0.0, 0.6 ]

# ger_batched
- name: ger_batched_fortran
  category: quick
  function: ger_batched
  precision: *single_double_precisions
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha: [ 2.0 ]
  batch_count: [ -1, 0, 3 ]
  fortran: [ true ]

- name: ger_batched_small
  category: quick
  function: ger_batched
  precision: *single_double_precisions
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range
  alpha: [ -0.5, 2.0, 0.0 ]
  batch_count: [ -5, 0, 1, 5, 10 ]

- name: ger_batched_medium
  category: pre_checkin
  function: ger_batched
  precision: *single_double_precisions
  matrix_size: *medium_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha: [ 2.0, 0.0 ]
  batch_count: [ 1, 10 ]

- name: ger_batched_large
  category: nightly
  function: ger_batched
  precision: *single_double_precisions
  matrix_size: *large_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha: [ 2.0, 0.0 ]
  batch_count: [ 3 ]

# ger_strided_batched
- name: ger_strided_batched_fortran
  category: quick
  function: ger_strided_batched
  precision: *single_double_precisions
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha: [ 2.0 ]
  batch_count: [ -1, 0, 3 ]
  stride_scale: [ 2 ]
  fortran: [ true ]

- name: ger_strided_batched_small
  category: quick
  function: ger_strided_batched
  precision: *single_double_precisions
  matrix_size: *small_matrix_size_range
  incx_incy: *incx_incy_range
  alpha: [ -0.5, 0.0 ]
  stride_scale: [ 1, 2 ]
  batch_count: [ -5, 0, 1, 5, 10 ]

- name: ger_strided_batched_medium
  category: pre_checkin
  function: ger_strided_batched
  precision: *single_double_precisions
  matrix_size: *medium_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha: [ -0.5, 0.0 ]
  stride_scale: [ 1 ]
  batch_count: [ 1, 10 ]

- name: ger_strided_batched_large
  category: nightly
  function: ger_strided_batched
  precision: *single_double_precisions
  matrix_size: *large_matrix_size_range
  incx_incy: *incx_incy_range_small
  alpha: [ -0.5, 0.0 ]
  stride_scale: [ 1 ]
  batch_count: [ 3 ]
...
