MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / DoInit

Method DoInit

src/opr/impl/nvof/NvOFCuda.cpp:104–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void NvOFCuda::DoInit(const NV_OF_INIT_PARAMS& initParams) {
105 uint32_t minWidth = _QuerySupportCaps(NV_OF_CAPS_WIDTH_MIN);
106 uint32_t maxWidth = _QuerySupportCaps(NV_OF_CAPS_WIDTH_MAX);
107 uint32_t minHeight = _QuerySupportCaps(NV_OF_CAPS_HEIGHT_MIN);
108 uint32_t maxHeight = _QuerySupportCaps(NV_OF_CAPS_HEIGHT_MAX);
109 if (!(initParams.width <= maxWidth && initParams.width >= minWidth &&
110 initParams.height <= maxHeight && initParams.height >= minHeight)) {
111 mgb_throw(
112 MegBrainError,
113 "the input height must between [%d,%d] and width must between "
114 "[%d,%d]. your (h,w) is (%d,%d)\n",
115 minHeight, maxHeight, minWidth, maxWidth, initParams.height,
116 initParams.width);
117 }
118 NVOF_API_CALL(m_NvOFAPI->GetAPI()->nvOFInit(m_NvOFAPI->GetHandle(), &initParams));
119}
120
121uint32_t NvOFCuda::_QuerySupportCaps(const NV_OF_CAPS& cap) {
122 uint32_t size = 0;

Callers

nothing calls this directly

Calls 2

GetAPIMethod · 0.80
GetHandleMethod · 0.80

Tested by

no test coverage detected