简体   繁体   中英

How can I make Doxygen aware of CUDA kernel calls?

I'm trying to document a project written in CUDA C using Doxygen. The documentation works fine. However the caller graphs does not include kernel calls as in GPU_foo<<<1,1>>>() .

For example, in this simple example:

#include<stdio.h>

/*!
 * @brief global hello foo
 */
__global__ void global_hello(void){

printf("Hello\n");

}


/*!
 * @brief CPU hello foo
 */
void hello(void){

printf("Hello\n");
}

/*!
 * @brief main
 */
int main(){

 hello();

 global_hello<<<1,1>>>();

return 0;
}

With a corresponding Doxyfile:

PROJECT_NAME = TEST
PROJECT_NUMER = 2.1

OUTPUT_LANGUAGE = English
EXTRACT_ALL = YES
FILE_PATTERNS = *.cpp *.h *.c *.cu
RECURSIVE = NO 
PDF_HYPERLINKS = YES
USE_PDFLATEX   = YES
HAVE_DOT = YES
CALL_GRAPH = YES
CALLER_GRAPH = YES

When looking at the generated documentation the call graph looks like this:

main -----> hello

Instead of the desired:

      ------> global_hello
    /
main
    \
      ------> hello

How can I make Doxygen aware of CUDA kernel calls?

The problem is that Doxygen does not know that a line containing "<<< >>>" is a function call. I do not need the call graph to make a distinction between function calls and kernel calls. It is enough if the parser considers the kernel as normal function calls.

Summarizing. Is there a way to tell Doxygen to interpret the lines with <<<>>> as function calls? Some suggested to change the internal parser method of Doxygen, how should this be done?

If doxygen doesn't recognize the CUDA functions, there's not much you can do:

Citing the doxygen manual :

Note The completeness (and correctness) of the call graph depends on the doxygen code parser which is not perfect.

And the code parser of doxygen is not easily extensible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM