All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
faiss::gpu::KernelTimer Class Reference

Utility class for timing execution of a kernel. More...

`#include <Timer.h>`

## Public Member Functions

| KernelTimer (cudaStream_t stream=0)
| ~KernelTimer ()
| Destructor releases event resources.
float | elapsedMilliseconds ()

## Detailed Description

Utility class for timing execution of a kernel.

Definition at line 20 of file Timer.h.

## Constructor & Destructor Documentation

faiss::gpu::KernelTimer::KernelTimer | ( | cudaStream_t | stream = `0` | ) |

Constructor starts the timer and adds an event into the current device stream

Definition at line 18 of file Timer.cpp.

## Member Function Documentation

float faiss::gpu::KernelTimer::elapsedMilliseconds | ( |  | ) |

Adds a stop event then synchronizes on the stop event to get the actual GPU-side kernel timings for any kernels launched in the current stream. Returns the number of milliseconds elapsed. Can only be called once.

Definition at line 35 of file Timer.cpp.

The documentation for this class was generated from the following files:

- Timer.h
- Timer.cpp