fix types of (Layer)SetUp, Reshape, Forward, and Backward calls
[platform/upstream/caffeonacl.git] / src / caffe / layers / hdf5_data_layer.cu
index 3c27f37..f671ea1 100644 (file)
@@ -1,4 +1,3 @@
-// Copyright 2014 BVLC and contributors.
 /*
 TODO:
 - only load parts of the file, in accordance with a prototxt param "max_mem"
@@ -15,16 +14,14 @@ TODO:
 #include "caffe/util/io.hpp"
 #include "caffe/vision_layers.hpp"
 
-using std::string;
-
 namespace caffe {
 
 template <typename Dtype>
-Dtype HDF5DataLayer<Dtype>::Forward_gpu(const vector<Blob<Dtype>*>& bottom,
-      vector<Blob<Dtype>*>* top) {
+void HDF5DataLayer<Dtype>::Forward_gpu(const vector<Blob<Dtype>*>& bottom,
+      const vector<Blob<Dtype>*>& top) {
   const int batch_size = this->layer_param_.hdf5_data_param().batch_size();
-  const int data_count = (*top)[0]->count() / (*top)[0]->num();
-  const int label_data_count = (*top)[1]->count() / (*top)[1]->num();
+  const int data_count = top[0]->count() / top[0]->num();
+  const int label_data_count = top[1]->count() / top[1]->num();
 
   for (int i = 0; i < batch_size; ++i, ++current_row_) {
     if (current_row_ == data_blob_.num()) {
@@ -42,12 +39,11 @@ Dtype HDF5DataLayer<Dtype>::Forward_gpu(const vector<Blob<Dtype>*>& bottom,
     }
     caffe_copy(data_count,
         &data_blob_.cpu_data()[current_row_ * data_count],
-        &(*top)[0]->mutable_gpu_data()[i * data_count]);
+        &top[0]->mutable_gpu_data()[i * data_count]);
     caffe_copy(label_data_count,
         &label_blob_.cpu_data()[current_row_ * label_data_count],
-        &(*top)[1]->mutable_gpu_data()[i * label_data_count]);
+        &top[1]->mutable_gpu_data()[i * label_data_count]);
   }
-  return Dtype(0.);
 }
 
 INSTANTIATE_CLASS(HDF5DataLayer);