# ########################################################################
# Copyright (c) 2019 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.
#
# ########################################################################

# Data types are defined as either aliases to Python-recognized ctypes,
# or enums defined with c_int base clases and attributes.
Datatypes:
  - rocsparse_int: c_int
  - rocsparse_datatype:
      bases: [ c_int ]
      attr:
        f32_r: 151
        f64_r: 152
        f32_c: 154
        f64_c: 155
  - { single: f32_r, double: f64_r }
  - { single complex: f32_c, double complex: f64_c }
  - rocsparse_matrix_init:
      bases: [ c_int ]
      attr:
        rocsparse_matrix_random: 0
        rocsparse_matrix_laplace_2d: 1
        rocsparse_matrix_laplace_3d: 2
        rocsparse_matrix_file_mtx: 3
        rocsparse_matrix_file_rocalution: 4
  - rocsparse_operation:
      bases: [ c_int ]
      attr:
        rocsparse_operation_none: 111
        rocsparse_operation_transpose: 112
        rocsparse_operation_conjugate_transpose: 113
  - rocsparse_index_base:
      bases: [ c_int ]
      attr:
        rocsparse_index_base_zero: 0
        rocsparse_index_base_one: 1
  - rocsparse_diag_type:
      bases: [ c_int ]
      attr:
        rocsparse_diag_type_non_unit: 0
        rocsparse_diag_type_unit: 1
  - rocsparse_fill_mode:
      bases: [ c_int ]
      attr:
        rocsparse_fill_mode_lower: 0
        rocsparse_fill_mode_upper: 1
  - rocsparse_action:
      bases: [ c_int ]
      attr:
        rocsparse_action_symbolic: 0
        rocsparse_action_numeric: 1
  - rocsparse_hyb_partition:
      bases: [ c_int ]
      attr:
        rocsparse_hyb_partition_auto: 0
        rocsparse_hyb_partition_user: 1
        rocsparse_hyb_partition_max: 2
  - rocsparse_analysis_policy:
      bases: [ c_int ]
      attr:
        rocsparse_analysis_policy_reuse: 0
        rocsparse_analysis_policy_force: 1
  - rocsparse_solve_policy:
      bases: [ c_int ]
      attr:
        rocsparse_solve_policy_auto: 0

Real precisions: &real_precisions
  - &single_precision
    { compute_type: f32_r }
  - &double_precision
    { compute_type: f64_r }

Complex precisions: &complex_precisions
  - &single_precision_complex
    { compute_type: f32_c }
  - &double_precision_complex
    { compute_type: f64_c }

C precisions real: &single_double_precisions
  - *single_precision
  - *double_precision

C precisions complex: &single_double_precisions_complex
  - *single_precision_complex
  - *double_precision_complex

C precisions complex and real: &single_double_precisions_complex_real
  - *single_precision
  - *double_precision
  - *single_precision_complex
  - *double_precision_complex

# The Arguments struct passed directly to C++. See rocsparse_arguments.hpp.
# The order of the entries is significant, so it can't simply be a dictionary.
# The types on the RHS are eval'd for Python-recognized types including ctypes
# and datatypes defined in Datatypes above. T*n represents array of length n.
Arguments:
  - M: rocsparse_int
  - N: rocsparse_int
  - K: rocsparse_int
  - nnz: rocsparse_int
  - dimx: rocsparse_int
  - dimy: rocsparse_int
  - dimz: rocsparse_int
  - compute_type: rocsparse_datatype
  - alpha: c_double
  - alphai: c_double
  - beta: c_double
  - betai: c_double
  - transA: rocsparse_operation
  - transB: rocsparse_operation
  - baseA: rocsparse_index_base
  - baseB: rocsparse_index_base
  - baseC: rocsparse_index_base
  - baseD: rocsparse_index_base
  - action: rocsparse_action
  - part: rocsparse_hyb_partition
  - diag: rocsparse_diag_type
  - uplo: rocsparse_fill_mode
  - apol: rocsparse_analysis_policy
  - spol: rocsparse_solve_policy
  - matrix: rocsparse_matrix_init
  - unit_check: rocsparse_int
  - timing: rocsparse_int
  - iters: rocsparse_int
  - algo: c_uint
  - filename: c_char*64
  - function: c_char*64
  - name: c_char*64
  - category: c_char*32

# These named dictionary lists [ {dict1}, {dict2}, etc. ] supply subsets of
# test arguments in a structured way. The dictionaries are applied to the test
# one at a time, to generate combinations.  If one of this table's entries is
# a dictionary of size one, it means that the argument named by its key takes
# on values paired with argument named by its value. For example:
#
# - function: precision
#
# when used with the code:
#
# function:
#   func1: prec1
#   func2: prec2
#   func3: prec3
#
# causes (function, precision) to take on the values (func1, prec1),
# (func2, prec2), (func3, prec3), etc.

Dictionary lists to expand:
  - arguments
  - M_N
  - M_N_K
  - dimx_dimy_dimz
  - transA_transB
  - alpha_beta
  - alpha_alphai
  - beta_betai
  - alphai_betai
  - matrix_size
  - precision
  - function: precision

# In case an array argument needs to be passed directly to C as an array,
# it needs to be listed here to avoid being expanded into multiple test
# cases with each of its elements.
Lists to not expand:
  - e.g., an array argument not to be expanded

# Defaults
Defaults:
  M: -1
  N: -1
  K: -1
  nnz: -1
  dimx: 0
  dimy: 0
  dimz: 0
  alpha: 1.0
  alphai: 0.0
  beta: 0.0
  betai: 0.0
  transA: rocsparse_operation_none
  transB: rocsparse_operation_none
  baseA: rocsparse_index_base_zero
  baseB: rocsparse_index_base_zero
  baseC: rocsparse_index_base_zero
  baseD: rocsparse_index_base_zero
  action: rocsparse_action_numeric
  part: rocsparse_hyb_partition_auto
  diag: rocsparse_diag_type_non_unit
  uplo: rocsparse_fill_mode_lower
  apol: rocsparse_analysis_policy_reuse
  spol: rocsparse_solve_policy_auto
  matrix: rocsparse_matrix_random
  unit_check: 1
  timing: 0
  iters: 10
  algo: 0
  workspace_size: 0
  category: nightly
  filename: '*'
  name: '*'
