python_benchmark_messages.cc 977 B

1234567891011121314151617181920212223242526272829
  1. #include <Python.h>
  2. #include "benchmarks.pb.h"
  3. #include "datasets/google_message1/proto2/benchmark_message1_proto2.pb.h"
  4. #include "datasets/google_message1/proto3/benchmark_message1_proto3.pb.h"
  5. #include "datasets/google_message2/benchmark_message2.pb.h"
  6. #include "datasets/google_message3/benchmark_message3.pb.h"
  7. #include "datasets/google_message4/benchmark_message4.pb.h"
  8. static PyMethodDef python_benchmark_methods[] = {
  9. {NULL, NULL, 0, NULL} /* Sentinel */
  10. };
  11. PyMODINIT_FUNC
  12. initlibbenchmark_messages() {
  13. benchmarks::BenchmarkDataset().descriptor();
  14. benchmarks::proto3::GoogleMessage1().descriptor();
  15. benchmarks::proto2::GoogleMessage1().descriptor();
  16. benchmarks::proto2::GoogleMessage2().descriptor();
  17. benchmarks::google_message3::GoogleMessage3().descriptor();
  18. benchmarks::google_message4::GoogleMessage4().descriptor();
  19. PyObject *m;
  20. m = Py_InitModule("libbenchmark_messages", python_benchmark_methods);
  21. if (m == NULL)
  22. return;
  23. }