# Data types are defined as either aliases to Python-recognized ctypes,
# or enums defined with c_int base clases and attributes.
Datatypes:
  - rocblas_int: c_int
  - rocblas_datatype:
      bases: [ c_int ]
      attr:
        f16_r: 150
        f32_r: 151
        f64_r: 152
        f16_c: 153
        f32_c: 154
        f64_c: 155
        i8_r:  160
        u8_r:  161
        i32_r: 162
        u32_r: 163
        i8_c:  164
        u8_c:  165
        i32_c: 166
        u32_c: 167
        bf16_r: 168
        bf16_c: 169
  - { half: f16_r, single: f32_r, double: f64_r }
  - { half complex: f16_c, single complex: f32_c, double complex: f64_c }
  - rocblas_initialization:
      bases: [ c_int ]
      attr:
        rand_int: 111
        trig_float: 222
        hpl: 333
        special: 444
  - rocblas_gemm_flags:
      bases: [ c_uint32 ]
      attr:
        none: 0
  - rocblas_atomics_mode:
      bases: [ c_int ]
      attr:
        atomics_not_allowed: 0
        atomics_allowed: 1

Common threads and streams: &common_threads_streams
  - { threads: 0,  streams: 0}
  # - { threads: 0, streams: 1 }
  # - { threads: 1, streams: 0 }
  # - { threads: 3, streams: 3 }
  # - { threads: 5, streams: 5 }

Real precisions: &real_precisions
  - &half_precision
    { a_type: f16_r, b_type: f16_r, c_type: f16_r, d_type: f16_r, compute_type: f16_r }
  - &hpa_half_precision
    { a_type: f16_r, b_type: f16_r, c_type: f16_r, d_type: f16_r, compute_type: f32_r }
  - &hpa_half_in_single_out_precision
    { a_type: f16_r, b_type: f16_r, c_type: f32_r, d_type: f32_r, compute_type: f32_r }
  - &single_precision
    { a_type: f32_r, b_type: f32_r, c_type: f32_r, d_type: f32_r, compute_type: f32_r }
  - &double_precision
    { a_type: f64_r, b_type: f64_r, c_type: f64_r, d_type: f64_r, compute_type: f64_r }
  - &int8_precision
    { a_type:  i8_r, b_type:  i8_r, c_type: i32_r, d_type: i32_r, compute_type: i32_r }
  - &bf16_precision
    { a_type:  bf16_r, b_type:  bf16_r, c_type: bf16_r, d_type: bf16_r, compute_type: bf16_r }
  - &hpa_bf16_precision
    { a_type:  bf16_r, b_type:  bf16_r, c_type: bf16_r, d_type: bf16_r, compute_type: f32_r }
  - &hpa_bf16_in_single_out_precision
    { a_type:  bf16_r, b_type:  bf16_r, c_type: f32_r, d_type: f32_r, compute_type: f32_r }
  - &hpa_half_float_alpha
    { a_type: f32_r, b_type: f16_r, c_type: f16_r, d_type: f16_r, compute_type: f32_r }

C precisions: &single_double_precisions
  - *single_precision
  - *double_precision

Short simple precisions: &half_single_precisions
  - *half_precision
  - *single_precision

Short precisions: &int8_half_single_precisions
  - *int8_precision
  - *half_precision
  - *single_precision

Hpa half and half: &hpa_half_half_precisions
  - *hpa_half_precision
  - *half_precision
  - *hpa_half_float_alpha

ML precisions: &hpa_half_single_precisions
  - *hpa_half_precision
  - *hpa_half_in_single_out_precision
  - *half_precision
  - *single_precision

Non-int precisions: &hpa_half_single_double_precisions
  - *hpa_half_precision
  - *hpa_half_in_single_out_precision
  - *half_precision
  - *single_precision
  - *double_precision

Non-int8 Real precisions: &nonint8_real_precisions
  - *hpa_half_precision
  - *hpa_half_in_single_out_precision
  - *half_precision
  - *single_precision
  - *double_precision
  - *bf16_precision
  - *hpa_bf16_precision
  - *hpa_bf16_in_single_out_precision
  - *hpa_half_float_alpha

Simple precisions: &half_single_double_precisions
  - *half_precision
  - *single_precision
  - *double_precision

Complex precisions: &complex_precisions
  # don't define until required
  #- &half_precision_complex
  #  { a_type: f16_c, b_type: f16_c, c_type: f16_c, d_type: f16_c, compute_type: f16_c }
  #- &hpa_half_precision_complex
  #  { a_type: f16_c, b_type: f16_c, c_type: f16_c, d_type: f16_c, compute_type: f32_c }
  - &single_precision_complex
    { a_type: f32_c, b_type: f32_c, c_type: f32_c, d_type: f32_c, compute_type: f32_c }
  - &double_precision_complex
    { a_type: f64_c, b_type: f64_c, c_type: f64_c, d_type: f64_c, compute_type: f64_c }
  #- &int8_precision_complex
  #  { a_type:  i8_c, b_type:  i8_c, c_type: i32_c, d_type: i32_c, compute_type: i32_c }
  - &hpa_bf16_precision_complex
    { a_type:  bf16_c, b_type:  bf16_c, c_type: bf16_c, d_type: bf16_c, compute_type: f32_c }

