metal : bugfix kernel
ggml-ci
This commit is contained in:
parent
b9a63636c0
commit
9d8f12ce4f
2 changed files with 9 additions and 9 deletions
|
@ -3379,12 +3379,12 @@ kernel void kernel_concat(
|
||||||
|
|
||||||
int64_t o[4] = {0, 0, 0, 0};
|
int64_t o[4] = {0, 0, 0, 0};
|
||||||
|
|
||||||
if (i1 < ne01 && i2 < ne02 && i3 < ne03) {
|
if (dim > 0 && i1 < ne01 && i2 < ne02 && i3 < ne03) {
|
||||||
src = src0;
|
src = src0;
|
||||||
o[dim] = 0;
|
o[dim] = 0;
|
||||||
} else {
|
} else {
|
||||||
src = src1;
|
src = src1;
|
||||||
o[dim] = ne00;
|
o[dim] = dim == 1 ? ne01 : (dim == 2 ? ne02 : ne03);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i0 = tpitg.x; i0 < ne0; i0 += ntg.x) {
|
for (int i0 = tpitg.x; i0 < ne0; i0 += ntg.x) {
|
||||||
|
|
|
@ -1260,18 +1260,18 @@ struct test_im2col : public test_case {
|
||||||
struct test_concat : public test_case {
|
struct test_concat : public test_case {
|
||||||
const ggml_type type;
|
const ggml_type type;
|
||||||
const std::array<int64_t, 4> ne_a;
|
const std::array<int64_t, 4> ne_a;
|
||||||
const int dim;
|
|
||||||
const int64_t ne_b_d;
|
const int64_t ne_b_d;
|
||||||
|
const int dim;
|
||||||
|
|
||||||
std::string vars() override {
|
std::string vars() override {
|
||||||
return VARS_TO_STR4(type, ne_a, dim, ne_b_d);
|
return VARS_TO_STR4(type, ne_a, ne_b_d, dim);
|
||||||
}
|
}
|
||||||
|
|
||||||
test_concat(ggml_type type = GGML_TYPE_F32,
|
test_concat(ggml_type type = GGML_TYPE_F32,
|
||||||
std::array<int64_t, 4> ne_a = {10, 10, 10, 10},
|
std::array<int64_t, 4> ne_a = {10, 10, 10, 10},
|
||||||
int dim = 2,
|
int64_t ne_b_d = 10,
|
||||||
int64_t ne_b_d = 10)
|
int dim = 2)
|
||||||
: type(type), ne_a(ne_a), dim(dim), ne_b_d(ne_b_d) {}
|
: type(type), ne_a(ne_a), ne_b_d(ne_b_d), dim(dim) {}
|
||||||
|
|
||||||
ggml_tensor * build_graph(ggml_context * ctx) override {
|
ggml_tensor * build_graph(ggml_context * ctx) override {
|
||||||
auto ne_b = ne_a;
|
auto ne_b = ne_a;
|
||||||
|
@ -2216,8 +2216,8 @@ static bool test_backend(ggml_backend_t backend, test_mode mode, const char * op
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int dim : { 0, 1, 2, 3, }) {
|
for (int dim : { 0, 1, 2, 3, }) {
|
||||||
test_cases.emplace_back(new test_concat(GGML_TYPE_F32, {10, 10, 10, 10}, dim));
|
test_cases.emplace_back(new test_concat(GGML_TYPE_F32, {11, 12, 13, 14}, 7, dim));
|
||||||
test_cases.emplace_back(new test_concat(GGML_TYPE_I32, {10, 10, 10, 10}, dim));
|
test_cases.emplace_back(new test_concat(GGML_TYPE_I32, {11, 12, 13, 14}, 7, dim));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ggml_sort_order order : {GGML_SORT_ORDER_ASC, GGML_SORT_ORDER_DESC}) {
|
for (ggml_sort_order order : {GGML_SORT_ORDER_ASC, GGML_SORT_ORDER_DESC}) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue