def gen_profiler(
    func_attrs,
    workdir,
    dim_info_dict,
    args_parse,
    gemm_flag,
    problem_args_template=None,
    extra_header_template=None,
    tensor_decl_template=TENSOR_DECL_TEMPLATE,
    extra_shape_template=EXTRA_SHAPE_TEMPLATE,
    extra_code="",
):
    """Generates standalone executables for profiler.

    Parameters
    ----------
    func_attrs : Dict
        Operation attributes.
    workdir : str
        Directory to store the generated outputs.
    dim_info_dict: Dict[str, DimInfo]
        Generated from bmm._extract_dims().
        Used to store mapping between dim_names to input / output tensor dims.
    args_parse: str
        Profiler input argument parser.
    gemm_flag : str
        Flag telling which backend should be generated. options are '','bias','bias_relu','bias_sigmoid','bias_add_relu'.
    extra_code : str
        Extra code for self-defined operators.
    """
    if problem_args_template is None:
        if gemm_flag == "":
            problem_args_template = PROBLEM_ARGS_TEMPLATE
        else:
            problem_args_template = PROBLEM_ARGS_TEMPLATE_MULTI_D

    if extra_header_template is None:
        if gemm_flag == "":
            extra_header_template = EXTRA_HEADER_TEMPLATE
        else:
            extra_header_template = EXTRA_HEADER_TEMPLATE_MULTI_D

    return common.gen_profiler(
        func_attrs,
        workdir,
        dim_info_dict,
        args_parse,
        gemm_flag,
        extra_code=extra_code,
        ndims=3,
        extra_shape_template=extra_shape_template,
        problem_args_template=problem_args_template,
        extra_header_template=extra_header_template,
        tensor_decl_template=tensor_decl_template,
    )
Generates standalone executables for profiler.

Parameters
----------
func_attrs : Dict
Operation attributes.
workdir : str
Directory to store the generated outputs.
dim_info_dict: Dict[str, DimInfo]
Generated from bmm._extract_dims().
Used to store mapping between dim_names to input / output tensor dims.
args_parse: str
Profiler input argument parser.
gemm_flag : str
Flag telling which backend should be generated. options are '','bias','bias_relu','bias_sigmoid','bias_add_relu'.
extra_code : str
Extra code for self-defined operators.
python/aitemplate/backend/rocm/gemm/bmm_common.py