]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
cuda : assert ggml_add sources to be contiguous
authorGeorgi Gerganov <redacted>
Sun, 19 Nov 2023 08:32:08 +0000 (10:32 +0200)
committerGeorgi Gerganov <redacted>
Sun, 19 Nov 2023 08:32:08 +0000 (10:32 +0200)
ggml-cuda.cu

index c0c9edd56dbc232b060afd62304d04bf4df45be3..b4203301db7a83fc0b01edb22fe9a48023c91d57 100644 (file)
@@ -6142,6 +6142,9 @@ inline void ggml_cuda_op_add(
     const ggml_tensor * src0, const ggml_tensor * src1, ggml_tensor * dst,
     const float * src0_dd, const float * src1_dd, float * dst_dd, const cudaStream_t & main_stream) {
 
+    GGML_ASSERT(ggml_is_contiguous(src0));
+    GGML_ASSERT(ggml_is_contiguous(src1));
+
     GGML_ASSERT(src1->type == GGML_TYPE_F32);
 
     const int64_t ne10 = src1->ne[0];