im2col: add try catch block and move wrapper function from ggml-sycl.cpp
This commit is contained in:
parent
ba79258a2b
commit
4db56d6ed2
3 changed files with 11 additions and 6 deletions
|
@ -2805,10 +2805,6 @@ static void ggml_sycl_pool2d(ggml_backend_sycl_context & ctx, ggml_tensor * dst)
|
||||||
ggml_sycl_op_pool2d(ctx, dst);
|
ggml_sycl_op_pool2d(ctx, dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ggml_sycl_im2col(ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
|
|
||||||
ggml_sycl_op_im2col(ctx, dst);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ggml_sycl_sum(ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
|
static void ggml_sycl_sum(ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
|
||||||
GGML_ASSERT(ggml_is_contiguous(dst->src[0]));
|
GGML_ASSERT(ggml_is_contiguous(dst->src[0]));
|
||||||
ggml_sycl_op_sum(ctx, dst);
|
ggml_sycl_op_sum(ctx, dst);
|
||||||
|
|
|
@ -82,7 +82,7 @@ static void im2col_sycl(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ggml_sycl_op_im2col(ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
|
static void ggml_sycl_op_im2col(ggml_backend_sycl_context & ctx, ggml_tensor * dst) try {
|
||||||
|
|
||||||
GGML_ASSERT(dst->src[0]->type == GGML_TYPE_F16);
|
GGML_ASSERT(dst->src[0]->type == GGML_TYPE_F16);
|
||||||
GGML_ASSERT(dst->src[1]->type == GGML_TYPE_F32);
|
GGML_ASSERT(dst->src[1]->type == GGML_TYPE_F32);
|
||||||
|
@ -122,4 +122,13 @@ void ggml_sycl_op_im2col(ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
|
||||||
float * dst_dd = static_cast<float *>(dst->data);
|
float * dst_dd = static_cast<float *>(dst->data);
|
||||||
im2col_sycl(src1_dd, dst_dd, IW, IH, OW, OH, KW, KH, IC, batch, batch_offset, delta_offset, s0, s1, p0, p1, d0, d1, main_stream);
|
im2col_sycl(src1_dd, dst_dd, IW, IH, OW, OH, KW, KH, IC, batch, batch_offset, delta_offset, s0, s1, p0, p1, d0, d1, main_stream);
|
||||||
}
|
}
|
||||||
|
} catch (const sycl::exception & exc) {
|
||||||
|
std::cerr << exc.what() << "Exception caught at file:" << __FILE__ << ", line:" << __LINE__ << std::endl;
|
||||||
|
std::exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ggml_sycl_im2col(ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
|
||||||
|
GGML_SYCL_DEBUG("call %s\n", __func__);
|
||||||
|
ggml_sycl_op_im2col(ctx, dst);
|
||||||
|
GGML_SYCL_DEBUG("call %s done\n", __func__);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,6 @@
|
||||||
|
|
||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
|
|
||||||
void ggml_sycl_op_im2col(ggml_backend_sycl_context & ctx, ggml_tensor * dst);
|
void ggml_sycl_im2col(ggml_backend_sycl_context & ctx, ggml_tensor * dst);
|
||||||
|
|
||||||
#endif // GGML_SYCL_IM2COL_HPP
|
#endif // GGML_SYCL_IM2COL_HPP
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue