Strong content markers for CUDA source in files without a CUDA extension * (headers). The dunders are execution-space specifiers that only nvcc defines; * `cudaStream_t` is the runtime's stream handle, pervasive in launcher headers * that themselves declare no kernel. Deliberately excludes weak m
(source: string)
| 738 | * that themselves declare no kernel. Deliberately excludes weak markers (`dim3`, |
| 739 | * `<<<`) that could plausibly appear in non-CUDA text. */ |
| 740 | function looksLikeCudaSource(source: string): boolean { |
| 741 | return ( |
| 742 | source.indexOf('__global__') !== -1 || |
| 743 | source.indexOf('__device__') !== -1 || |
| 744 | source.indexOf('__constant__') !== -1 || |
| 745 | source.indexOf('cudaStream_t') !== -1 |
| 746 | ); |
| 747 | } |
| 748 | |
| 749 | /** |
| 750 | * Restore preprocessor-directive lines to their original bytes after the |
no outgoing calls
no test coverage detected