docs.unity3d.com
    Show / Hide Table of Contents

    Interface BLASPlugin

    BLAS plugin interface, allows to supply platform specific implementation of matrix multiplication

    Namespace: Unity.Barracuda
    Syntax
    public interface BLASPlugin

    Methods

    IsCurrentPlatformSupported()

    Query if current platform is supported by the BLAS plugin

    Declaration
    bool IsCurrentPlatformSupported()
    Returns
    Type Description
    Boolean

    true if plugin supports current platform

    IsNative()

    Query if BLAS implementation is coming from platform's native library

    Declaration
    bool IsNative()
    Returns
    Type Description
    Boolean

    true if BLAS implementation is coming from platform's native library

    ScheduleSGEMM(JobHandle, Single*, Int32, Int32, Single*, Int32, Int32, Single*, Int32, Int32, Int32, Boolean, Boolean)

    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

    Single* Ap

    pointer to the matrix A

    Int32 AM

    matrix A row count

    Int32 AN

    matrix A column count

    Single* Bp

    pointer to the matrix B

    Int32 BM

    matrix B row count

    Int32 BN

    matrix B column count

    Single* Cp

    pointer to the matrix C

    Int32 CM

    matrix C row count

    Int32 CN

    matrix C column count

    Int32 bs

    inner loop block size (if applicable) bs x bs

    Boolean transposeA

    matrix A data is in transposed layout

    Boolean transposeB

    matrix B data is in transposed layout

    Returns
    Type Description
    JobHandle

    job handle

    SGEMM(Single*, Int32, Int32, Single*, Int32, Int32, Single*, Int32, Int32, Int32, Boolean, Boolean)

    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
    Single* Ap

    pointer to the matrix A

    Int32 AM

    matrix A row count

    Int32 AN

    matrix A column count

    Single* Bp

    pointer to the matrix B

    Int32 BM

    matrix B row count

    Int32 BN

    matrix B column count

    Single* Cp

    pointer to the matrix C

    Int32 CM

    matrix C row count

    Int32 CN

    matrix C column count

    Int32 bs

    inner loop block size (if applicable) bs x bs

    Boolean transposeA

    matrix A data is in transposed layout

    Boolean transposeB

    matrix B data is in transposed layout

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023