Skip to content

Commit

Permalink
mac build fix (apache#8692)
Browse files Browse the repository at this point in the history
  • Loading branch information
szha authored and piiswrong committed Nov 18, 2017
1 parent 257ad1d commit bdd14a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/engine/threaded_engine_perdevice.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 ||
Expand Down
2 changes: 1 addition & 1 deletion src/io/image_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
4 changes: 2 additions & 2 deletions src/resource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit bdd14a8

Please sign in to comment.