Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to call CUDA api with optional location?

I wonder what is the best way to call those API with optional location. For example:
CUresult cuStreamGetCaptureInfo_v2 ( CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, size_t* numDependencies_out )
The document says id_out, graph_out are optional location. In python, if it is optional, we don’t need to specify it. If i wanted to pass in only id_out, how can I achieve that without getting the "too few arguments" error?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

In C or C++, for a function with a prototype like that, all arguments must be specified in order to get anything to compile. This doesn’t have anything to do with CUDA.

For that particular function, all optional arguments are pointer arguments. It should be safe to pass a null pointer for any "optional" argument that you don’t wish to specify.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading