tatami_mult
Multiply tatami matrices
Loading...
Searching...
No Matches
dispatch.hpp
Go to the documentation of this file.
1#ifndef TATAMI_MULT_DENSE_MATRIX_DENSE_ROW_DISPATCH_HPP
2#define TATAMI_MULT_DENSE_MATRIX_DENSE_ROW_DISPATCH_HPP
3
4#include "row_to_row.hpp"
5#include "row_to_column.hpp"
6#include "column_to_row.hpp"
8
9#include "../../utils.hpp"
10
16namespace tatami_mult {
17
46
54inline void set_num_threads(MultiplyDenseRowWithDenseMatrixOptions& options, int num_threads) {
55 options.column_to_column.num_threads = num_threads;
56 options.column_to_row.num_threads = num_threads;
57 options.row_to_column.num_threads = num_threads;
58 options.row_to_row.num_threads = num_threads;
59}
60
68inline void set_dense_primary_block_size(MultiplyDenseRowWithDenseMatrixOptions& options, int primary_block_size) {
69 options.column_to_column.primary_block_size = primary_block_size;
70 options.column_to_row.primary_block_size = primary_block_size;
71 options.row_to_column.primary_block_size = primary_block_size;
72 options.row_to_row.primary_block_size = primary_block_size;
73}
74
83inline void set_dense_secondary_block_size(MultiplyDenseRowWithDenseMatrixOptions& options, int secondary_block_size) {
84 options.column_to_column.secondary_block_size = secondary_block_size;
85 options.column_to_row.secondary_block_size = secondary_block_size;
86 options.row_to_column.secondary_block_size = secondary_block_size;
87 options.row_to_row.secondary_block_size = secondary_block_size;
88}
89
118template<std::size_t accumulators_ = 4, typename LeftValue_, typename LeftIndex_, typename RightValue_, typename RightIndex_, typename Output_>
122 Output_* const output,
123 const bool output_row_major,
125) {
126 if (right.prefer_rows()) {
127 if (output_row_major) {
129 } else {
131 }
132
133 } else {
134 if (output_row_major) {
136 } else {
138 }
139 }
140}
141
142}
143
144#endif
virtual bool prefer_rows() const=0
Dense row-major LHS, dense column-major matrix RHS, column-major output.
Dense row-major LHS, dense column-major matrix RHS, row-major output.
Dense row-major LHS, dense row-major matrix RHS, column-major output.
Dense row-major LHS, dense row-major matrix RHS, row-major output.
Multiplication of tatami matrices.
Definition column_to_column.hpp:19
void set_dense_primary_block_size(MultiplyDenseColumnWithDenseMatrixOptions &options, int primary_block_size)
Definition dispatch.hpp:68
void set_dense_secondary_block_size(MultiplyDenseColumnWithDenseMatrixOptions &options, int secondary_block_size)
Definition dispatch.hpp:83
void multiply_dense_row_with_dense_matrix(const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const tatami::Matrix< RightValue_, RightIndex_ > &right, Output_ *const output, const bool output_row_major, const MultiplyDenseRowWithDenseMatrixOptions &options)
Definition dispatch.hpp:119
void multiply_dense_row_with_dense_row_matrix_to_row_output(const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const RightColumns_ right_columns, GetRightRow_ get_right_row, Output_ *const output, const MultiplyDenseRowWithDenseRowMatrixToRowOutputOptions &options)
Definition row_to_row.hpp:68
void multiply_dense_row_with_dense_column_matrix_to_row_output(const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const RightColumns_ right_columns, GetRightColumn_ get_right_column, Output_ *const output, const MultiplyDenseRowWithDenseColumnMatrixToRowOutputOptions &options)
Definition column_to_row.hpp:70
void multiply_dense_row_with_dense_row_matrix_to_column_output(const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const RightColumns_ right_columns, GetRightRow_ get_right_row, Output_ *const output, const MultiplyDenseRowWithDenseRowMatrixToColumnOutputOptions &options)
Definition row_to_column.hpp:68
void set_num_threads(MultiplyDenseColumnWithDenseMatrixOptions &options, int num_threads)
Definition dispatch.hpp:54
void multiply_dense_row_with_dense_column_matrix_to_column_output(const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const RightColumns_ right_columns, GetRightColumn_ get_right_column, Output_ *const output, const MultiplyDenseRowWithDenseColumnMatrixToColumnOutputOptions &options)
Definition column_to_column.hpp:69
Options for multiply_dense_row_with_dense_column_matrix_to_column_output().
Definition column_to_column.hpp:27
Options for multiply_dense_row_with_dense_column_matrix_to_row_output().
Definition column_to_row.hpp:28
Options for multiply_dense_row_with_dense_matrix().
Definition dispatch.hpp:21
MultiplyDenseRowWithDenseColumnMatrixToColumnOutputOptions column_to_column
Definition dispatch.hpp:26
MultiplyDenseRowWithDenseRowMatrixToColumnOutputOptions row_to_column
Definition dispatch.hpp:38
MultiplyDenseRowWithDenseColumnMatrixToRowOutputOptions column_to_row
Definition dispatch.hpp:32
MultiplyDenseRowWithDenseRowMatrixToRowOutputOptions row_to_row
Definition dispatch.hpp:44
Options for multiply_dense_row_with_dense_row_matrix_to_column_output().
Definition row_to_column.hpp:28
Options for multiply_dense_row_with_dense_row_matrix_to_row_output().
Definition row_to_row.hpp:28