Skip to content

benchmark/src/matmul/matmul.h

Classes

Name
struct gemm_result_t

Types

Name
typedef void()(uint32_t N, uint32_t M, uint32_t K, double A, uint32_t ldA, double B, uint32_t ldB, double C, uint32_t ldC) gemm_impl_t

Functions

Name
gemm_result_t gemm_bench(gemm_impl_t gemm_impl)
void gemm_seq_baseline(uint32_t N, uint32_t M, uint32_t K, double restrict A, uint32_t ldA, double restrict B, uint32_t ldB, double *restrict C, uint32_t ldC)
void gemm_seq_ssr(uint32_t N, uint32_t M, uint32_t K, double restrict A, uint32_t ldA, double restrict B, uint32_t ldB, double *restrict C, uint32_t ldC)
void gemm_seq_ssr_frep(uint32_t N, uint32_t M, uint32_t K, double restrict A, uint32_t ldA, double restrict B, uint32_t ldB, double *restrict C, uint32_t ldC)

Attributes

Name
uint32_t input_size
double output_checksum

Types Documentation

typedef gemm_impl_t

typedef void(* gemm_impl_t) (uint32_t N, uint32_t M, uint32_t K, double *A, uint32_t ldA, double *B, uint32_t ldB, double *C, uint32_t ldC);

Functions Documentation

function gemm_bench

gemm_result_t gemm_bench(
    gemm_impl_t gemm_impl
)

function gemm_seq_baseline

void gemm_seq_baseline(
    uint32_t N,
    uint32_t M,
    uint32_t K,
    double *restrict A,
    uint32_t ldA,
    double *restrict B,
    uint32_t ldB,
    double *restrict C,
    uint32_t ldC
)

function gemm_seq_ssr

void gemm_seq_ssr(
    uint32_t N,
    uint32_t M,
    uint32_t K,
    double *restrict A,
    uint32_t ldA,
    double *restrict B,
    uint32_t ldB,
    double *restrict C,
    uint32_t ldC
)

function gemm_seq_ssr_frep

void gemm_seq_ssr_frep(
    uint32_t N,
    uint32_t M,
    uint32_t K,
    double *restrict A,
    uint32_t ldA,
    double *restrict B,
    uint32_t ldB,
    double *restrict C,
    uint32_t ldC
)

Attributes Documentation

variable input_size

uint32_t input_size;

variable output_checksum

double output_checksum;

Source code

// Copyright 2020 ETH Zurich and University of Bologna.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include "benchmark.h"

extern uint32_t input_size;
extern double output_checksum[];

typedef struct {
    size_t errors;
    size_t cycles_core;
    size_t cycles_total;
} gemm_result_t;

typedef void (*gemm_impl_t)(uint32_t N, uint32_t M, uint32_t K, double *A,
                            uint32_t ldA, double *B, uint32_t ldB, double *C,
                            uint32_t ldC);

gemm_result_t gemm_bench(gemm_impl_t gemm_impl);

void gemm_seq_baseline(uint32_t N, uint32_t M, uint32_t K, double *restrict A,
                       uint32_t ldA, double *restrict B, uint32_t ldB,
                       double *restrict C, uint32_t ldC);

void gemm_seq_ssr(uint32_t N, uint32_t M, uint32_t K, double *restrict A,
                  uint32_t ldA, double *restrict B, uint32_t ldB,
                  double *restrict C, uint32_t ldC);

void gemm_seq_ssr_frep(uint32_t N, uint32_t M, uint32_t K, double *restrict A,
                       uint32_t ldA, double *restrict B, uint32_t ldB,
                       double *restrict C, uint32_t ldC);

Updated on 2023-06-19 at 09:43:56 +0000