# no half or less complex required yet

#Half Precision complex and real: &half_precision_complex_real
#  - *half_precision
#  - *half_precision_complex

#Hpa Half Precision complex and real: &hpa_half_precision_complex_real
#  - *hpa_half_precision
#  - *hpa_half_in_single_out_precision
#  - *hpa_half_precision_complex

Single Precision complex and real: &single_precision_complex_real
  - *single_precision
  - *single_precision_complex

Double Precision complex and real: &double_precision_complex_real
  - *double_precision
  - *double_precision_complex

# int8 Precision complex and real: &int8_precision_complex_real
#   - *int8_precision
#   - *int8_precision_complex

hpabf16 Precision complex and real: &hpa_bf16_precision_complex_real
  - *hpa_bf16_precision
  - *hpa_bf16_in_single_out_precision
  - *hpa_bf16_precision_complex

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

Short simple precisions complex and real: &half_single_precisions_complex_real
  - *half_precision
  - *single_precision
#  - *half_precision_complex
  - *single_precision_complex

Short precisions complex and real: &int8_half_single_precisions_complex_real
  - *int8_precision
  - *half_precision
  - *single_precision
#  - *int8_precision_complex
#  - *half_precision_complex
  - *single_precision_complex

ML precisions complex and real: &hpa_half_single_precisions_complex_real
  - *hpa_half_precision
  - *hpa_half_in_single_out_precision
  - *half_precision
  - *single_precision
#  - *hpa_half_precision_complex
#  - *half_precision_complex
  - *single_precision_complex

Non-int precisions complex and real: &hpa_half_single_double_precisions_complex_real
  - *hpa_half_precision
  - *hpa_half_in_single_out_precision
  - *half_precision
  - *single_precision
  - *double_precision
#  - *hpa_half_precision_complex
#  - *half_precision_complex
  - *single_precision_complex
  - *double_precision_complex

Simple precisions complex and real: &half_single_double_precisions_complex_real
  - *half_precision
  - *single_precision
  - *double_precision
#  - *half_precision_complex
  - *single_precision_complex
  - *double_precision_complex



#############################################
#               Used for Scal               #
#############################################

# scal order mapping is x, alpha
scal Joined precisions: &scal_complex_real_alpha_complex_out
  - &scal_single_precision_complex_real_alpha_complex_out
    { a_type: f32_c, b_type: f32_r, c_type: f32_c, d_type: f32_c, compute_type: f32_c }
  - &scal_double_precision_complex_real_alpha_complex_out
    { a_type: f64_c, b_type: f64_r, c_type: f64_c, d_type: f64_c, compute_type: f64_c }

scal Single double joined: &scal_single_double_complex_real_alpha_complex_out
  - *scal_single_precision_complex_real_alpha_complex_out
  - *scal_double_precision_complex_real_alpha_complex_out

#############################################
#             Used for Scal_ex              #
#############################################

# scal_ex order mapping is alpha, x, y, o, compute
scal_ex precisions: &scal_ex_complex_real_alpha_complex_out
  - &scal_ex_single_precision_complex_real_alpha_complex_out
    { a_type: f32_r, b_type: f32_c, c_type: f32_c, d_type: f32_c, compute_type: f32_c }
  - &scal_ex_double_precision_complex_real_alpha_complex_out
    { a_type: f64_r, b_type: f64_c, c_type: f64_c, d_type: f64_c, compute_type: f64_c }

scal_ex Single double joined: &scal_ex_single_double_complex_real_alpha_complex_out
  - *scal_ex_single_precision_complex_real_alpha_complex_out
  - *scal_ex_double_precision_complex_real_alpha_complex_out

#############################################
#           Used for rot* and nrm2_ex       #
#############################################
Complex real mixed: &complex_real_mixed
  - &single_precision_complex_real_in_complex_compute
    { a_type: f32_c, b_type: f32_r, c_type: f32_c, d_type: f32_c, compute_type: f32_c }
  - &double_precision_complex_real_in_complex_compute
    { a_type: f64_c, b_type: f64_r, c_type: f64_c, d_type: f64_c, compute_type: f64_c }
  - &single_precision_complex_real_in_real_compute
    { a_type: f32_c, b_type: f32_r, c_type: f32_c, d_type: f32_c, compute_type: f32_r }
  - &double_precision_complex_real_in_real_compute
    { a_type: f64_c, b_type: f64_r, c_type: f64_c, d_type: f64_c, compute_type: f64_r }
  - &single_precision_complex_real_c
    { a_type: f32_c, b_type: f32_c, c_type: f32_r, d_type: f32_c, compute_type: f32_c }
  - &double_precision_complex_real_c
    { a_type: f64_c, b_type: f64_c, c_type: f64_r, d_type: f64_c, compute_type: f64_c }

