Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions quickstart/IntroNotebooks/onnx_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def predict(self, batch): # result gets copied into output
# transfer input data to device
err = cudart.cudaMemcpyAsync(
self.d_input, batch.ctypes.data, batch.nbytes, cudart.cudaMemcpyKind.cudaMemcpyHostToDevice, self.stream
)
)[0]
if err != cudart.cudaError_t.cudaSuccess:
raise RuntimeError(f"Failed to copy input to device: {cudart.cudaGetErrorString(err)}")

Expand All @@ -99,12 +99,12 @@ def predict(self, batch): # result gets copied into output
self.output.nbytes,
cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost,
self.stream,
)
)[0]
if err != cudart.cudaError_t.cudaSuccess:
raise RuntimeError(f"Failed to copy output from device: {cudart.cudaGetErrorString(err)}")

# synchronize threads
err = cudart.cudaStreamSynchronize(self.stream)
err = cudart.cudaStreamSynchronize(self.stream)[0]
if err != cudart.cudaError_t.cudaSuccess:
raise RuntimeError(f"Failed to synchronize stream: {cudart.cudaGetErrorString(err)}")

Expand Down