diff options
author | Evan Shelhamer <shelhamer@imaginarynumber.net> | 2014-06-27 18:36:48 -0700 |
---|---|---|
committer | Evan Shelhamer <shelhamer@imaginarynumber.net> | 2014-07-03 17:14:11 -0700 |
commit | 9f74b6b129ab6ae161d569ce73d346553e04ec49 (patch) | |
tree | 0183412df4de67935a86c90b92f5639f626fd6de /matlab | |
parent | 1fcd29fb9aaedb763f58a1702dedc4a1e3904422 (diff) | |
download | caffe-9f74b6b129ab6ae161d569ce73d346553e04ec49.tar.gz caffe-9f74b6b129ab6ae161d569ce73d346553e04ec49.tar.bz2 caffe-9f74b6b129ab6ae161d569ce73d346553e04ec49.zip |
switch to unified virtual addressing CUDA memcpy
Host / device copies are distinguished by the virtual address of the
pointers instead of explicit memcpy modes.
Diffstat (limited to 'matlab')
-rw-r--r-- | matlab/caffe/matcaffe.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/matlab/caffe/matcaffe.cpp b/matlab/caffe/matcaffe.cpp index 21f51e83..1b2b65ec 100644 --- a/matlab/caffe/matcaffe.cpp +++ b/matlab/caffe/matcaffe.cpp @@ -59,7 +59,7 @@ static mxArray* do_forward(const mxArray* const bottom) { break; case Caffe::GPU: cudaMemcpy(input_blobs[i]->mutable_gpu_data(), data_ptr, - sizeof(float) * input_blobs[i]->count(), cudaMemcpyHostToDevice); + sizeof(float) * input_blobs[i]->count(), cudaMemcpyDefault); break; default: LOG(FATAL) << "Unknown Caffe mode."; @@ -82,7 +82,7 @@ static mxArray* do_forward(const mxArray* const bottom) { break; case Caffe::GPU: cudaMemcpy(data_ptr, output_blobs[i]->gpu_data(), - sizeof(float) * output_blobs[i]->count(), cudaMemcpyDeviceToHost); + sizeof(float) * output_blobs[i]->count(), cudaMemcpyDefault); break; default: LOG(FATAL) << "Unknown Caffe mode."; @@ -109,7 +109,7 @@ static mxArray* do_backward(const mxArray* const top_diff) { break; case Caffe::GPU: cudaMemcpy(output_blobs[i]->mutable_gpu_diff(), data_ptr, - sizeof(float) * output_blobs[i]->count(), cudaMemcpyHostToDevice); + sizeof(float) * output_blobs[i]->count(), cudaMemcpyDefault); break; default: LOG(FATAL) << "Unknown Caffe mode."; @@ -134,7 +134,7 @@ static mxArray* do_backward(const mxArray* const top_diff) { break; case Caffe::GPU: cudaMemcpy(data_ptr, input_blobs[i]->gpu_diff(), - sizeof(float) * input_blobs[i]->count(), cudaMemcpyDeviceToHost); + sizeof(float) * input_blobs[i]->count(), cudaMemcpyDefault); break; default: LOG(FATAL) << "Unknown Caffe mode."; @@ -211,7 +211,7 @@ static mxArray* do_get_weights() { break; case Caffe::GPU: CUDA_CHECK(cudaMemcpy(weights_ptr, layer_blobs[j]->gpu_data(), - sizeof(float) * layer_blobs[j]->count(), cudaMemcpyDeviceToHost)); + sizeof(float) * layer_blobs[j]->count(), cudaMemcpyDefault)); break; default: LOG(FATAL) << "Unknown caffe mode: " << Caffe::mode(); |