@@ -756,19 +756,9 @@ template <void unary_op(ggml_backend_cann_context&, aclTensor*, aclTensor*)>
756756 * @param dst The destination tensor where the result will be stored. 
757757 *            The source tensor is retrieved from `dst->src[0]`. 
758758 */  
759- static   void  ggml_cann_unary_op_func (
759+ void  ggml_cann_unary_op (
760760    std::function<void (ggml_backend_cann_context&, aclTensor*, aclTensor*)> unary_op,
761-     ggml_backend_cann_context& ctx, ggml_tensor* dst) {
762-     ggml_tensor* src = dst->src [0 ];
763- 
764-     aclTensor* acl_src = ggml_cann_create_tensor (src);
765-     aclTensor* acl_dst = ggml_cann_create_tensor (dst);
766- 
767-     unary_op (ctx, acl_src, acl_dst);
768- 
769-     ACL_CHECK (aclDestroyTensor (acl_src));
770-     ACL_CHECK (aclDestroyTensor (acl_dst));
771- }
761+     ggml_backend_cann_context& ctx, ggml_tensor* dst);
772762
773763/* *
774764 * @brief Helper macro to invoke a unary ACL operation using ggml_cann_unary_op. 
@@ -794,7 +784,7 @@ static void ggml_cann_unary_op_func(
794784            aclTensor* acl_dst) {                                \
795785            GGML_CANN_CALL_ACLNN_OP (OP_NAME, acl_src, acl_dst);  \
796786        };                                                       \
797-         ggml_cann_unary_op_func (lambda, ctx, dst);               \
787+         ggml_cann_unary_op (lambda, ctx, dst);                     \
798788    }                                                            \
799789    while  (0 )
800790#endif   //  CANN_ACLNN_OPS
0 commit comments