<commit_before># Gemmlowp's public entry points

gemmlowp's public interface is defined in
[public/gemmlowp.h](../public/gemmlowp.h).

## GemmWithOutputPipeline

The primary public entry point is: `GemmWithOutputPipeline`.

A usage example is given in
[doc/quantization_example.cc](quantization_example.cc).

The high-level overview of how this specifies a low-precision matrix
multiplication is explained in [low-precision.md](low-precision.md). The
rationale for a specific quantization paradigm is given in
[quantization.md](quantization.md). That specific quantization paradigm is
implemented at two different stages of the computation: as pre-processing on
the operands and as post-processing on the result:

*   Pre-processing on the LHS, RHS operands, in the form of adding constant
    `lhs_offset`, `rhs_offset` to them, is explained in
    [low-precision.md](low-precision.md).

*   Post-processing on the result, in the form of a flexible "output pipeline",
    is explained in [output.md](output.md).

More details on this below as we discuss specific function parameters.

The prototype is:

```
template <typename InputScalar, typename OutputScalar, typename BitDepthParams,
          MapOrder LhsOrder, MapOrder RhsOrder, MapOrder ResultOrder,
          typename OutputPipelineType, typename GemmContextType>
void GemmWithOutputPipeline(GemmContextType* context,
                            const MatrixMap<const InputScalar, LhsOrder>& lhs,
                            const MatrixMap<const InputScalar, RhsOrder>& rhs,
                            MatrixMap<OutputScalar, ResultOrder>* result,
                            int lhs_offset, int rhs_offset,
                            const OutputPipelineType& output_pipeline);
```

A typical call looks like (from the [usage example](quantization_example.cc)):

```
gemmlowp::GemmWithOutputPipeline<std::uint8_t, std::uint8_t,
                                 gemmlowp::DefaultL8R8BitDepthParams>(
    &gemm_context, uint8_lhs_matrix, uint8_rhs_matrix,
    &uint8_result_matrix, lhs_offset, rhs_offset, output_pipeline);
```

### Template parameters

Typically only the 3 first template parameters need to be specified, the rest
being automatically deduced from function parameters:

*   `InputScalar`: The scalar type of the LHS and RHS operands. At the moment,
    this must be `std::uint8_t`.
*   `OutputScalar`: The scalar type of the LHS and RHS operands. At the moment,
    this must be `std::uint8_t`.
*   `BitDepthParams`: Defines the bit format of the input and output matrices
    and the required accuracy of the computation. At the moment, the only
    non-deprecated valid value is `gemmlowp::DefaultL8R8BitDepthParams`. See
    [less-than-8-bit.md](less-than-8-bit.md) for other values and the general<commit_msg>Fix documentation on OutputScalar in GemmWithOutputPipeline<commit_after># Gemmlowp's public entry points

gemmlowp's public interface is defined in
[public/gemmlowp.h](../public/gemmlowp.h).

## GemmWithOutputPipeline

The primary public entry point is: `GemmWithOutputPipeline`.

A usage example is given in
[doc/quantization_example.cc](quantization_example.cc).

The high-level overview of how this specifies a low-precision matrix
multiplication is explained in [low-precision.md](low-precision.md). The
rationale for a specific quantization paradigm is given in
[quantization.md](quantization.md). That specific quantization paradigm is
implemented at two different stages of the computation: as pre-processing on
the operands and as post-processing on the result:

*   Pre-processing on the LHS, RHS operands, in the form of adding constant
    `lhs_offset`, `rhs_offset` to them, is explained in
    [low-precision.md](low-precision.md).

*   Post-processing on the result, in the form of a flexible "output pipeline",
    is explained in [output.md](output.md).

More details on this below as we discuss specific function parameters.

The prototype is:

```
template <typename InputScalar, typename OutputScalar, typename BitDepthParams,
          MapOrder LhsOrder, MapOrder RhsOrder, MapOrder ResultOrder,
          typename OutputPipelineType, typename GemmContextType>
void GemmWithOutputPipeline(GemmContextType* context,
                            const MatrixMap<const InputScalar, LhsOrder>& lhs,
                            const MatrixMap<const InputScalar, RhsOrder>& rhs,
                            MatrixMap<OutputScalar, ResultOrder>* result,
                            int lhs_offset, int rhs_offset,
                            const OutputPipelineType& output_pipeline);
```

A typical call looks like (from the [usage example](quantization_example.cc)):

```
gemmlowp::GemmWithOutputPipeline<std::uint8_t, std::uint8_t,
                                 gemmlowp::DefaultL8R8BitDepthParams>(
    &gemm_context, uint8_lhs_matrix, uint8_rhs_matrix,
    &uint8_result_matrix, lhs_offset, rhs_offset, output_pipeline);
```

### Template parameters

Typically only the 3 first template parameters need to be specified, the rest
being automatically deduced from function parameters:

*   `InputScalar`: The scalar type of the LHS and RHS operands. At the moment,
    this must be `std::uint8_t`.
*   `OutputScalar`: The scalar type of the result. At the moment,
    this must be `std::uint8_t`.
*   `BitDepthParams`: Defines the bit format of the input and output matrices
    and the required accuracy of the computation. At the moment, the only
    non-deprecated valid value is `gemmlowp::DefaultL8R8BitDepthParams`. See
    [less-than-8-bit.md](less-than-8-bit.md) for other values and the general
{'fraction_non_alphanumeric': 0.07621082621082621, 'fraction_numerical': 0.004985754985754986, 'mean_word_length': 3.692564745196324, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6834581', 'n_tokens_mistral': 1579, 'n_tokens_neox': 1534, 'n_words': 555}