Caffe2 - C++ API
A deep learning, cross platform ML framework
mpscnn.h
1 
2 #pragma once
3 #include "caffe2/core/net.h"
4 #include "caffe2/utils/math.h"
5 
6 namespace caffe2 {
7 static constexpr const char* kMPSCNNReadCountArg = "__mpscnn_read_count__";
8 static constexpr const char* kMPSCNNOutputIsTempImageArg = "__mpscnn_output_is_temp_img__";
9 static constexpr const int kMetalMaxTextureArrLength = 2048;
10 // We currently only try to convert a fixed set of operators that handle a subset of a full
11 // CNN. We also only run when MPSCNN is available, provides a speedup.
12 // On failure, returns false. On success, returns true, and sets the MPSCNN net in the output
13 // parameter.
14 
15 bool tryConvertToMPSCNN(const NetDef& initNet, const NetDef& predictNet, NetDef* mpscnnPredictNet);
16 
17 // Exposed for testing.
18 NetDef annotateDefWithReadCounts(const NetDef& net);
19 NetDef rewriteForMetal(const NetDef& net);
20 NetDef runMPSCNNFusion(const NetDef& net);
21 void dumpDef(const NetDef& d);
22 void mpscnnRecordExecutionFinish();
23 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13