(self, iterations=1)
| 88 | raise RuntimeError(f"CUDA Error {str(err)}") |
| 89 | |
| 90 | def duration(self, iterations=1): |
| 91 | err, duration = cuda.cuEventElapsedTime(self.events[0], self.events[1]) |
| 92 | if err != cuda.CUresult.CUDA_SUCCESS: |
| 93 | raise RuntimeError(f"CUDA Error {str(err)}") |
| 94 | return duration / float(iterations) |
| 95 | |
| 96 | |
| 97 | class CUDAEventProfiler: |