feat: transition from compile-time to runtime backend discovery (#1448)

Co-authored-by: Stéphane du Hamel <stephduh@live.fr>
Co-authored-by: Cyberhan123 <255542417@qq.com>
Co-authored-by: leejet <leejet714@gmail.com>
This commit is contained in:
Wagner Bruna
2026-04-29 12:26:57 -03:00
committed by GitHub
parent 331cfa5387
commit b8079e253d
12 changed files with 577 additions and 240 deletions

View File

@@ -6,6 +6,7 @@
#include <string>
#include <vector>
#include "ggml-backend.h"
#include "stable-diffusion.h"
#include "tensor.hpp"
@@ -82,6 +83,10 @@ int sd_get_preview_interval();
bool sd_should_preview_denoised();
bool sd_should_preview_noisy();
// test if the backend is a specific one, e.g. "CUDA", "ROCm", "Vulkan" etc.
bool sd_backend_is(ggml_backend_t backend, const std::string& name);
ggml_backend_t sd_get_default_backend();
#define LOG_DEBUG(format, ...) log_printf(SD_LOG_DEBUG, __FILE__, __LINE__, format, ##__VA_ARGS__)
#define LOG_INFO(format, ...) log_printf(SD_LOG_INFO, __FILE__, __LINE__, format, ##__VA_ARGS__)
#define LOG_WARN(format, ...) log_printf(SD_LOG_WARN, __FILE__, __LINE__, format, ##__VA_ARGS__)