Search code examples
androidlinear-algebrarenderscripthardware-acceleration

ScriptIntrinsicBLAS equivalent for API 17


ScriptIntrinsicBLAS is supported in API 23 or superior. Is there any way to perform basic linear algebra operations in API 17 without having to write custom RS kernels?

The RenderScript Runtime API Reference seems to provide operations like dot product and normalization, but it only supports vectors of 4 dimensions (e.g. double4), not limitless vectors represented as allocations (like ScriptIntrinsicBLAS does).

Any insights would be greatly appreciatted!


Solution

  • ScriptIntrinsicBLAS is available in RenderScript support lib.

    You need to have the following in build.gradle:

        defaultConfig {
            renderscriptSupportModeEnabled true
            renderscriptSupportModeBlasEnabled true
        }
    

    Recommended build environment:

    Android Studio 2.2.3 or higher
    Build-Tools 24.0.3 or higher
    com.android.tools.build:gradle:2.2.3 or higher