mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2024-12-24 14:46:39 +00:00
whisper.android : return output from benchmarks (#1785)
Benchmarks are failing because JNI expects a jstring and the benchmarks are missing a return statement (i.e., returning null). The functions actually build a jstring but don't return it, so this seems to have been an oversight. This patch returns the jstring and now the benchmarks run successfully. Fixes #1783.
This commit is contained in:
parent
c0329acde8
commit
d6b9be21d7
@ -228,6 +228,7 @@ Java_com_whispercpp_whisper_WhisperLib_00024Companion_benchMemcpy(JNIEnv *env, j
|
|||||||
UNUSED(thiz);
|
UNUSED(thiz);
|
||||||
const char *bench_ggml_memcpy = whisper_bench_memcpy_str(n_threads);
|
const char *bench_ggml_memcpy = whisper_bench_memcpy_str(n_threads);
|
||||||
jstring string = (*env)->NewStringUTF(env, bench_ggml_memcpy);
|
jstring string = (*env)->NewStringUTF(env, bench_ggml_memcpy);
|
||||||
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jstring JNICALL
|
JNIEXPORT jstring JNICALL
|
||||||
@ -236,4 +237,5 @@ Java_com_whispercpp_whisper_WhisperLib_00024Companion_benchGgmlMulMat(JNIEnv *en
|
|||||||
UNUSED(thiz);
|
UNUSED(thiz);
|
||||||
const char *bench_ggml_mul_mat = whisper_bench_ggml_mul_mat_str(n_threads);
|
const char *bench_ggml_mul_mat = whisper_bench_ggml_mul_mat_str(n_threads);
|
||||||
jstring string = (*env)->NewStringUTF(env, bench_ggml_mul_mat);
|
jstring string = (*env)->NewStringUTF(env, bench_ggml_mul_mat);
|
||||||
|
return string;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user