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>
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.";
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: