Interface BLASPlugin
BLAS plugin interface, allows to supply platform specific implementation of matrix multiplication
Namespace: Unity.Barracuda
Assembly: solution.dll
Syntax
public interface BLASPlugin
Methods
IsCurrentPlatformSupported()
Query if current platform is supported by the BLAS plugin
Declaration
bool IsCurrentPlatformSupported()
Returns
Type | Description |
---|---|
bool |
|
IsNative()
Query if BLAS implementation is coming from platform's native library
Declaration
bool IsNative()
Returns
Type | Description |
---|---|
bool |
|
SGEMM(float*, int, int, float*, int, int, float*, int, int, int, bool, bool)
Perform matrix multiplication C = A x B + C
Declaration
void SGEMM(float* Ap, int AM, int AN, float* Bp, int BM, int BN, float* Cp, int CM, int CN, int bs, bool transposeA = false, bool transposeB = false)
Parameters
Type | Name | Description |
---|---|---|
float* | Ap | pointer to the matrix A |
int | AM | matrix A row count |
int | AN | matrix A column count |
float* | Bp | pointer to the matrix B |
int | BM | matrix B row count |
int | BN | matrix B column count |
float* | Cp | pointer to the matrix C |
int | CM | matrix C row count |
int | CN | matrix C column count |
int | bs | inner loop block size (if applicable) bs x bs |
bool | transposeA | matrix A data is in transposed layout |
bool | transposeB | matrix B data is in transposed layout |
ScheduleSGEMM(JobHandle, float*, int, int, float*, int, int, float*, int, int, int, bool, bool)
Launches matrix multiplication C = A x B + C in async-manner
Declaration
JobHandle ScheduleSGEMM(JobHandle dependsOn, float* Ap, int AM, int AN, float* Bp, int BM, int BN, float* Cp, int CM, int CN, int bs, bool transposeA = false, bool transposeB = false)
Parameters
Type | Name | Description |
---|---|---|
JobHandle | dependsOn | input data dependency job handle |
float* | Ap | pointer to the matrix A |
int | AM | matrix A row count |
int | AN | matrix A column count |
float* | Bp | pointer to the matrix B |
int | BM | matrix B row count |
int | BN | matrix B column count |
float* | Cp | pointer to the matrix C |
int | CM | matrix C row count |
int | CN | matrix C column count |
int | bs | inner loop block size (if applicable) bs x bs |
bool | transposeA | matrix A data is in transposed layout |
bool | transposeB | matrix B data is in transposed layout |
Returns
Type | Description |
---|---|
JobHandle | job handle |