ggml : change ggml_scale to take a float instead of tensor
This commit is contained in:
parent
8fe03ffdda
commit
199f6bdc46
10 changed files with 68 additions and 186 deletions
|
@ -1261,7 +1261,7 @@ void ggml_metal_graph_compute(
|
|||
{
|
||||
GGML_ASSERT(ggml_is_contiguous(src0));
|
||||
|
||||
const float scale = *(const float *) src1->data;
|
||||
const float scale = *(const float *) dst->op_params;
|
||||
|
||||
int64_t n = ggml_nelements(dst);
|
||||
|
||||
|
@ -1272,8 +1272,8 @@ void ggml_metal_graph_compute(
|
|||
[encoder setComputePipelineState:ctx->pipeline_scale];
|
||||
}
|
||||
|
||||
[encoder setBuffer:id_src0 offset:offs_src0 atIndex:0];
|
||||
[encoder setBuffer:id_dst offset:offs_dst atIndex:1];
|
||||
[encoder setBuffer:id_src0 offset:offs_src0 atIndex:0];
|
||||
[encoder setBuffer:id_dst offset:offs_dst atIndex:1];
|
||||
[encoder setBytes:&scale length:sizeof(scale) atIndex:2];
|
||||
|
||||
[encoder dispatchThreadgroups:MTLSizeMake(n, 1, 1) threadsPerThreadgroup:MTLSizeMake(1, 1, 1)];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue