mirror of
https://github.com/opencv/opencv.git
synced 2026-12-02 21:22:43 -06:00
Merge pull request #31314 from blank-0007/fix-dnn-cpu-target-warning-30806
dnn: accept DNN_TARGET_CPU on mainGraph when HAVE_CUDA is disabled
This commit is contained in:
@@ -375,8 +375,11 @@ void Net::Impl::setPreferableTarget(int targetId)
|
||||
|
||||
if (mainGraph)
|
||||
{
|
||||
if (targetId == DNN_TARGET_CPU
|
||||
#ifdef HAVE_CUDA
|
||||
if (targetId == DNN_TARGET_CPU || IS_DNN_CUDA_TARGET(targetId))
|
||||
|| IS_DNN_CUDA_TARGET(targetId)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
if (preferableTarget != targetId) {
|
||||
preferableTarget = targetId;
|
||||
@@ -384,7 +387,6 @@ void Net::Impl::setPreferableTarget(int targetId)
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
CV_LOG_WARNING(NULL, "Targets are not supported by the new graph engine for now");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user