rot precisions: &rot_precisions
  - *single_precision
  - *double_precision
  - *single_precision_complex_real_in_complex_compute
  - *single_precision_complex_real_in_real_compute
  - *double_precision_complex_real_in_complex_compute
  - *double_precision_complex_real_in_real_compute

rot_ex precisions: &rot_ex_precisions
  - *single_precision
  - *double_precision
  - *single_precision_complex
  - *double_precision_complex
  - *hpa_half_precision
  - *hpa_bf16_precision
  - *single_precision_complex_real_c
  - *double_precision_complex_real_c

rotg precisions: &rotg_precisions
  - *single_precision
  - *double_precision
  - *single_precision_complex_real_in_complex_compute
  - *double_precision_complex_real_in_complex_compute

#############################################
#           Used for Dot (quick)            #
#############################################
Half bfloat single double complex real: &half_bfloat_single_double_complex_real_precisions
  - *half_precision
  - *hpa_bf16_precision
  - *hpa_bf16_in_single_out_precision
  - *single_precision
  - *double_precision
#  - *half_precision_complex
  - *single_precision_complex
  - *double_precision_complex

#############################################
#           Used for axpy_ex                #
#############################################
Hpa single double complex real: &half_single_double_complex_real_precisions
  - *hpa_half_float_alpha
  - *single_precision
  - *double_precision
  - *single_precision_complex
  - *double_precision_complex
  - *hpa_half_precision
  - *hpa_half_in_single_out_precision
  - *half_precision

#############################################
#           Used for nrm2_ex                #
#############################################
nrm2_ex precisions: &nrm2_ex_precisions
  - &half_precision_nrm2
    { a_type: f16_r, b_type: f16_r, c_type: f32_r, d_type: f32_r, compute_type: f32_r }
  - *single_precision
  - *double_precision
  - *single_precision_complex_real_in_real_compute
  - *double_precision_complex_real_in_real_compute

nrm2_ex precisions double: &nrm2_ex_precisions_double
  - *double_precision
  - *double_precision_complex_real_in_real_compute

# The Arguments struct passed directly to C++. See rocblas_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:
  - function: c_char*64
  - name: c_char*64
  - category: c_char*64
  - known_bug_platforms: c_char*64
  - alpha: c_double
  - alphai: c_double
  - beta: c_double
  - betai: c_double
  - stride_a: c_int64
  - stride_b: c_int64
  - stride_c: c_int64
  - stride_d: c_int64
  - stride_x: c_int64
  - stride_y: c_int64
  - user_allocated_workspace: c_size_t
  - M: rocblas_int
  - N: rocblas_int
  - K: rocblas_int
  - KL: rocblas_int
  - KU: rocblas_int
  - lda: rocblas_int
  - ldb: rocblas_int
  - ldc: rocblas_int
  - ldd: rocblas_int
  - incx: rocblas_int
  - incy: rocblas_int
  - incd: rocblas_int
  - incb: rocblas_int
  - batch_count: rocblas_int
  - iters: rocblas_int
  - cold_iters: rocblas_int
  - algo: c_uint32
  - solution_index: c_int32
  - flags: rocblas_gemm_flags
  - a_type: rocblas_datatype
  - b_type: rocblas_datatype
  - c_type: rocblas_datatype
  - d_type: rocblas_datatype
  - compute_type: rocblas_datatype
  - initialization: rocblas_initialization
  - atomics_mode: rocblas_atomics_mode
  - pad: c_uint32
  - threads: c_uint16
  - streams: c_uint16
  - devices: c_uint8
  - norm_check: c_int8
  - unit_check: c_int8
  - timing: c_int8
  - transA: c_char
  - transB: c_char
  - side: c_char
  - uplo: c_char
  - diag: c_char
  - c_noalias_d: c_bool
  - HMM: c_bool
  - fortran: c_bool

# 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
  - transA_transB
  - alpha_beta
  - alphai_betai
  - incx_incy
  - matrix_size
  - precision
  - function: precision
  - threads_streams

# 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: 128
  N: 128
  K: 128
  KL: 128
  KU: 128
  incx: 0
  incy: 0
  incd: 0
  incb: 0
  alpha: 1.0
  alphai: 0.0
  beta: 0.0
  betai: 0.0
  transA: '*'
  transB: '*'
  side: '*'
  uplo: '*'
  diag: '*'
  batch_count: 1
  HMM: false
  pad: 4096
  threads: 0
  streams: 0
  devices: 0
  fortran: false
  norm_check: 0
  unit_check: 1
  timing: 0
  iters: 10
  cold_iters: 2
  algo: 0
  solution_index: 0
  flags: none
  atomics_mode: atomics_allowed
  workspace_size: 0
  initialization: rand_int
  category: nightly
  known_bug_platforms: ''
  name: rocblas-bench
  c_noalias_d: false
  user_allocated_workspace: 0
