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

Definitions:
  - &small_matrix_size_range
    - { M:     4, lda:     4, stride_a: 16 }
    - { M:    10, lda:    20, stride_a: 300 }
    - { M:   10, lda:   10, stride_a: 100 }
    - { M:   128, lda:   128, stride_a: 32768 }

  - &special_case_range
    - { M: 0, lda: 1, incx: 1, batch_count: 1 }
    - { M: 1, lda: 1, incx: 1, batch_count: 0 }

    - { M: -1, lda: 1, incx: 1, batch_count:  0 }
    - { M:  0, lda: 0, incx: 1, batch_count:  0 }
    - { M:  2, lda: 1, incx: 1, batch_count:  0 }
    - { M:  0, lda: 1, incx: 0, batch_count:  0 }
    - { M:  0, lda: 1, incx: 1, batch_count: -1 }

  - &medium_matrix_size_range
    - { M:   192, lda:   192, stride_a: 36864 }
    - { M:   256, lda:   256, stride_a: 65536 }
    - { M:   511, lda:   613, stride_a: 413243 }
    - { M:   800, lda:   801, stride_a: 640800 }

  - &large_matrix_size_range
    - { M:  1000, lda:  1000, stride_a: 1000000 }
    - { M:  1024, lda:  1024, stride_a: 1048576 }
    - { M:  2000, lda:  2000, stride_a: 4000000 }
    - { M:  1000, lda:  4096, stride_a: 10000000 }

  - &common_args
    precision: *single_double_precisions_complex_real
    uplo: [L, U]
    transA: [N, T, C]
    diag: [N, U]

Tests:
- name: trsv_arg_check
  category: quick
  function:
  - trsv: *single_double_precisions
  - trsv_batched: *single_double_precisions
  - trsv_strided_batched: *single_double_precisions
  uplo: L
  transA: N
  diag: N
  matrix_size: *special_case_range
  fortran: [ false, true ]

# Regular trsv
- name: trsv_fortran
  category: quick
  function: trsv
  arguments: *common_args
  matrix_size: *small_matrix_size_range
  incx: [ 2 ]
  fortran: true

- name: trsv_small
  category: quick
  function: trsv
  arguments: *common_args
  matrix_size: *small_matrix_size_range
  incx: [ -3, -1, 1, 3, 100 ]

- name: trsv_medium
  category: pre_checkin
  function: trsv
  arguments: *common_args
  matrix_size: *medium_matrix_size_range
  incx: [ -1, 2 ]

- name: trsv_large
  category: nightly
  function: trsv
  arguments: *common_args
  matrix_size: *large_matrix_size_range
  incx: [ 2 ]

# trsv_batched
- name: trsv_batched_fortran
  category: quick
  function: trsv_batched
  arguments: *common_args
  matrix_size: *small_matrix_size_range
  incx: [ 2 ]
  batch_count: [ -1, 0, 3 ]
  fortran: true

- name: trsv_batched_small
  category: quick
  function: trsv_batched
  arguments: *common_args
  matrix_size: *small_matrix_size_range
  incx: [ -3, -1, 1, 3, 100 ]
  batch_count: [ 1, 3, 5 ]

- name: trsv_batched_medium
  category: pre_checkin
  function: trsv_batched
  arguments: *common_args
  matrix_size: *medium_matrix_size_range
  incx: [ -1, 2 ]
  batch_count: [ 1, 3 ]

- name: trsv_batched_large
  category: nightly
  function: trsv_batched
  arguments: *common_args
  matrix_size: *large_matrix_size_range
  incx: [ 2 ]
  batch_count: [ 3 ]

# trsv_strided_batched
- name: trsv_strided_batched_fortran
  category: quick
  function: trsv_strided_batched
  arguments: *common_args
  matrix_size: *small_matrix_size_range
  incx: [ 2 ]
  batch_count: [ -1, 0, 3 ]
  stride_scale: [ 2 ]
  fortran: true

- name: trsv_strided_batched_small
  category: quick
  function: trsv_strided_batched
  arguments: *common_args
  matrix_size: *small_matrix_size_range
  incx: [ -3, -1, 1, 3, 100 ]
  stride_scale: [ 1, 10 ]
  batch_count: [ 1, 3, 5 ]

- name: trsv_strided_batched_medium
  category: pre_checkin
  function: trsv_strided_batched
  arguments: *common_args
  matrix_size: *medium_matrix_size_range
  incx: [ -2, 1 ]
  stride_scale: [ 1 ]
  batch_count: [ 1, 3 ]

- name: trsv_strided_batched_large
  category: nightly
  function: trsv_strided_batched
  arguments: *common_args
  matrix_size: *large_matrix_size_range
  incx: [ -1, 1, 2, 3 ]
  stride_scale: [ 1 ]
  batch_count: [ 3 ]
...
