Work with Mac M1

This commit is contained in:
krolhm 2024-02-04 16:21:33 +01:00
parent 5ed26e1fc9
commit e72defac41
2 changed files with 9 additions and 1 deletions

View file

@ -977,9 +977,15 @@ void ggml_vk_init() {
const std::vector<const char*> extensions = {
#ifdef GGML_VULKAN_VALIDATE
"VK_EXT_validation_features",
#endif
#ifdef __APPLE__
"VK_KHR_portability_enumeration",
#endif
};
vk::InstanceCreateInfo instance_create_info(vk::InstanceCreateFlags(), &app_info, layers, extensions);
vk::InstanceCreateInfo instance_create_info(vk::InstanceCreateFlags(), &app_info, layers, extensions);
#ifdef __APPLE__
instance_create_info.flags = vk::InstanceCreateFlagBits::eEnumeratePortabilityKHR;
#endif
#ifdef GGML_VULKAN_VALIDATE
const std::vector<vk::ValidationFeatureEnableEXT> features_enable = { vk::ValidationFeatureEnableEXT::eBestPractices };
vk::ValidationFeaturesEXT validation_features = {

2
ggml.c
View file

@ -270,6 +270,8 @@ inline static void * ggml_calloc(size_t num, size_t size) {
#include <Accelerate/Accelerate.h>
#if defined(GGML_USE_CLBLAST) // allow usage of CLBlast alongside Accelerate functions
#include "ggml-opencl.h"
#elif defined(GGML_USE_VULKAN) && __APPLE__
#include "ggml-vulkan.h"
#endif
#elif defined(GGML_USE_OPENBLAS)
#if defined(GGML_BLAS_USE_MKL)