* Makefile : allow to override CUDA_ARCH_FLAG
* whisper : allow to select GPU (CUDA) device from public API
#ifdef GGML_USE_CUBLAS
if (params.use_gpu && ggml_cublas_loaded()) {
WHISPER_LOG_INFO("%s: using CUDA backend\n", __func__);
- backend_gpu = ggml_backend_cuda_init(0);
+ backend_gpu = ggml_backend_cuda_init(params.gpu_device);
if (!backend_gpu) {
WHISPER_LOG_ERROR("%s: ggml_backend_cuda_init() failed\n", __func__);
}
struct whisper_context_params whisper_context_default_params() {
struct whisper_context_params result = {
/*.use_gpu =*/ true,
+ /*.gpu_device =*/ 0,
};
return result;
}
struct whisper_context_params {
bool use_gpu;
+ int gpu_device; // CUDA device
};
typedef struct whisper_token_data {