Skip to content

Commit 86a3f0f

Browse files
authored
ggml : allow fill node alloc inplace (#17870)
1 parent 63908b6 commit 86a3f0f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

ggml/src/ggml-alloc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ static bool ggml_is_view(const struct ggml_tensor * t) {
2525
// ops that return true for this function must not use restrict pointers for their backend implementations
2626
bool ggml_op_can_inplace(enum ggml_op op) {
2727
switch (op) {
28+
case GGML_OP_FILL:
2829
case GGML_OP_SCALE:
2930
case GGML_OP_DIAG_MASK_ZERO:
3031
case GGML_OP_DIAG_MASK_INF:

ggml/src/ggml-cuda/fill.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#define CUDA_FILL_BLOCK_SIZE 256
55

66
template <typename T>
7-
static __global__ void fill_kernel(T * __restrict__ dst, const int64_t k, const T value) {
7+
static __global__ void fill_kernel(T * dst, const int64_t k, const T value) {
88
const int64_t i = (int64_t)blockDim.x * blockIdx.x + threadIdx.x;
99
if (i >= k) {
1010
return;

0 commit comments

Comments
 (0)