Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions android/app/src/main/java/com/pocketpalai/MainApplication.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.pocketpal

import android.app.Application
import android.system.Os
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
Expand Down Expand Up @@ -43,6 +44,12 @@ class MainApplication : Application(), ReactApplication {

override fun onCreate() {
super.onCreate()
// Enable Adreno large buffer support on Qualcomm A7X/A8X GPUs.
// The OpenCL backend in llama.rn self-gates on GPU family and the
// cl_qcom_large_buffer extension — this is a no-op on non-Adreno devices.
// Must be set before SoLoader.init so the native library picks it up.
// See: https://github.com/ggml-org/llama.cpp/pull/20997
Os.setenv("LM_GGML_OPENCL_ADRENO_USE_LARGE_BUFFER", "1", true)
SoLoader.init(this, OpenSourceMergedSoMapping)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
Expand Down
Loading