Home

Awesome

GPUMatrixMultiplicationTest

GPU matrix multiplication in Unity.

Usage

float[,] A = new float[1024, 512];
float[,] B = new float[512, 256];

// matmul : ComputeShader (MatMul.compute)
float[,] C = GPUMatrixMultiplication.Multiply(matmul, A, B);

// float[,] C = GPUMatrixMultiplication.Multiply(matmul, A, B, GPUMatrixMultiplicationMethod.SharedMemory); // default
// float[,] C = GPUMatrixMultiplication.Multiply(matmul, A, B, GPUMatrixMultiplicationMethod.Naive); // naive impl

Resourses

Compatibility

tested on Unity 2017.0.3, Windows 10 (GTX 1060).