How can I make Doxygen aware of CUDA kernel calls?

489 Views Asked by At

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?

1

There are 1 best solutions below

2
On

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.