File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -385,14 +385,14 @@ struct clip_ctx {
385385 throw std::runtime_error (" failed to initialize CPU backend" );
386386 }
387387 backend = nullptr ;
388- auto backend_name = std::getenv ( " MTMD_BACKEND_DEVICE " );
389- if (backend_name != nullptr && ctx_params. use_gpu ) {
390- backend = ggml_backend_init_by_name (backend_name, nullptr );
391- }
392- if (!backend){
393- backend = ctx_params. use_gpu
394- ? ggml_backend_init_by_type (GGML_BACKEND_DEVICE_TYPE_GPU, nullptr )
395- : nullptr ;
388+ if (ctx_params. use_gpu ) {
389+ auto backend_name = std::getenv ( " MTMD_BACKEND_DEVICE " );
390+ if (backend_name != nullptr ) {
391+ backend = ggml_backend_init_by_name (backend_name, nullptr );
392+ }
393+ if (! backend){
394+ backend = ggml_backend_init_by_type (GGML_BACKEND_DEVICE_TYPE_GPU, nullptr );
395+ }
396396 }
397397
398398 if (backend) {
You can’t perform that action at this time.
0 commit comments