Skip to content

[CANN] Fix CANN build error #25627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2025
Merged

[CANN] Fix CANN build error #25627

merged 1 commit into from
Aug 4, 2025

Conversation

bachelor-dou
Copy link
Contributor

Description

This error points to the most recent PR (#25465)

Error info

/home/dou/code/onnxruntime/onnxruntime/core/providers/cann/cann_kernel.h:48:40: error: no matching function for call to ‘onnxruntime::IAllocator::MakeUniquePtr<void>(onnxruntime::AllocatorPtr, size_t&, bool, onnxruntime::Stream*&, void (&)(onnxruntime::Stream*, onnxruntime::synchronize::Notification&))’
   48 |     return IAllocator::MakeUniquePtr<T>(Info().GetAllocator(OrtMemTypeDefault), count_or_bytes, false, stream, WaitCannNotificationOnDevice);
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/dou/code/onnxruntime/onnxruntime/core/providers/shared_library/provider_api.h:29,
                 from /home/dou/code/onnxruntime/onnxruntime/core/providers/cann/math/binary_elementwise_ops.cc:5:
/home/dou/code/onnxruntime/include/onnxruntime/core/framework/allocator.h:233:33: note: candidate: ‘static onnxruntime::IAllocatorUniquePtr<T> onnxruntime::IAllocator::MakeUniquePtr(std::shared_ptr<onnxruntime::IAllocator>, size_t, bool, onnxruntime::Stream*) [with T = void; onnxruntime::IAllocatorUniquePtr<T> = std::unique_ptr<void, std::function<void(void*)> >; size_t = long unsigned int]’
  233 |   static IAllocatorUniquePtr<T> MakeUniquePtr(std::shared_ptr<IAllocator> allocator, size_t count_or_bytes,
      |                                 ^~~~~~~~~~~~~
/home/dou/code/onnxruntime/include/onnxruntime/core/framework/allocator.h:233:33: note:   candidate expects 4 arguments, 5 provided
In file included from /home/dou/code/onnxruntime/onnxruntime/core/providers/cann/nn/dropout.h:8,
                 from /home/dou/code/onnxruntime/onnxruntime/core/providers/cann/nn/dropout.cc:5:
/home/dou/code/onnxruntime/onnxruntime/core/providers/cann/cann_kernel.h: In instantiation of ‘onnxruntime::IAllocatorUniquePtr<T> onnxruntime::cann::CannKernel::GetScratchBuffer(size_t, onnxruntime::Stream*) const [with T = void; onnxruntime::IAllocatorUniquePtr<T> = std::unique_ptr<void, std::function<void(void*)> >; size_t = long unsigned int]’:
/home/dou/code/onnxruntime/onnxruntime/core/providers/cann/nn/dropout.cc:56:61:   required from ‘onnxruntime::common::Status onnxruntime::cann::Dropout<T1, T2>::ComputeInternal(onnxruntime::OpKernelContext*) const [with T1 = float; T2 = float]’
/home/dou/code/onnxruntime/onnxruntime/core/providers/cann/nn/dropout.cc:29:8:   required from here
/home/dou/code/onnxruntime/onnxruntime/core/providers/cann/cann_kernel.h:48:40: error: no matching function for call to ‘onnxruntime::IAllocator::MakeUniquePtr<void>(onnxruntime::AllocatorPtr, size_t&, bool, onnxruntime::Stream*&, void (&)(onnxruntime::Stream*, onnxruntime::synchronize::Notification&))’
   48 |     return IAllocator::MakeUniquePtr<T>(Info().GetAllocator(OrtMemTypeDefault), count_or_bytes, false, stream, WaitCannNotificationOnDevice);
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/dou/code/onnxruntime/onnxruntime/core/providers/shared_library/provider_api.h:29,
                 from /home/dou/code/onnxruntime/onnxruntime/core/providers/cann/cann_execution_provider.h:12,

@jywu-msft
Copy link
Member

/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows x64 QNN CI Pipeline

@jywu-msft jywu-msft added the ep:CANN issues related to CANN EO label Aug 2, 2025
Copy link

Azure Pipelines successfully started running 5 pipeline(s).

@bachelor-dou
Copy link
Contributor Author

@snnn please review this PR in your spare time, thanks

@snnn snnn merged commit 9ecd9f3 into microsoft:main Aug 4, 2025
86 of 87 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ep:CANN issues related to CANN EO
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants