Throw when ScriptC is used on unsupported ABIs
ScriptC won't be supported on any new architecture (for example riscv64), so throw an exception when it is used on an unsupported architecture. Note that using `Build.SUPPORTED_ABIS` includes ABIs supported due to dynamic binary translation, which do not support ScriptC. So we can't use `Build.SUPPORTED_ABIS` to determine if ScriptC is supported or not. Instead we attempt loading `libRS.so`. `libRS.so` is not present on riscv64 images, so this allows us to know if we are on a riscv64 system. A problem occurs on x86 images with binary translation for riscv64 (aka berberis): when running a riscv64 binary, the binary translation system will fallback to the x86 version of the libraries via what is called a "native bridge". This means that `libRS.so` would successfully load on those system, which we do not want because even though it would load it wouldn't run properly. This is why a separate CL in the binary translation codebase was landed that explicitly refuses to load `libRS.so`: https://android-review.git.corp.google.com/c/platform/frameworks/libs/binary_translation/+/2971952 Bug: 206676167 Test: atest CtsRsBlasTestCases:android.cts.rsblas.IntrinsicBLAS#test_L3_SGEMM_API -- --abi x86_64 Change-Id: I2ed2e2ae531046d1d00e9a2d2f864375b0bb3570
Loading
Please register or sign in to comment