# ########################################################################
# Copyright (c) 2020-2021 Advanced Micro Devices, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# ########################################################################

---
include: rocsparse_common.yaml
include: known_bugs.yaml

Definitions:
  - &M_N_range_quick
    - { M:  50, N:  50 }
    - { M: 187, N: 187 }

  - &M_N_range_checkin
    - { M:  -1, N:  -1 }
    - { M:   0, N:   0 }
    - { M:  79, N:  79 }
    - { M: 430, N: 430 }

  - &M_N_range_nightly
    - { M:   9381, N:   9381 }
    - { M:  37017, N:  37017 }
    - { M: 505194, N: 505194 }

Tests:
- name: bsrilu0_bad_arg
  category: pre_checkin
  function: bsrilu0_bad_arg
  precision: *single_double_precisions_complex_real

- name: bsrilu0
  category: quick
  function: bsrilu0
  precision: *single_double_precisions_complex_real
  M_N: *M_N_range_quick
  block_dim: [4]
  transA: [rocsparse_operation_none]
  apol: [rocsparse_analysis_policy_reuse]
  spol: [rocsparse_solve_policy_auto]
  baseA: [rocsparse_index_base_zero, rocsparse_index_base_one]
  direction: [rocsparse_direction_row, rocsparse_direction_column]
  matrix: [rocsparse_matrix_zero]

- name: bsrilu0
  category: quick
  function: bsrilu0
  precision: *single_double_precisions_complex_real
  M_N: *M_N_range_quick
  block_dim: [1, 4, 9]
  transA: [rocsparse_operation_none]
  apol: [rocsparse_analysis_policy_reuse]
  spol: [rocsparse_solve_policy_auto]
  baseA: [rocsparse_index_base_zero, rocsparse_index_base_one]
  direction: [rocsparse_direction_row, rocsparse_direction_column]
  matrix: [rocsparse_matrix_random]

- name: bsrilu0
  category: quick
  function: bsrilu0
  precision: *single_double_precisions
  M_N: *M_N_range_quick
  block_dim: [9]
  numericboost: [0, 1]
  boosttol: [0.2, 0.5, 0.9, 1.1]
  boostval: [0.5, 1.2]
  transA: [rocsparse_operation_none]
  apol: [rocsparse_analysis_policy_reuse]
  spol: [rocsparse_solve_policy_auto]
  baseA: [rocsparse_index_base_zero, rocsparse_index_base_one]
  direction: [rocsparse_direction_row, rocsparse_direction_column]
  matrix: [rocsparse_matrix_random]

- name: bsrilu0
  category: pre_checkin
  function: bsrilu0
  precision: *single_double_precisions_complex_real
  M_N: *M_N_range_checkin
  block_dim: [0, 3, 6, 15, 27]
  transA: [rocsparse_operation_none]
  apol: [rocsparse_analysis_policy_reuse, rocsparse_analysis_policy_force]
  spol: [rocsparse_solve_policy_auto]
  baseA: [rocsparse_index_base_zero, rocsparse_index_base_one]
  direction: [rocsparse_direction_row, rocsparse_direction_column]
  matrix: [rocsparse_matrix_random]

- name: bsrilu0
  category: nightly
  function: bsrilu0
  precision: *single_double_precisions_complex_real
  M_N: *M_N_range_nightly
  block_dim: [5]
  transA: [rocsparse_operation_none]
  apol: [rocsparse_analysis_policy_reuse, rocsparse_analysis_policy_force]
  spol: [rocsparse_solve_policy_auto]
  baseA: [rocsparse_index_base_zero, rocsparse_index_base_one]
  direction: [rocsparse_direction_row, rocsparse_direction_column]
  matrix: [rocsparse_matrix_random]

- name: bsrilu0_file
  category: quick
  function: bsrilu0
  precision: *single_double_precisions
  M: 1
  N: 1
  block_dim: [5]
  numericboost: [0, 1]
  boosttol: [0.01]
  boostval: [1.2]
  transA: [rocsparse_operation_none]
  apol: [rocsparse_analysis_policy_reuse]
  spol: [rocsparse_solve_policy_auto]
  baseA: [rocsparse_index_base_zero]
  direction: [rocsparse_direction_row]
  matrix: [rocsparse_matrix_file_rocalution]
  filename: [nos4,
             nos6,
             nos1,
             nos2]

- name: bsrilu0_file
  category: pre_checkin
  function: bsrilu0
  precision: *double_precision
  M: 1
  N: 1
  block_dim: [5, 8]
  transA: [rocsparse_operation_none]
  apol: [rocsparse_analysis_policy_reuse, rocsparse_analysis_policy_force]
  spol: [rocsparse_solve_policy_auto]
  baseA: [rocsparse_index_base_one]
  direction: [rocsparse_direction_column]
  matrix: [rocsparse_matrix_file_rocalution]
  filename: [mc2depi,
             scircuit,
             mac_econ_fwd500]

- name: bsrilu0_file
  category: nightly
  function: bsrilu0
  precision: *single_double_precisions
  M: 1
  N: 1
  block_dim: [3]
  transA: [rocsparse_operation_none]
  apol: [rocsparse_analysis_policy_reuse]
  spol: [rocsparse_solve_policy_auto]
  baseA: [rocsparse_index_base_zero]
  direction: [rocsparse_direction_column]
  matrix: [rocsparse_matrix_file_rocalution]
  filename: [amazon0312,
             nos3,
             nos5,
             nos7]

- name: bsrilu0_file
  category: quick
  function: bsrilu0
  precision: *single_double_precisions_complex
  M: 1
  N: 1
  block_dim: [7]
  numericboost: [0, 1]
  boosttol: [0.5]
  boostval: [1.2]
  transA: [rocsparse_operation_none]
  apol: [rocsparse_analysis_policy_reuse, rocsparse_analysis_policy_force]
  spol: [rocsparse_solve_policy_auto]
  baseA: [rocsparse_index_base_zero]
  direction: [rocsparse_direction_column]
  matrix: [rocsparse_matrix_file_rocalution]
  filename: [Chevron2]

- name: bsrilu0_file
  category: pre_checkin
  function: bsrilu0
  precision: *single_double_precisions_complex
  M: 1
  N: 1
  block_dim: [8, 16]
  transA: [rocsparse_operation_none]
  apol: [rocsparse_analysis_policy_force]
  spol: [rocsparse_solve_policy_auto]
  baseA: [rocsparse_index_base_zero]
  direction: [rocsparse_direction_row]
  matrix: [rocsparse_matrix_file_rocalution]
  filename: [Chevron3]

- name: bsrilu0_file
  category: nightly
  function: bsrilu0
  precision: *single_double_precisions_complex
  M: 1
  N: 1
  block_dim: [9]
  transA: [rocsparse_operation_none]
  apol: [rocsparse_analysis_policy_force]
  spol: [rocsparse_solve_policy_auto]
  baseA: [rocsparse_index_base_one]
  direction: [rocsparse_direction_column]
  matrix: [rocsparse_matrix_file_rocalution]
  filename: [Chevron4]
