Skip to content

Commit 170da74

Browse files
committed
Fix up
1 parent 91ec61a commit 170da74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libtorch.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2241,17 +2241,17 @@ float
22412241
ModelInstanceState::GetCudaEventElapsedTime(
22422242
const cudaEvent_t& start_event, const cudaEvent_t& end_event)
22432243
{
2244+
float duration = 0;
22442245
#ifdef TRITON_ENABLE_GPU
22452246
// [FIXME] in the case of cudaEventElapsedTime failure, should handle
22462247
// stats reporting more gracefully as the durations are inaccurate
2247-
float duration = 0;
22482248
LOG_IF_ERROR(
22492249
ConvertCUDAStatusToTritonError(
22502250
cudaEventElapsedTime(&duration, start_event, end_event),
22512251
TRITONSERVER_ERROR_INTERNAL, "Failed to capture elapsed time"),
22522252
"Failed to capture elapsed time");
2253-
return duration;
22542253
#endif
2254+
return duration;
22552255
}
22562256

22572257
/////////////

0 commit comments

Comments
 (0)