Skip to content

Commit 55e8c9d

Browse files
committed
Vulkan PR fixes and missing Makefile update
1 parent 8b4891c commit 55e8c9d

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@ ifndef UNAME_M
2929
UNAME_M := $(shell uname -m)
3030
endif
3131

32+
# In GNU make default CXX is g++ instead of c++. Let's fix that so that users
33+
# of non-gcc compilers don't have to provide g++ alias or wrapper.
34+
DEFCC := cc
35+
DEFCXX := c++
36+
ifeq ($(origin CC),default)
37+
CC := $(DEFCC)
38+
endif
39+
ifeq ($(origin CXX),default)
40+
CXX := $(DEFCXX)
41+
endif
42+
3243
# detect Windows
3344
ifneq ($(findstring _NT,$(UNAME_S)),)
3445
_WIN32 := 1
@@ -635,6 +646,15 @@ GET_OBJ_FILE = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(patsubst %.cu,%.o,$(1))
635646

636647
#NAMED BULDS
637648

649+
chat: $(EXE)_mini
650+
@echo Build $(EXE)_mini complete for $(ECHO_MESSAGE)
651+
652+
chat_cl: $(EXE_CL)_mini
653+
@echo Build $(EXE_CL)_mini complete for $(ECHO_MESSAGE)
654+
655+
chat_vk: $(EXE_VK)_mini
656+
@echo Build $(EXE_VK)_mini complete for $(ECHO_MESSAGE)
657+
638658
demo: $(EXE)
639659
@echo Build $(EXE) complete for $(ECHO_MESSAGE)
640660

base/ggml-vulkan.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5418,7 +5418,7 @@ static void ggml_vk_preallocate_buffers(ggml_backend_vk_context * ctx) {
54185418
}
54195419

54205420
static void ggml_vk_build_graph(ggml_backend_vk_context * ctx, ggml_tensor * node, bool last_node){
5421-
if (ctx->disable || node->backend != GGML_BACKEND_TYPE_GPU) {
5421+
if (ctx->disable || node->backend != GGML_BACKEND_TYPE_GPU || ggml_is_empty(node)) {
54225422
return;
54235423
}
54245424

@@ -6218,7 +6218,7 @@ GGML_CALL static ggml_status ggml_backend_vk_graph_compute(ggml_backend_t backen
62186218
int last_node = cgraph->n_nodes - 1;
62196219

62206220
// If the last op in the cgraph isn't backend GPU, the command buffer doesn't get closed properly
6221-
while (last_node > 0 && cgraph->nodes[last_node]->backend != GGML_BACKEND_TYPE_GPU) {
6221+
while (last_node > 0 && (cgraph->nodes[last_node]->backend != GGML_BACKEND_TYPE_GPU || ggml_is_empty(cgraph->nodes[last_node]))) {
62226222
last_node -= 1;
62236223
}
62246224

0 commit comments

Comments
 (0)