Permalink
Browse files

fix problem when compiling without CUDA

  • Loading branch information...
1 parent f3d68ee commit 150886379be211926d44b18d04698e7fadecfca7 @hjk41 hjk41 committed Jun 9, 2015
Showing with 2 additions and 0 deletions.
  1. +2 −0 apps/ps/mnist_mlp_ps.cpp
@@ -208,7 +208,9 @@ int MinervaWorkerMain(int rank, int size, int argc, char *argv[]) {
bias[k] = NArray::PushGradAndPullWeight(sens[k + 1].Sum(1) / mb_size, GetBiasName(k));
weights[k] = NArray::PushGradAndPullWeight(sens[k + 1] * acts[k].Trans() / mb_size, GetWeightName(k));
}
+#ifdef HAS_CUDA
ms.SetDevice(gpuDevice);
+#endif
if ((mb - rank) % 20 == 0) {
ms.SetDevice(cpuDevice);

0 comments on commit 1508863

Please sign in to comment.