<h5 dir="auto">System information (version)</h5>

<p dir="auto">Using the cv2 libraray in a python3.6 application, when I try to set the preferable target to CUDA using the line <code class="notranslate">cv.dnn_Net.setPreferableTarget(cv.dnn.DNN_TARGET_CUDA)</code> I get the following error;</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TypeError: descriptor 'setPreferableTarget' requires a 'cv2.dnn_Net' object but received a 'int'"><pre class="notranslate"><code class="notranslate">TypeError: descriptor 'setPreferableTarget' requires a 'cv2.dnn_Net' object but received a 'int'
</code></pre></div>
<p dir="auto">I followed the 4.2 docs when determing the object to use when setting the target.</p>
<p dir="auto">Can't really determine if it's a bug or silly mistake.Everything else runs without issue.</p>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">This is a duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="224658849" data-permission-text="Title is private" data-url="https://github.com/opencv/opencv/issues/8658" data-hovercard-type="issue" data-hovercard-url="/opencv/opencv/issues/8658/hovercard" href="https://github.com/opencv/opencv/issues/8658">#8658</a>. Linking any application that uses the OpenCV C API without optimizations now results in a undefined reference to cvRound. This is because this function is now defined ONLY in a C++-only header: fast_math.hpp.</p>
<p dir="auto">The reply (by "alalek") on that bug was that the C API shouldn't be used anymore. I don't know who alalek is; is this the official position? This issue effectively kills the C API. I.e. it's no longer an OPTION to use the C API without experiencing pain. And this particular issue isn't even hard to fix. I can give you a patch, and we can agree to at least not kill the C API on purpose, yes?</p>