piiswrong closed pull request #8692: mac build fix URL: https://github.com/apache/incubator-mxnet/pull/8692
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/src/engine/threaded_engine_perdevice.cc b/src/engine/threaded_engine_perdevice.cc index 413a7a5e97..60bdd8c456 100644 --- a/src/engine/threaded_engine_perdevice.cc +++ b/src/engine/threaded_engine_perdevice.cc @@ -99,14 +99,14 @@ class ThreadedEnginePerDevice : public ThreadedEngine { const Context& ctx = opr_block->ctx; if ((opr_block->opr->prop == FnProperty::kAsync || opr_block->opr->prop == FnProperty::kDeleteVar) && pusher_thread) { - if (ctx.dev_mask() == gpu::kDevMask) { + if (ctx.dev_mask() == Context::kGPU) { #if MXNET_USE_CUDA MSHADOW_CATCH_ERROR(mshadow::SetDevice<gpu>(ctx.dev_id)); #endif } this->ExecuteOprBlock(RunContext{ctx, nullptr}, opr_block); } else { - if (ctx.dev_mask() == cpu::kDevMask) { + if (ctx.dev_mask() == Context::kCPU) { if (opr_block->opr->prop == FnProperty::kCPUPrioritized) { cpu_priority_worker_->task_queue.Push(opr_block, opr_block->priority); } else { @@ -129,7 +129,7 @@ class ThreadedEnginePerDevice : public ThreadedEngine { } } } else { - CHECK_EQ(ctx.dev_mask(), gpu::kDevMask); + CHECK_EQ(ctx.dev_mask(), Context::kGPU); // GPU execution. FnProperty prop = opr_block->opr->prop; bool is_copy = (prop == FnProperty::kCopyFromGPU || diff --git a/src/io/image_io.cc b/src/io/image_io.cc index 9081a3734b..987220c536 100644 --- a/src/io/image_io.cc +++ b/src/io/image_io.cc @@ -178,7 +178,7 @@ void Imdecode(const nnvm::NodeAttrs& attrs, #if MXNET_USE_OPENCV const auto& param = nnvm::get<ImdecodeParam>(attrs.parsed); - CHECK_EQ(inputs[0].ctx().dev_mask(), cpu::kDevMask) << "Only supports cpu input"; + CHECK_EQ(inputs[0].ctx().dev_mask(), Context::kCPU) << "Only supports cpu input"; CHECK_EQ(inputs[0].dtype(), mshadow::kUint8) << "Input needs to be uint8 buffer"; inputs[0].WaitToRead(); diff --git a/src/resource.cc b/src/resource.cc index d591651145..287f3cbb76 100644 --- a/src/resource.cc +++ b/src/resource.cc @@ -112,14 +112,14 @@ class ResourceManagerImpl : public ResourceManager { // request resources Resource Request(Context ctx, const ResourceRequest &req) override { - if (ctx.dev_mask() == cpu::kDevMask) { + if (ctx.dev_mask() == Context::kCPU) { switch (req.type) { case ResourceRequest::kRandom: return cpu_rand_->resource; case ResourceRequest::kTempSpace: return cpu_space_->GetNext(); default: LOG(FATAL) << "Unknown supported type " << req.type; } } else { - CHECK_EQ(ctx.dev_mask(), gpu::kDevMask); + CHECK_EQ(ctx.dev_mask(), Context::kGPU); #if MSHADOW_USE_CUDA switch (req.type) { case ResourceRequest::kRandom: { ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services