caffe2 icon indicating copy to clipboard operation
caffe2 copied to clipboard

difference between macro USE_METAL, CAFFE2_USE_MPSCNN & CAFFE2_MOBILE

Open xhsoldier opened this issue 7 years ago • 7 comments

For iOS system, do I need to enable all these macros? USE_METAL, CAFFE2_USE_MPSCNN CAFFE2_MOBILE

xhsoldier avatar Dec 18 '17 03:12 xhsoldier

@bwasti Do you know this?

pietern avatar Dec 18 '17 23:12 pietern

USE_METAL is deprecated. If you just use CPU, you can enable CAFFE2_MOBILE. If you want to use iOS GPU, you should enable both CAFFE2_MOBILE and CAFFE2_USE_MPSCNN.

jerryzh168 avatar Dec 22 '17 00:12 jerryzh168

i enable the both CAFFE2_MOBILE and CAFFE2_USE_MPSCNN. then compile with a error: caffe2/caffe2/mobile/contrib/ios/mpscnn/mpscnn.mm:24:10: fatal error: 'caffe2/mobile/fb/aloha/headers.h' file not found #include "caffe2/mobile/fb/aloha/headers.h"

xhsoldier avatar Dec 22 '17 10:12 xhsoldier

@jerryzh168 I couldn't get the master branch compile with flags CAFFE2_USE_MPSCNN and CAFFE2_MOBILE. It only seems to accept USE_METAL flag though.

sasikiran avatar Jan 03 '18 10:01 sasikiran

There are problems with header files. We're looking into it, will give an update when it is resolved.

On Jan 3, 2018, 2:01 AM -0800, Sasi kiran Malladi [email protected], wrote:

@jerryzh168 I couldn't get the master branch compile with flags CAFFE2_USE_MPSCNN and CAFFE2_MOBILE. It only seems to accept USE_METAL flag though. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

jerryzh168 avatar Jan 03 '18 16:01 jerryzh168

Should be fixed in #1690 now - feel free to reopen if it does not work.

Yangqing avatar Jan 03 '18 18:01 Yangqing

the libcaffe2.a was succussfully built. But when I use the lib, I got a error:

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_MPSCNNSoftMax", referenced from:
      objc-class-ref in libcaffe2.a(mpscnn.mm.o)
  "_OBJC_CLASS_$_MPSCNNPoolingMax", referenced from:
      objc-class-ref in libcaffe2.a(mpscnn.mm.o)
  "_OBJC_CLASS_$_MPSCNNPoolingAverage", referenced from:
      objc-class-ref in libcaffe2.a(mpscnn.mm.o)
  "_OBJC_CLASS_$_MPSCNNNeuronTanH", referenced from:
      objc-class-ref in libcaffe2.a(mpscnn.mm.o)
  "caffe2::utils::ComputeAllAnchors(caffe2::Tensor<caffe2::CPUContext> const&, int, int, float)", referenced from:
      caffe2::(anonymous namespace)::MPSCNNGenerateProposalsCPPOp::RunOnDevice() in libcaffe2.a(mpscnn.mm.o)
  "_OBJC_CLASS_$_MPSCNNConvolutionDescriptor", referenced from:
      objc-class-ref in libcaffe2.a(mpscnn.mm.o)
  "_OBJC_CLASS_$_MPSCNNNeuronSigmoid", referenced from:
      objc-class-ref in libcaffe2.a(mpscnn.mm.o)
  "_OBJC_CLASS_$_MPSCNNConvolution", referenced from:
      objc-class-ref in libcaffe2.a(mpscnn.mm.o)
  "_OBJC_CLASS_$_MPSCNNNeuronReLU", referenced from:
      objc-class-ref in libcaffe2.a(mpscnn.mm.o)
  "_OBJC_CLASS_$_MPSImage", referenced from:
      objc-class-ref in libcaffe2.a(mpscnn.mm.o)
  "_OBJC_CLASS_$_MPSCNNDepthWiseConvolutionDescriptor", referenced from:
      objc-class-ref in libcaffe2.a(mpscnn.mm.o)
  "_OBJC_CLASS_$_MPSCNNConvolutionTranspose", referenced from:
      objc-class-ref in libcaffe2.a(mpscnn.mm.o)
  "_OBJC_CLASS_$_MPSImageDescriptor", referenced from:
      objc-class-ref in libcaffe2.a(mpscnn.mm.o)
  "_OBJC_CLASS_$_MPSTemporaryImage", referenced from:
      objc-class-ref in libcaffe2.a(mpscnn.mm.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

xhsoldier avatar Jan 09 '18 10:01 xhsoldier