Skip to content

Commit 9e49350

Browse files
committed
merge occam's ggml-org#14249
1 parent 5f0a7a8 commit 9e49350

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ggml/src/ggml-vulkan/ggml-vulkan.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9519,6 +9519,12 @@ static size_t ggml_backend_vk_host_buffer_type_get_alignment(ggml_backend_buffer
95199519
UNUSED(buft);
95209520
}
95219521

9522+
static size_t ggml_backend_vk_host_buffer_type_get_max_size(ggml_backend_buffer_type_t buft) {
9523+
return vk_instance.devices[0]->suballocation_block_size;
9524+
9525+
UNUSED(buft);
9526+
}
9527+
95229528
// Should be changed to return device-specific host buffer type
95239529
// but that probably requires changes in llama.cpp
95249530
ggml_backend_buffer_type_t ggml_backend_vk_host_buffer_type() {
@@ -9527,7 +9533,7 @@ ggml_backend_buffer_type_t ggml_backend_vk_host_buffer_type() {
95279533
/* .get_name = */ ggml_backend_vk_host_buffer_type_name,
95289534
/* .alloc_buffer = */ ggml_backend_vk_host_buffer_type_alloc_buffer,
95299535
/* .get_alignment = */ ggml_backend_vk_host_buffer_type_get_alignment,
9530-
/* .get_max_size = */ NULL, // defaults to SIZE_MAX
9536+
/* .get_max_size = */ ggml_backend_vk_host_buffer_type_get_max_size,
95319537
/* .get_alloc_size = */ ggml_backend_cpu_buffer_type()->iface.get_alloc_size,
95329538
/* .is_host = */ ggml_backend_cpu_buffer_type()->iface.is_host,
95339539
},

0 commit comments

Comments
 (0)