summaryrefslogtreecommitdiff
path: root/ggml/include
diff options
context:
space:
mode:
authorKawrakow <iwankawrakow@gmail.com>2025-07-15 08:03:13 +0200
committerGitHub <noreply@github.com>2025-07-15 08:03:13 +0200
commit2081b3fccb9923699bf4d5e926d8719fc1d12c39 (patch)
tree61b3665214941b4857466fdea8220159d81a609e /ggml/include
parent45fae1a14444622478774f9a417e1d417af1ca46 (diff)
Vulkan: a fresh start (#608)
* It compiles * Seems to be working with coopmat * Vulkan needs f32 precision for flash attention * Vulkan: fix u_batch > 4096/n_active_experts for coopmat1. Without this fix we get an assert. We get the same assert in mainline too. --------- Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
Diffstat (limited to 'ggml/include')
-rw-r--r--ggml/include/ggml-vulkan.h2
-rw-r--r--ggml/include/ggml.h9
2 files changed, 10 insertions, 1 deletions
diff --git a/ggml/include/ggml-vulkan.h b/ggml/include/ggml-vulkan.h
index e3e62864..7a482d6f 100644
--- a/ggml/include/ggml-vulkan.h
+++ b/ggml/include/ggml-vulkan.h
@@ -10,7 +10,7 @@ extern "C" {
#define GGML_VK_NAME "Vulkan"
#define GGML_VK_MAX_DEVICES 16
-GGML_API GGML_CALL void ggml_vk_instance_init(void);
+//GGML_API GGML_CALL void ggml_vk_instance_init(void);
// backend API
GGML_API GGML_CALL ggml_backend_t ggml_backend_vk_init(size_t dev_num);
diff --git a/ggml/include/ggml.h b/ggml/include/ggml.h
index ecce1959..a85f52b2 100644
--- a/ggml/include/ggml.h
+++ b/ggml/include/ggml.h
@@ -884,6 +884,15 @@ extern "C" {
GGML_API GGML_CALL bool ggml_is_contiguous_1(const struct ggml_tensor * tensor); // contiguous for dims >= 1
GGML_API GGML_CALL bool ggml_is_contiguous_2(const struct ggml_tensor * tensor); // contiguous for dims >= 2
+ // returns whether the tensor elements are allocated as one contiguous block of memory (no gaps, but permutation ok)
+ GGML_API bool ggml_is_contiguously_allocated(const struct ggml_tensor * tensor);
+
+ // true for tensor that is stored in memory as CxWxHxN and has been permuted to WxHxCxN
+ GGML_API bool ggml_is_contiguous_channels(const struct ggml_tensor * tensor);
+
+ // true if the elements in dimension 0 are contiguous, or there is just 1 block of elements
+ GGML_API bool ggml_is_contiguous_rows(const struct ggml_tensor * tensor);
+
GGML_API bool ggml_are_same_shape (const struct ggml_tensor * t0, const struct ggml_tensor * t1);
GGML_API bool ggml_are_same_stride(const struct ggml_tensor * t0, const struct ggml_tensor * t1);