Team Ai
Apppublic

KBaba7/llama.cpp

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
0likes
ggml-kompute.h51 linesDownload Raw Back to include
1#pragma once2 3#include "ggml.h"4#include "ggml-backend.h"5 6#include <stdbool.h>7#include <stddef.h>8#include <stdint.h>9 10#ifdef __cplusplus11extern "C" {12#endif13 14#define GGML_KOMPUTE_MAX_DEVICES 1615 16struct ggml_vk_device {17    int index;18    int type; // same as VkPhysicalDeviceType19    size_t heapSize;20    const char * name;21    const char * vendor;22    int subgroupSize;23    uint64_t bufferAlignment;24    uint64_t maxAlloc;25};26 27struct ggml_vk_device * ggml_vk_available_devices(size_t memoryRequired, size_t * count);28bool ggml_vk_get_device(struct ggml_vk_device * device, size_t memoryRequired, const char * name);29bool ggml_vk_has_vulkan(void);30bool ggml_vk_has_device(void);31struct ggml_vk_device ggml_vk_current_device(void);32 33//34// backend API35//36 37// forward declaration38typedef struct ggml_backend * ggml_backend_t;39 40GGML_BACKEND_API ggml_backend_t ggml_backend_kompute_init(int device);41 42GGML_BACKEND_API bool ggml_backend_is_kompute(ggml_backend_t backend);43 44GGML_BACKEND_API ggml_backend_buffer_type_t ggml_backend_kompute_buffer_type(int device);45 46GGML_BACKEND_API ggml_backend_reg_t ggml_backend_kompute_reg(void);47 48#ifdef __cplusplus49}50#endif51