Skip to content

Commit da95bf2

Browse files
authored
vulkan: support noncontig i32 copy (#17328)
1 parent 0de8878 commit da95bf2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13644,10 +13644,11 @@ static bool ggml_backend_vk_device_supports_op(ggml_backend_dev_t dev, const ggm
1364413644
}
1364513645

1364613646
// We can handle copying from a type to the same type if it's
13647-
// contiguous (memcpy). We use f16 or f32 shaders to do the copy,
13647+
// either not quantized or is quantized and contiguous.
13648+
// We use f16 or f32 shaders to do the copy,
1364813649
// so the type/block size must be a multiple of 4.
1364913650
if (src0_type == src1_type &&
13650-
ggml_is_contiguous(op->src[0]) && ggml_is_contiguous(op) &&
13651+
(!ggml_is_quantized(src0_type) || (ggml_is_contiguous(op->src[0]) && ggml_is_contiguous(op))) &&
1365113652
(ggml_type_size(src0_type) % 2) == 0) {
1365213653
return true;
1365313654
}

0 commit comments

Comments
 (0)