![]() |
(git:b77b4be)
|
#include <assert.h>
#include <limits.h>
#include <omp.h>
#include <stdlib.h>
#include <string.h>
#include "../offload/offload_runtime.h"
#include "dbm_hyperparams.h"
#include "dbm_internal.h"
#include "dbm_library.h"
#include "dbm_mempool.h"
#include "dbm_multiply.h"
#include "dbm_multiply_comm.h"
#include "dbm_multiply_cpu.h"
#include "dbm_multiply_gpu.h"
Go to the source code of this file.
Data Structures | |
struct | backend_context_t |
Private struct for storing the context of the multiplication backend. More... | |
Functions | |
static float * | compute_rows_max_eps (const bool trans, const dbm_matrix_t *matrix, const double filter_eps) |
Private routine for computing the max filter threshold for each row. | |
static backend_context_t * | backend_start (const dbm_matrix_t *matrix_c) |
Private routine for initializing the multiplication backend. | |
static void | backend_upload_packs (const dbm_pack_t *pack_a, const dbm_pack_t *pack_b, backend_context_t *ctx) |
Private routine for handing newly arrived packs to the backend. | |
static void | backend_process_batch (const int ntasks, dbm_task_t batch[ntasks], const double alpha, const dbm_pack_t *pack_a, const dbm_pack_t *pack_b, const int kshard, dbm_shard_t *shard_c, backend_context_t *ctx) |
Private routine for sending a batch to the multiplication backend. | |
static void | backend_download_results (backend_context_t *ctx) |
Private routine for downloading results of the multiplication backend. | |
static void | backend_stop (backend_context_t *ctx) |
Private routine for shutting down the multiplication backend. | |
static void | multiply_packs (const bool transa, const bool transb, const double alpha, const dbm_pack_t *pack_a, const dbm_pack_t *pack_b, const dbm_matrix_t *matrix_a, const dbm_matrix_t *matrix_b, dbm_matrix_t *matrix_c, const bool retain_sparsity, const float *rows_max_eps, int64_t *flop, backend_context_t *ctx) |
Private routine for multipling two packs. | |
void | dbm_multiply (const bool transa, const bool transb, const double alpha, const dbm_matrix_t *matrix_a, const dbm_matrix_t *matrix_b, const double beta, dbm_matrix_t *matrix_c, const bool retain_sparsity, const double filter_eps, int64_t *flop) |
Performs a multiplication of two dbm_matrix_t matrices. See dbm_matrix.h for details. | |
|
static |
Private routine for computing the max filter threshold for each row.
Definition at line 36 of file dbm_multiply.c.
|
static |
Private routine for initializing the multiplication backend.
Definition at line 84 of file dbm_multiply.c.
|
static |
Private routine for handing newly arrived packs to the backend.
Definition at line 101 of file dbm_multiply.c.
|
static |
Private routine for sending a batch to the multiplication backend.
Definition at line 118 of file dbm_multiply.c.
|
static |
Private routine for downloading results of the multiplication backend.
Definition at line 180 of file dbm_multiply.c.
|
static |
Private routine for shutting down the multiplication backend.
Definition at line 192 of file dbm_multiply.c.
|
static |
Private routine for multipling two packs.
Definition at line 203 of file dbm_multiply.c.
void dbm_multiply | ( | const bool | transa, |
const bool | transb, | ||
const double | alpha, | ||
const dbm_matrix_t * | matrix_a, | ||
const dbm_matrix_t * | matrix_b, | ||
const double | beta, | ||
dbm_matrix_t * | matrix_c, | ||
const bool | retain_sparsity, | ||
const double | filter_eps, | ||
int64_t * | flop | ||
) |
Performs a multiplication of two dbm_matrix_t matrices. See dbm_matrix.h for details.
Performs a multiplication of two dbm_matrix_t matrices, as C := alpha * op( A ) * op( B ) + beta * C.
Definition at line 354 of file dbm_multiply.c.