Search code examples
cudafortrangpuvectorization

Vectorization in CUDA Fortran


. How could I use instruction like LDS.128 in CUDA Fortran to do vectorization?

Are there some methods in CUDA Fortran to do vectorization like CUDA C/C++:

// data is a floating points array
float4 *data_vec = (float4 *)data;

// Using vectorized loading instruction
float4 d1 = data_vec[0];

Solution

  • Cuda fortran doesn't have explicit support for the standard vector types exposed in the C++ CUDA dialect. If there are opportunities for using vectorised memory transaction in your code, you will have to rely on the compilers to identify and emit them.