1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
#ifndef HPC_ULMBLAS_SWAP_H
#define HPC_ULMBLAS_SWAP_H 1

#include <utility>

namespace hpc { namespace ulmblas {

template <typename Index, typename TX, typename TY>
void
swap(Index n, TX *x, Index incX, TY *y, Index incY)
{
    for (Index i=0; i<n; ++i) {
        std::swap(x[i*incX], y[i*incY]);
    }
}

} } // namespace ulmblas, hpc

#endif // HPC_ULMBLAS_SWAP_H