def gen_profiler(
    func_attrs: Dict[str, Any], workdir: str, header_files: str, backend_spec
):
    """Generates code for argmax profiling.

    Parameters
    ----------
    func_attrs : Dict[str, Any]
        Stores the operation attributes.
    workdir: str
        Target directory for generated C++ source code files
    header_files : str
        Includes the header files for a backend.
    backend_spec : class
        Specifies the backend configurations.

    Returns
    -------
    None
    """
    op_type = func_attrs["op"]
    file_pairs = []
    index_type = backend_spec.index_type
    prefix = backend_spec.prefix
    cub = backend_spec.cub

    dtype = backend_spec.dtype_to_backend_type(func_attrs["inputs"][0]._attrs["dtype"])

    code = PROFILER_TEMPLATE.render(
        header_files=header_files,
        func_signature=FUNC_SIGNATURE.render(
            func_name=func_attrs["name"],
            index_type=index_type,
            prefix=prefix,
            dtype=dtype,
        ),
        kernel=KERNEL_TEMPLATE.render(
            cub=cub, index_type=index_type, prefix=prefix, is_hipcub=(cub == "hipcub")
        ),
        cub=cub,
        dtype=dtype,
    )
    op_name = func_attrs["op"]
    add_profiler(file_pairs, workdir, op_type, op_name, code)
    return file_pairs
Generates code for argmax profiling.

Parameters
----------
func_attrs : Dict[str, Any]
Stores the operation attributes.
workdir: str
Target directory for generated C++ source code files
header_files : str
Includes the header files for a backend.
backend_spec : class
Specifies the backend configurations.

Returns
-------
None
python/aitemplate/backend/common/tensor/argmax_common.py