MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / PYBIND11_MODULE

Function PYBIND11_MODULE

python/mod_cvcuda/Main.cpp:60–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58namespace py = pybind11;
59
60PYBIND11_MODULE(_cvcuda, m)
61{
62 m.attr("__name__") = "cvcuda";
63 m.attr("__version__") = CVCUDA_VERSION_STRING;
64
65 {
66 using namespace nvcvpy::priv;
67
68 // Submodule used for additional functionality needed only by tests
69 // so that some level of white-box testing is possible.
70 //
71 // This guarantees a clear separation of public and private APIs.
72 // Users are restricted to the public API, allowing us to change the
73 // private APIs as needed, without worring in breaking user's code.
74 //
75 // To retrieve it from inside the Export call, include "Definitions.hpp"
76 // and call:
77 // py::module_ internal = m.attr(INTERNAL_SUBMODULE_NAME);
78 // Functions and other properties can be then exposed as usual, e.g.
79 // internal.def("foo", &Foo");
80 // and accessed in python as you'd expect:
81 // cvcuda.internal.foo()
82 m.def_submodule(INTERNAL_SUBMODULE_NAME);
83
84 // Export NVCV core types (Tensor, Image, Format, etc.)
85 // Supporting objects
86 ExportColorSpec(m);
87 ExportImageFormat(m);
88 ExportDataType(m);
89 ExportRect(m);
90 ExportThreadScope(m);
91
92 // Core Entities
93 ExportCAPI(m);
94 Resource::Export(m);
95 Cache::Export(m);
96 Container::Export(m);
97 ExternalBuffer::Export(m);
98
99 // Objects
100 Tensor::Export(m);
101 TensorBatch::Export(m);
102 Image::Export(m);
103 ImageBatchVarShape::Export(m);
104 Stream::Export(m);
105 }
106
107 {
108 using namespace cvcudapy;
109
110 // doctag: Non-Operators
111 // Operators' auxiliary entities
112 ExportAdaptiveThresholdType(m);
113 ExportBorderType(m);
114 ExportBoxBlur(m);
115 ExportChannelManipType(m);
116 ExportOSD(m);
117 ExportColorConversionCode(m);

Callers

nothing calls this directly

Calls 15

ExportColorSpecFunction · 0.85
ExportImageFormatFunction · 0.85
ExportDataTypeFunction · 0.85
ExportRectFunction · 0.85
ExportThreadScopeFunction · 0.85
ExportCAPIFunction · 0.85
ExportBorderTypeFunction · 0.85
ExportBoxBlurFunction · 0.85
ExportChannelManipTypeFunction · 0.85
ExportOSDFunction · 0.85

Tested by

no test coverage detected