Skip to content

Fprettify breaks cuda calls #272

@kaanolgu

Description

@kaanolgu

fprettify breaks CUDA Fortran triple-chevron syntax (<<<...>>>)

Description

After running fprettify, the build for #266 broke with multiple syntax errors from the NVHPC compiler:

[ 21%] Building Fortran object src/CMakeFiles/x3d2.dir/backend/cuda/poisson_fft.f90.o
NVFORTRAN-S-0034-Syntax error at or near < (/home/kolgu/x3d2/src/backend/cuda/poisson_fft.f90: 621)
  0 inform,   0 warnings,   1 severes, 0 fatal for fft_postprocess_100_cuda
NVFORTRAN-S-0034-Syntax error at or near < (/home/kolgu/x3d2/src/backend/cuda/poisson_fft.f90: 753)
  0 inform,   0 warnings,   1 severes, 0 fatal for fft_postprocess_110_cuda
NVFORTRAN-S-0034-Syntax error at or near < (/home/kolgu/x3d2/src/backend/cuda/poisson_fft.f90: 968)
NVFORTRAN-S-0034-Syntax error at or near < (/home/kolgu/x3d2/src/backend/cuda/poisson_fft.f90: 975)
  0 inform,   0 warnings,   2 severes, 0 fatal for enforce_periodicity_xy_cuda
NVFORTRAN-S-0034-Syntax error at or near < (/home/kolgu/x3d2/src/backend/cuda/poisson_fft.f90: 1011)
NVFORTRAN-S-0034-Syntax error at or near < (/home/kolgu/x3d2/src/backend/cuda/poisson_fft.f90: 1018)
  0 inform,   0 warnings,   2 severes, 0 fatal for undo_periodicity_xy_cuda
make[2]: *** [src/CMakeFiles/x3d2.dir/build.make:637: src/CMakeFiles/x3d2.dir/backend/cuda/poisson_fft.f90.o] Error 2

Root Cause

fprettify is inserting spaces into the CUDA Fortran kernel launch syntax (<<<...>>>).

Before fprettify:

call process_spectral_010<<<blocks, threads>>>( & !&

After fprettify:

call process_spectral_010 <  <  < blocks, threads >  >  > ( &

The inserted spaces break the triple-chevron syntax, which the NVHPC compiler then rejects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions