Skip to content

Commit

Permalink
Merge pull request #56 from DVEfremov/issue-55
Browse files Browse the repository at this point in the history
Compilation fails for caffe opencl branch in CPU_ONLY mode issue #55
  • Loading branch information
naibaf7 authored Feb 3, 2017
2 parents 7da76f3 + b5b16a9 commit 0972b6e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/caffe/layers/softmax_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ void SoftmaxLayer<Dtype>::Reshape(const vector<Blob<Dtype>*>& bottom,
caffe_set(sum_multiplier_.count(), Dtype(1), multiplier_data);
outer_num_ = bottom[0]->count(0, softmax_axis_);
inner_num_ = bottom[0]->count(softmax_axis_ + 1);
vector<int_tp> scale_dims = bottom[0]->shape();
#ifdef USE_GREENTEA
use_slm_ = (bottom[0]->shape(softmax_axis_) * inner_num_
+ inner_num_ * 17) <= 8192;
vector<int_tp> scale_dims = bottom[0]->shape();
scale_dims[softmax_axis_] = use_slm_ ? 1 : 17;
#else
scale_dims[softmax_axis_] = 1;
#endif
scale_.Reshape(scale_dims);
}

Expand Down

0 comments on commit 0972b6e

Please sign in to comment.