matrixmultiplication

package
v3.0.0-alpha.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package matrixmultiplication implements the matrix multiplication benchmark from AMDAPPSDK.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Benchmark

type Benchmark struct {
	X, Y, Z                   uint32
	MatrixA, MatrixB, MatrixC *Matrix
	// contains filtered or unexported fields
}

Benchmark defines a benchmark

func NewBenchmark

func NewBenchmark(driver *driver.Driver) *Benchmark

NewBenchmark makes a new benchmark

func (*Benchmark) Run

func (b *Benchmark) Run()

Run runs

func (*Benchmark) SelectGPU

func (b *Benchmark) SelectGPU(gpus []int)

SelectGPU selects GPU

func (*Benchmark) SetUnifiedMemory

func (b *Benchmark) SetUnifiedMemory()

SetUnifiedMemory uses Unified Memory

func (*Benchmark) Verify

func (b *Benchmark) Verify()

Verify verifies

type CPUMatrixMultiplier

type CPUMatrixMultiplier struct{}

CPUMatrixMultiplier is a matrix multiplier

func (*CPUMatrixMultiplier) Multiply

func (m *CPUMatrixMultiplier) Multiply(mA, mB *Matrix) *Matrix

Multiply multiplies two matrice

type GPUMatrixMultiplier

type GPUMatrixMultiplier struct {
	// contains filtered or unexported fields
}

A GPUMatrixMultiplier is a MatrixMultiplier that runs the MatrixMultiplication on GCN3 simulator.

func NewGPUMatrixMultiplier

func NewGPUMatrixMultiplier(
	gpuDriver *driver.Driver,
	context *driver.Context,
) *GPUMatrixMultiplier

NewGPUMatrixMultiplier creates a new GPUMatrixMultiplier, injecting the dependency of driver and the GPU context.

func (*GPUMatrixMultiplier) Multiply

func (m *GPUMatrixMultiplier) Multiply(mA, mB *Matrix) *Matrix

Multiply multiplies two matrice

func (*GPUMatrixMultiplier) SelectGPU

func (m *GPUMatrixMultiplier) SelectGPU(gpus []int)

SelectGPU selects GPU

type KernelArgs

type KernelArgs struct {
	MatrixA             driver.Ptr
	MatrixB             driver.Ptr
	MatrixC             driver.Ptr
	WidthA              uint32
	BlockA              driver.LocalPtr
	HiddenGlobalOffsetX int64
	HiddenGlobalOffsetY int64
	HiddenGlobalOffsetZ int64
}

KernelArgs defines kernel arguments

type Matrix

type Matrix struct {
	Data          []float32
	Width, Height uint32
}

Matrix defines a matrix

func NewMatrix

func NewMatrix(width, height uint32) *Matrix

NewMatrix returns a matrix

type MatrixMultiplier

type MatrixMultiplier interface {
	Multiply(mA, mB *Matrix) *Matrix
}

A MatrixMultiplier is a service type that can calculate the result of matrix -matrix multiplication.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL