@@ -593,9 +593,6 @@ void aclnn_cos(ggml_backend_cann_context& ctx, aclTensor* acl_src,
593593void aclnn_sin (ggml_backend_cann_context& ctx, aclTensor* acl_src,
594594 aclTensor* acl_dst);
595595
596- void aclnn_geluv2 (ggml_backend_cann_context& ctx, aclTensor* acl_src,
597- aclTensor* acl_dst);
598-
599596/* *
600597 * @brief Prepares broadcast-compatible ACL tensors for two input tensors and one
601598 * output tensor.
@@ -843,13 +840,14 @@ void ggml_cann_unary_op(
843840 * @see ggml_cann_unary_op
844841 * @see GGML_CANN_CALL_ACLNN_OP
845842 */
846- #define GGML_CANN_CALL_UNARY_OP (OP_NAME ) \
847- do { \
848- ggml_tensor * src = dst->src [0 ]; \
849- aclTensor * acl_src = ggml_cann_create_tensor (src); \
850- aclTensor * acl_dst = ggml_cann_create_tensor (dst); \
851- GGML_CANN_CALL_ACLNN_OP (OP_NAME, acl_src, acl_dst); \
852- ACL_CHECK (aclDestroyTensor (acl_src)); \
853- ACL_CHECK (aclDestroyTensor (acl_dst)); \
854- } while (0 )
843+ #define GGML_CANN_CALL_UNARY_OP (OP_NAME ) \
844+ do { \
845+ auto lambda = [](ggml_backend_cann_context& ctx, \
846+ aclTensor* acl_src, \
847+ aclTensor* acl_dst) { \
848+ GGML_CANN_CALL_ACLNN_OP (OP_NAME, acl_src, acl_dst); \
849+ }; \
850+ ggml_cann_unary_op (lambda, ctx, dst); \
851+ } \
852+ while (0 )
855853#endif // CANN_ACLNN_OPS
0 commit comments