lammps-master/lib/gpu/lal_atom.h
inline void cast_v_data(double **host_ptr, const tagint *host_tag) {
    if (_v_avail==false) {
      double t=MPI_Wtime();
      #ifdef GPU_CAST
      memcpy(host_v_cast.begin(),host_ptr[0],_nall*3*sizeof(double));
      memcpy(host_tag_cast.begin(),host_tag,_nall*sizeof(int));
      #else
      int wl=0;
      for (int i=0; i<_nall; i++) {
        v[wl]=host_ptr[i][0];
        v[wl+1]=host_ptr[i][1];
        v[wl+2]=host_ptr[i][2];
        v[wl+3]=host_tag[i];
        wl+=4;
      }
      #endif
      _time_cast+=MPI_Wtime()-t;
    }
  }
/// Cast velocities and tags to write buffer
Cast velocities and tags to write buffer
Cast velocities and tags to write buffer
inline void cast_v_data(double **host_ptr, const tagint *host_tag) {
    if (_v_avail==false) {
      double t=MPI_Wtime();
      #ifdef GPU_CAST
      memcpy(host_v_cast.begin(),host_ptr[0],_nall*3*sizeof(double));
      memcpy(host_tag_cast.begin(),host_tag,_nall*sizeof(int));
      #else
      int wl=0;
      for (int i=0; i<_nall; i++) {
        v[wl]=host_ptr[i][0];
        v[wl+1]=host_ptr[i][1];
        v[wl+2]=host_ptr[i][2];
        v[wl+3]=host_tag[i];
        wl+=4;
      }
      #endif
      _time_cast+=MPI_Wtime()-t;
    }
  }
inline void cast_v_data ( double * * host_ptr , const tagint * host_tag ) { if ( _v_avail == false ) { double t = MPI_Wtime ( ) ; #ifdef GPU_CAST memcpy ( host_v_cast . begin ( ) , host_ptr [ 0 ] , _nall * 3 * sizeof ( double ) ) ; memcpy ( host_tag_cast . begin ( ) , host_tag , _nall * sizeof ( int ) ) ; #else int wl = 0 ; for ( int i = 0 ; i < _nall ; i ++ ) { v [ wl ] = host_ptr [ i ] [ 0 ] ; v [ wl + 1 ] = host_ptr [ i ] [ 1 ] ; v [ wl + 2 ] = host_ptr [ i ] [ 2 ] ; v [ wl + 3 ] = host_tag [ i ] ; wl += 4 ; } #endif _time_cast += MPI_Wtime ( ) - t ; } }
Cast velocities and tags to write buffer
Cast velocities and tags to write buffer