summaryrefslogtreecommitdiff
path: root/src/caffe
diff options
context:
space:
mode:
authorEvan Shelhamer <shelhamer@imaginarynumber.net>2014-06-28 14:05:35 -0700
committerEvan Shelhamer <shelhamer@imaginarynumber.net>2014-07-03 17:20:31 -0700
commit19e909ba982baeaf5505812ea49aba7066967576 (patch)
treecad32d4e375fe6e0690b5b9c7ecf98680472b591 /src/caffe
parent6461365565bd8a661522a267c7caae1a37313935 (diff)
downloadcaffeonacl-19e909ba982baeaf5505812ea49aba7066967576.tar.gz
caffeonacl-19e909ba982baeaf5505812ea49aba7066967576.tar.bz2
caffeonacl-19e909ba982baeaf5505812ea49aba7066967576.zip
fix casts (static for void*)
Diffstat (limited to 'src/caffe')
-rw-r--r--src/caffe/blob.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/caffe/blob.cpp b/src/caffe/blob.cpp
index 69ff49ef..8df46323 100644
--- a/src/caffe/blob.cpp
+++ b/src/caffe/blob.cpp
@@ -75,25 +75,25 @@ const Dtype* Blob<Dtype>::gpu_diff() const {
template <typename Dtype>
Dtype* Blob<Dtype>::mutable_cpu_data() {
CHECK(data_);
- return reinterpret_cast<Dtype*>(data_->mutable_cpu_data());
+ return static_cast<Dtype*>(data_->mutable_cpu_data());
}
template <typename Dtype>
Dtype* Blob<Dtype>::mutable_gpu_data() {
CHECK(data_);
- return reinterpret_cast<Dtype*>(data_->mutable_gpu_data());
+ return static_cast<Dtype*>(data_->mutable_gpu_data());
}
template <typename Dtype>
Dtype* Blob<Dtype>::mutable_cpu_diff() {
CHECK(diff_);
- return reinterpret_cast<Dtype*>(diff_->mutable_cpu_data());
+ return static_cast<Dtype*>(diff_->mutable_cpu_data());
}
template <typename Dtype>
Dtype* Blob<Dtype>::mutable_gpu_diff() {
CHECK(diff_);
- return reinterpret_cast<Dtype*>(diff_->mutable_gpu_data());
+ return static_cast<Dtype*>(diff_->mutable_gpu_data());
}
template <typename Dtype>
@@ -121,15 +121,15 @@ void Blob<Dtype>::Update() {
case SyncedMemory::HEAD_AT_CPU:
// perform computation on CPU
caffe_axpy<Dtype>(count_, Dtype(-1),
- reinterpret_cast<const Dtype*>(diff_->cpu_data()),
- reinterpret_cast<Dtype*>(data_->mutable_cpu_data()));
+ static_cast<const Dtype*>(diff_->cpu_data()),
+ static_cast<Dtype*>(data_->mutable_cpu_data()));
break;
case SyncedMemory::HEAD_AT_GPU:
case SyncedMemory::SYNCED:
// perform computation on GPU
caffe_gpu_axpy<Dtype>(count_, Dtype(-1),
- reinterpret_cast<const Dtype*>(diff_->gpu_data()),
- reinterpret_cast<Dtype*>(data_->mutable_gpu_data()));
+ static_cast<const Dtype*>(diff_->gpu_data()),
+ static_cast<Dtype*>(data_->mutable_gpu_data()));
break;
default:
LOG(FATAL) << "Syncedmem not initialized.";
@@ -150,19 +150,19 @@ void Blob<Dtype>::CopyFrom(const Blob& source, bool copy_diff, bool reshape) {
case Caffe::GPU:
if (copy_diff) {
caffe_copy(count_, source.gpu_diff(),
- reinterpret_cast<Dtype*>(diff_->mutable_gpu_data()));
+ static_cast<Dtype*>(diff_->mutable_gpu_data()));
} else {
caffe_copy(count_, source.gpu_data(),
- reinterpret_cast<Dtype*>(data_->mutable_gpu_data()));
+ static_cast<Dtype*>(data_->mutable_gpu_data()));
}
break;
case Caffe::CPU:
if (copy_diff) {
caffe_copy(count_, source.cpu_diff(),
- reinterpret_cast<Dtype*>(diff_->mutable_cpu_data()));
+ static_cast<Dtype*>(diff_->mutable_cpu_data()));
} else {
caffe_copy(count_, source.cpu_data(),
- reinterpret_cast<Dtype*>(data_->mutable_cpu_data()));
+ static_cast<Dtype*>(data_->mutable_cpu_data()));
}
break;
default: