From 19e909ba982baeaf5505812ea49aba7066967576 Mon Sep 17 00:00:00 2001 From: Evan Shelhamer Date: Sat, 28 Jun 2014 14:05:35 -0700 Subject: [PATCH] fix casts (static for void*) --- src/caffe/blob.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/caffe/blob.cpp b/src/caffe/blob.cpp index 69ff49e..8df4632 100644 --- a/src/caffe/blob.cpp +++ b/src/caffe/blob.cpp @@ -75,25 +75,25 @@ const Dtype* Blob::gpu_diff() const { template Dtype* Blob::mutable_cpu_data() { CHECK(data_); - return reinterpret_cast(data_->mutable_cpu_data()); + return static_cast(data_->mutable_cpu_data()); } template Dtype* Blob::mutable_gpu_data() { CHECK(data_); - return reinterpret_cast(data_->mutable_gpu_data()); + return static_cast(data_->mutable_gpu_data()); } template Dtype* Blob::mutable_cpu_diff() { CHECK(diff_); - return reinterpret_cast(diff_->mutable_cpu_data()); + return static_cast(diff_->mutable_cpu_data()); } template Dtype* Blob::mutable_gpu_diff() { CHECK(diff_); - return reinterpret_cast(diff_->mutable_gpu_data()); + return static_cast(diff_->mutable_gpu_data()); } template @@ -121,15 +121,15 @@ void Blob::Update() { case SyncedMemory::HEAD_AT_CPU: // perform computation on CPU caffe_axpy(count_, Dtype(-1), - reinterpret_cast(diff_->cpu_data()), - reinterpret_cast(data_->mutable_cpu_data())); + static_cast(diff_->cpu_data()), + static_cast(data_->mutable_cpu_data())); break; case SyncedMemory::HEAD_AT_GPU: case SyncedMemory::SYNCED: // perform computation on GPU caffe_gpu_axpy(count_, Dtype(-1), - reinterpret_cast(diff_->gpu_data()), - reinterpret_cast(data_->mutable_gpu_data())); + static_cast(diff_->gpu_data()), + static_cast(data_->mutable_gpu_data())); break; default: LOG(FATAL) << "Syncedmem not initialized."; @@ -150,19 +150,19 @@ void Blob::CopyFrom(const Blob& source, bool copy_diff, bool reshape) { case Caffe::GPU: if (copy_diff) { caffe_copy(count_, source.gpu_diff(), - reinterpret_cast(diff_->mutable_gpu_data())); + static_cast(diff_->mutable_gpu_data())); } else { caffe_copy(count_, source.gpu_data(), - reinterpret_cast(data_->mutable_gpu_data())); + static_cast(data_->mutable_gpu_data())); } break; case Caffe::CPU: if (copy_diff) { caffe_copy(count_, source.cpu_diff(), - reinterpret_cast(diff_->mutable_cpu_data())); + static_cast(diff_->mutable_cpu_data())); } else { caffe_copy(count_, source.cpu_data(), - reinterpret_cast(data_->mutable_cpu_data())); + static_cast(data_->mutable_cpu_data())); } break; default: -- 2.7.4