Skip to content

Commit 4998a45

Browse files
committed
actually why not just pass the memory address of the instance...
1 parent 1553dda commit 4998a45

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ggml/src/ggml-cpu/ops.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6861,7 +6861,7 @@ static void ggml_call_mul_mat(ggml_type type, const ggml_compute_params * params
68616861
src1.nb[1] = k * traits->type_size;
68626862
src1.nb[2] = src1.nb[1];
68636863
src1.nb[3] = src1.nb[2];
6864-
tensor_set_data(src1, a);
6864+
tensor_set_data(&src1, a);
68656865

68666866
struct ggml_tensor src0 = {};
68676867
src0.type = type;
@@ -6873,7 +6873,7 @@ static void ggml_call_mul_mat(ggml_type type, const ggml_compute_params * params
68736873
src0.nb[1] = k * traits->type_size;
68746874
src0.nb[2] = src0.nb[1];
68756875
src0.nb[3] = src0.nb[2];
6876-
tensor_set_data(src0, b);
6876+
tensor_set_data(&src0, b);
68776877

68786878
struct ggml_tensor dst = {};
68796879
dst.ne[0] = n;
@@ -6884,7 +6884,7 @@ static void ggml_call_mul_mat(ggml_type type, const ggml_compute_params * params
68846884
dst.nb[1] = n * sizeof(float);
68856885
dst.nb[2] = dst.nb[1];
68866886
dst.nb[3] = dst.nb[2];
6887-
tensor_set_data(dst, c);
6887+
tensor_set_data(&dst, c);
68886888
dst.src[0] = &src0;
68896889
dst.src[1] = &src1;
68906890

ggml/src/ggml-cuda/ggml-cuda.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2164,7 +2164,7 @@ static void ggml_cuda_mul_mat_id(ggml_backend_cuda_context & ctx, ggml_tensor *
21642164
src0_slice.nb[3] = src0_slice.nb[2];
21652165
src0_slice.op = GGML_OP_VIEW;
21662166
src0_slice.view_src = dst->src[0]; // non-const pointer to src0
2167-
tensor_set_data(src0_slice, (char *) tensor_data(src0) + i02*nb02);
2167+
tensor_set_data(&src0_slice, (char *) tensor_data(src0) + i02*nb02);
21682168

21692169
ggml_tensor src1_slice;
21702170
memset(&src1_slice, 0, sizeof(src1_slice));
@@ -2178,7 +2178,7 @@ static void ggml_cuda_mul_mat_id(ggml_backend_cuda_context & ctx, ggml_tensor *
21782178
src1_slice.nb[1] = src1_slice.ne[0] * src1_slice.nb[0];
21792179
src1_slice.nb[2] = src1_slice.ne[1] * src1_slice.nb[1];
21802180
src1_slice.nb[3] = src1_slice.ne[2] * src1_slice.nb[2];
2181-
tensor_set_data(src1_slice, src1_data_cur);
2181+
tensor_set_data(&src1_slice, src1_data_cur);
21822182

21832183
ggml_tensor dst_slice;
21842184
memset(&dst_slice, 0, sizeof(dst_slice));
@@ -2192,7 +2192,7 @@ static void ggml_cuda_mul_mat_id(ggml_backend_cuda_context & ctx, ggml_tensor *
21922192
dst_slice.nb[1] = dst_slice.ne[0] * dst_slice.nb[0];
21932193
dst_slice.nb[2] = dst_slice.ne[1] * dst_slice.nb[1];
21942194
dst_slice.nb[3] = dst_slice.ne[2] * dst_slice.nb[2];
2195-
tensor_set_data(dst_slice, dst_data_cur);
2195+
tensor_set_data(&dst_slice, dst_data_cur);
21962196

21972197
ggml_cuda_mul_mat(ctx, &src0_slice, &src1_slice, &dst_slice);
21982198
CUDA_CHECK(cudaGetLastError());

0 commit comments

Comments
 (0)