From 46385ee0d52f38fc7db2a0ec3a071ae8d1bd6511 Mon Sep 17 00:00:00 2001 From: Aaron Miller Date: Tue, 10 Oct 2023 21:38:18 -0700 Subject: [PATCH] misc vulkan cleanup make pushconts consistent w/ dispatch, avoid a double free --- ggml-vulkan.cpp | 4 +++- kompute/op_add.comp | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ggml-vulkan.cpp b/ggml-vulkan.cpp index 6ae1a8fc3..a0a2a9b0e 100644 --- a/ggml-vulkan.cpp +++ b/ggml-vulkan.cpp @@ -307,7 +307,9 @@ bool ggml_vk_has_h2d_all(struct ggml_kompute_context * ctx) { void ggml_vk_free(struct ggml_kompute_context * ctx) { assert(ctx == s_kompute_context); s_kompute_context = nullptr; - delete ctx; + if (ctx != nullptr) { + delete ctx; + } } static diff --git a/kompute/op_add.comp b/kompute/op_add.comp index 019a68449..f242864dd 100644 --- a/kompute/op_add.comp +++ b/kompute/op_add.comp @@ -20,7 +20,6 @@ layout(push_constant) uniform PushConstants { uint inAOff; uint inBOff; uint outOff; - uint row; } pcs; void main() {