Merge branch 'feature/enhance_dev_ctx_pool' into feature/is_nan

del_some_in_makelist
Yang Yu 7 years ago
commit e54bb6cc44

@ -29,7 +29,7 @@ bool MKLDNNLRNLayer::init(const LayerMap& layerMap,
} }
/* the size of inputs for norm-layer is 1 */ /* the size of inputs for norm-layer is 1 */
CHECK_EQ(config_.inputs_size(), 1UL); CHECK_EQ(config_.inputs_size(), 1);
const NormConfig& conf = config_.inputs(0).norm_conf(); const NormConfig& conf = config_.inputs(0).norm_conf();
localSize_ = conf.size(); localSize_ = conf.size();
alpha_ = conf.scale(); alpha_ = conf.scale();

@ -57,8 +57,8 @@ class BeamSearchDecodeOp : public framework::OperatorBase {
: OperatorBase(type, inputs, outputs, attrs) {} : OperatorBase(type, inputs, outputs, attrs) {}
void Run(const framework::Scope& scope, void Run(const framework::Scope& scope,
const platform::Place& dev_place) const override { const platform::Place& dev_place) const override {
platform::DeviceContextPool& pool = platform::DeviceContextPool::Get(); platform::DeviceContextPool& pool = platform::DeviceContextPool::Instance();
auto& dev_ctx = *pool.Borrow(dev_place); auto& dev_ctx = *pool.Get(dev_place);
framework::ExecutionContext ctx(*this, scope, dev_ctx); framework::ExecutionContext ctx(*this, scope, dev_ctx);

@ -305,7 +305,7 @@ int main(int argc, char **argv) {
} }
VLOG(0) << " DeviceCount " << count; VLOG(0) << " DeviceCount " << count;
paddle::platform::DeviceContextPool::Create(places); paddle::platform::DeviceContextPool::Init(places);
testing::InitGoogleTest(&argc, argv); testing::InitGoogleTest(&argc, argv);

Loading…
Cancel
Save