Caffe2 - C++ API
A deep learning, cross platform ML framework
print_core_object_sizes_gpu.cc
1 
17 #include <iostream>
18 
19 #include "caffe2/core/init.h"
20 #include "caffe2/core/operator.h"
21 #include "caffe2/core/context.h"
22 #include "caffe2/core/context_gpu.h"
23 #include "caffe2/proto/caffe2_pb.h"
24 
25 #define PRINT_SIZE(cls) \
26  std::cout << "Size of " #cls ": " << sizeof(cls) << " bytes." \
27  << std::endl;
28 
29 int main(int /* unused */, char** /* unused */) {
30  PRINT_SIZE(caffe2::Blob);
31  PRINT_SIZE(caffe2::Tensor);
32  PRINT_SIZE(caffe2::CPUContext);
33  PRINT_SIZE(caffe2::CUDAContext);
34  PRINT_SIZE(caffe2::OperatorBase);
35  PRINT_SIZE(caffe2::OperatorDef);
38  PRINT_SIZE(caffe2::TypeMeta);
39  PRINT_SIZE(caffe2::Workspace);
40  return 0;
41 }
Blob is a general container that hosts a typed pointer.
Definition: blob.h:24
The CPU Context, representing the bare minimum of what a Context class in Caffe2 should implement...
Definition: context.h:40
Workspace is a class that holds all the related objects created during runtime: (1) all blobs...
Definition: workspace.h:47
TypeMeta is a thin class that allows us to store the type of a container such as a blob...
Definition: typeid.h:324