MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / check_cuda_err

Function check_cuda_err

samples/python/common.py:35–43  ·  view source on GitHub ↗
(err)

Source from the content-addressed store, hash-verified

33EXPLICIT_BATCH = 1 << (int)(trt.NetworkDefinitionCreationFlag.EXPLICIT_BATCH)
34
35def check_cuda_err(err):
36 if isinstance(err, cuda.CUresult):
37 if err != cuda.CUresult.CUDA_SUCCESS:
38 raise RuntimeError("Cuda Error: {}".format(err))
39 if isinstance(err, cudart.cudaError_t):
40 if err != cudart.cudaError_t.cudaSuccess:
41 raise RuntimeError("Cuda Runtime Error: {}".format(err))
42 else:
43 raise RuntimeError("Unknown error type: {}".format(err))
44
45def cuda_call(call):
46 err, res = call[0], call[1:]

Callers 1

cuda_callFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected