@@ -74,12 +74,6 @@ Blob<Dtype>::Blob(const vector<int>& shape)
7474 Reshape (shape);
7575}
7676
77- template <typename Dtype>
78- const int * Blob<Dtype>::gpu_shape() const {
79- CHECK (shape_data_);
80- return (const int *)shape_data_->gpu_data ();
81- }
82-
8377template <typename Dtype>
8478const Dtype* Blob<Dtype>::cpu_data() const {
8579 CHECK (data_);
@@ -92,48 +86,24 @@ void Blob<Dtype>::set_cpu_data(Dtype* data) {
9286 data_->set_cpu_data (data);
9387}
9488
95- template <typename Dtype>
96- const Dtype* Blob<Dtype>::gpu_data() const {
97- CHECK (data_);
98- return (const Dtype*)data_->gpu_data ();
99- }
100-
10189template <typename Dtype>
10290const Dtype* Blob<Dtype>::cpu_diff() const {
10391 CHECK (diff_);
10492 return (const Dtype*)diff_->cpu_data ();
10593}
10694
107- template <typename Dtype>
108- const Dtype* Blob<Dtype>::gpu_diff() const {
109- CHECK (diff_);
110- return (const Dtype*)diff_->gpu_data ();
111- }
112-
11395template <typename Dtype>
11496Dtype* Blob<Dtype>::mutable_cpu_data() {
11597 CHECK (data_);
11698 return static_cast <Dtype*>(data_->mutable_cpu_data ());
11799}
118100
119- template <typename Dtype>
120- Dtype* Blob<Dtype>::mutable_gpu_data() {
121- CHECK (data_);
122- return static_cast <Dtype*>(data_->mutable_gpu_data ());
123- }
124-
125101template <typename Dtype>
126102Dtype* Blob<Dtype>::mutable_cpu_diff() {
127103 CHECK (diff_);
128104 return static_cast <Dtype*>(diff_->mutable_cpu_data ());
129105}
130106
131- template <typename Dtype>
132- Dtype* Blob<Dtype>::mutable_gpu_diff() {
133- CHECK (diff_);
134- return static_cast <Dtype*>(diff_->mutable_gpu_data ());
135- }
136-
137107template <typename Dtype>
138108void Blob<Dtype>::ShareData(const Blob& other) {
139109 CHECK_EQ (count_, other.count ());
@@ -162,10 +132,6 @@ void Blob<Dtype>::Update() {
162132 static_cast <const Dtype*>(diff_->cpu_data ()),
163133 static_cast <Dtype*>(data_->mutable_cpu_data ()));
164134 break ;
165- case SyncedMemory::HEAD_AT_GPU:
166- case SyncedMemory::SYNCED:
167- NO_GPU;
168- break ;
169135 default :
170136 LOG (FATAL) << " Syncedmem not initialized." ;
171137 }
@@ -187,9 +153,6 @@ Dtype Blob<Dtype>::asum_data() const {
187153 switch (data_->head ()) {
188154 case SyncedMemory::HEAD_AT_CPU:
189155 return caffe_cpu_asum (count_, cpu_data ());
190- case SyncedMemory::HEAD_AT_GPU:
191- case SyncedMemory::SYNCED:
192- NO_GPU;
193156 case SyncedMemory::UNINITIALIZED:
194157 return 0 ;
195158 default :
@@ -214,9 +177,6 @@ Dtype Blob<Dtype>::asum_diff() const {
214177 switch (diff_->head ()) {
215178 case SyncedMemory::HEAD_AT_CPU:
216179 return caffe_cpu_asum (count_, cpu_diff ());
217- case SyncedMemory::HEAD_AT_GPU:
218- case SyncedMemory::SYNCED:
219- NO_GPU;
220180 case SyncedMemory::UNINITIALIZED:
221181 return 0 ;
222182 default :
@@ -245,10 +205,6 @@ Dtype Blob<Dtype>::sumsq_data() const {
245205 data = cpu_data ();
246206 sumsq = caffe_cpu_dot (count_, data, data);
247207 break ;
248- case SyncedMemory::HEAD_AT_GPU:
249- case SyncedMemory::SYNCED:
250- NO_GPU;
251- break ;
252208 case SyncedMemory::UNINITIALIZED:
253209 return 0 ;
254210 default :
@@ -277,9 +233,6 @@ Dtype Blob<Dtype>::sumsq_diff() const {
277233 diff = cpu_diff ();
278234 sumsq = caffe_cpu_dot (count_, diff, diff);
279235 break ;
280- case SyncedMemory::HEAD_AT_GPU:
281- case SyncedMemory::SYNCED:
282- NO_GPU;
283236 case SyncedMemory::UNINITIALIZED:
284237 return 0 ;
285238 default :
@@ -305,9 +258,6 @@ void Blob<Dtype>::scale_data(Dtype scale_factor) {
305258 data = mutable_cpu_data ();
306259 caffe_scal (count_, scale_factor, data);
307260 return ;
308- case SyncedMemory::HEAD_AT_GPU:
309- case SyncedMemory::SYNCED:
310- NO_GPU;
311261 case SyncedMemory::UNINITIALIZED:
312262 return ;
313263 default :
@@ -332,9 +282,6 @@ void Blob<Dtype>::scale_diff(Dtype scale_factor) {
332282 diff = mutable_cpu_diff ();
333283 caffe_scal (count_, scale_factor, diff);
334284 return ;
335- case SyncedMemory::HEAD_AT_GPU:
336- case SyncedMemory::SYNCED:
337- NO_GPU;
338285 case SyncedMemory::UNINITIALIZED:
339286 return ;
340287 default :
0 commit comments