# loki.backend.cufgen

cufgen(ir, style=None, depth=0)

  Generate CUDA Fortran code from one or many IR objects/trees.

  Implemented by extending the `FortranCodegen` to support CUDA Fortran specific syntax. Refer to the CUDA_FORTRAN_PROGRAMMING_GUIDE for more information.

  Supported subset of the CUDA Fortran specifications:

  - variable qualifiers e.g. `attributes(device)`

  - chevron syntax for to launch kernels e.g. `call kernel<<<grid,block[,bytes][,streamid]>>>(arg1,arg2,...)`

  Natively supported (via `FortranCodegen`):

  - subroutine/function qualifiers e.g. `attributes(global)` via `loki.Subroutine.prefix`

  - kernel loop directives via `loki.ir.Pragma`