| 84 | |
| 85 | template <typename Dtype> |
| 86 | void caffe_copy(const int N, const Dtype* X, Dtype* Y) { |
| 87 | if (X != Y) { |
| 88 | if (Caffe::mode() == Caffe::GPU) { |
| 89 | #ifndef CPU_ONLY |
| 90 | // NOLINT_NEXT_LINE(caffe/alt_fn) |
| 91 | CUDA_CHECK(cudaMemcpy(Y, X, sizeof(Dtype) * N, cudaMemcpyDefault)); |
| 92 | #else |
| 93 | NO_GPU; |
| 94 | #endif |
| 95 | } else { |
| 96 | memcpy(Y, X, sizeof(Dtype) * N); // NOLINT(caffe/alt_fn) |
| 97 | } |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | template void caffe_copy<int>(const int N, const int* X, int* Y); |
| 102 | template void caffe_copy<unsigned int>(const int N, const unsigned int* X, |
no outgoing calls