MCPcopy
hub / github.com/dmlc/dgl / check_call

Function check_call

python/dgl/_ffi/base.py:58–70  ·  view source on GitHub ↗

Check the return value of C API call This function will raise exception when error occurs. Wrap every API call with this function Parameters ---------- ret : int return value from API calls

(ret)

Source from the content-addressed store, hash-verified

56# helper function in ctypes.
57# ----------------------------
58def check_call(ret):
59 """Check the return value of C API call
60
61 This function will raise exception when error occurs.
62 Wrap every API call with this function
63
64 Parameters
65 ----------
66 ret : int
67 return value from API calls
68 """
69 if ret != 0:
70 raise DGLError(py_str(_LIB.DGLGetLastError()))
71
72
73def c_str(string):

Callers 15

__del__Method · 0.85
get_functionMethod · 0.85
import_moduleMethod · 0.85
registerFunction · 0.85
get_global_funcFunction · 0.85
list_global_func_namesFunction · 0.85
__dir__Method · 0.85
syncMethod · 0.85
_dgl_get_streamFunction · 0.85
emptyFunction · 0.85
empty_shared_memFunction · 0.85
copyfromMethod · 0.85

Calls 1

DGLErrorClass · 0.85

Tested by

no test coverage detected