OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
encap_shmem.hpp
1/*
2 * memcpy_shmem.hpp
3 *
4 * Created on: Aug 3, 2019
5 * Author: i-bird
6 */
7
8#ifndef ENCAP_SHMEM_HPP_
9#define ENCAP_SHMEM_HPP_
10
16template<unsigned int sz>
18{
19 static const int size = (sz / 4)*4 + (sz % 4 != 0)*4;
20 static const int nthr = (sz / 4) + (sz % 4 != 0);
21
22 __device__ static void copy(int * src, int * dst)
23 {
24 if (threadIdx.x < nthr)
25 {dst[threadIdx.x] = src[threadIdx.x];}
26 }
27};
28
29
30#endif /* MEMCPY_SHMEM_HPP_ */
memcpy it split the copy across threads