diff --git a/onnxruntime/contrib_ops/cuda/activation/activations.cc b/onnxruntime/contrib_ops/cuda/activation/activations.cc index 4ca5d29a5f..45bda90b1e 100644 --- a/onnxruntime/contrib_ops/cuda/activation/activations.cc +++ b/onnxruntime/contrib_ops/cuda/activation/activations.cc @@ -26,7 +26,7 @@ namespace cuda { template <> \ Status x::ComputeInternal(OpKernelContext* context) const { \ UnaryElementwisePreparation p; \ - UnaryElementwise::Prepare(context, &p); \ + ORT_RETURN_IF_ERROR(UnaryElementwise::Prepare(context, &p)); \ Ctx##x func_ctx = MakeFuncCtx(); \ Impl_##x::MappedType>( \ reinterpret_cast::MappedType*>(p.input_tensor->template Data()), \ diff --git a/onnxruntime/contrib_ops/cuda/math/complex_mul.cc b/onnxruntime/contrib_ops/cuda/math/complex_mul.cc index 1365009619..70d286ae0d 100644 --- a/onnxruntime/contrib_ops/cuda/math/complex_mul.cc +++ b/onnxruntime/contrib_ops/cuda/math/complex_mul.cc @@ -40,7 +40,7 @@ Status ComplexMul::ComputeInternal(OpKernelContext* context) const { } BinaryElementwisePreparation prepare; - Prepare(context, &prepare); + ORT_RETURN_IF_ERROR(Prepare(context, &prepare)); ComplexMul_Impl::MappedType>( prepare.output_rank_or_simple_broadcast, &prepare.lhs_padded_strides, diff --git a/onnxruntime/core/providers/cuda/activation/activations.cc b/onnxruntime/core/providers/cuda/activation/activations.cc index 52ede66cc0..a054c84a89 100644 --- a/onnxruntime/core/providers/cuda/activation/activations.cc +++ b/onnxruntime/core/providers/cuda/activation/activations.cc @@ -22,7 +22,7 @@ namespace cuda { template <> \ Status x::ComputeInternal(OpKernelContext* context) const { \ UnaryElementwisePreparation p; \ - UnaryElementwise::Prepare(context, &p); \ + ORT_RETURN_IF_ERROR(UnaryElementwise::Prepare(context, &p)); \ Ctx##x func_ctx = MakeFuncCtx(); \ Impl_##x::MappedType>( \ reinterpret_cast::MappedType*>(p.input_tensor->template Data()), \ diff --git a/onnxruntime/core/providers/cuda/math/binary_elementwise_ops.cc b/onnxruntime/core/providers/cuda/math/binary_elementwise_ops.cc index 6d020a8175..d92486e071 100644 --- a/onnxruntime/core/providers/cuda/math/binary_elementwise_ops.cc +++ b/onnxruntime/core/providers/cuda/math/binary_elementwise_ops.cc @@ -143,7 +143,7 @@ Status BinaryElementwise::Prepare(OpKernelContext* context, Bin template <> \ Status x::ComputeInternal(OpKernelContext* context) const { \ BinaryElementwisePreparation prepare; \ - Prepare(context, &prepare); \ + ORT_RETURN_IF_ERROR(Prepare(context, &prepare)); \ Impl_##x::MappedType>( \ prepare.output_rank_or_simple_broadcast, \ &prepare.lhs_padded_strides, \ @@ -337,7 +337,7 @@ Status DispatchOnFirstArg(const BinaryElementwisePreparation& prepare) { Status Pow::ComputeInternal(OpKernelContext* context) const { BinaryElementwisePreparation prepare; - Prepare(context, &prepare); + ORT_RETURN_IF_ERROR(Prepare(context, &prepare)); namespace on = ONNX_NAMESPACE; using namespace pow12_internal; diff --git a/onnxruntime/core/providers/cuda/math/unary_elementwise_ops.cc b/onnxruntime/core/providers/cuda/math/unary_elementwise_ops.cc index 3fec649929..31cbd8b89d 100644 --- a/onnxruntime/core/providers/cuda/math/unary_elementwise_ops.cc +++ b/onnxruntime/core/providers/cuda/math/unary_elementwise_ops.cc @@ -37,7 +37,7 @@ Status UnaryElementwise::Prepare(OpKernelContext* context, UnaryElementwisePrepa template <> \ Status x::ComputeInternal(OpKernelContext* context) const { \ UnaryElementwisePreparation p; \ - UnaryElementwise::Prepare(context, &p); \ + ORT_RETURN_IF_ERROR(UnaryElementwise::Prepare(context, &p)); \ Impl_##x( \ reinterpret_cast::MappedType*>(p.input_tensor->template Data()), \ reinterpret_cast::MappedType*>(p.output_tensor->template MutableData()), \ diff --git a/onnxruntime/core/providers/cuda/reduction/reduction_ops.cc b/onnxruntime/core/providers/cuda/reduction/reduction_ops.cc index f0c3495aba..aec5c5179c 100644 --- a/onnxruntime/core/providers/cuda/reduction/reduction_ops.cc +++ b/onnxruntime/core/providers/cuda/reduction/reduction_ops.cc @@ -157,7 +157,7 @@ Status ReduceKernel::ReduceKernelShared( auto exp_result = GetScratchBuffer(input_count).get(); auto log_sum_result = GetScratchBuffer(output_count).get(); BinaryElementwisePreparation prepare; - prepare.BinaryElementwiseBroadcastPrepareHelper(input_shape, rhs_shape, input_shape); + ORT_RETURN_IF_ERROR(prepare.BinaryElementwiseBroadcastPrepareHelper(input_shape, rhs_shape, input_shape)); Impl_Sub(prepare.output_rank_or_simple_broadcast, &prepare.lhs_padded_strides, reinterpret_cast(X), @@ -481,7 +481,7 @@ Status ReduceComputeCore(CUDAExecutionProvider& cuda_ep, const Tensor& input, Pr auto log_sum_result_buffer = cuda_ep.GetScratchBuffer(output_count); auto log_sum_result = log_sum_result_buffer.get(); BinaryElementwisePreparation prepare; - prepare.BinaryElementwiseBroadcastPrepareHelper(input_shape, output_shape, input_shape); + ORT_RETURN_IF_ERROR(prepare.BinaryElementwiseBroadcastPrepareHelper(input_shape, output_shape, input_shape)); Impl_Sub(prepare.output_rank_or_simple_broadcast, &prepare.lhs_padded_strides, reinterpret_cast(input.template Data()), diff --git a/orttraining/orttraining/training_ops/cuda/activation/activations_grad.cc b/orttraining/orttraining/training_ops/cuda/activation/activations_grad.cc index 01f5d0830d..e45b300f68 100644 --- a/orttraining/orttraining/training_ops/cuda/activation/activations_grad.cc +++ b/orttraining/orttraining/training_ops/cuda/activation/activations_grad.cc @@ -23,7 +23,7 @@ namespace cuda { template <> \ Status x::ComputeInternal(OpKernelContext* context) const { \ BinaryElementwisePreparation prepare; \ - Prepare(context, &prepare); \ + ORT_RETURN_IF_ERROR(Prepare(context, &prepare)); \ CudaAsyncBuffer func_ctx(this, MakeFuncCtx(), 1); \ if (!std::is_same::value) ORT_RETURN_IF_ERROR(func_ctx.CopyToGpu()); \ Impl_##x::MappedType>( \