llvm / llvm/llvm-project

[Offload] Add support for measuring elapsed time between events

Open
#185,728 1 comment 0 reactions 0 assignees View on GitHub
offload
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

The LLVM Offload API currently provides event objects that can be used for synchronization and completion tracking, but it does not appear to provide a way to measure elapsed time between two events, similar to `cudaEventElapsedTime` in CUDA.

For performance work, it is often important to measure kernel execution time directly from the device execution timeline rather than relying only on host-side timers around submission and synchronization calls.

### Requested feature

Add an API to measure elapsed time between two events recorded on a queue, for example something conceptually similar to:

```c
ol_result_t olGetEventElapsedTime(ol_event_handle_t Start,
ol_event_handle_t End,
float *Milliseconds);
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the LLVM Offload API's event declarations and existing event-related tests. Compare the requested behavior with CUDA's cudaEventElapsedTime and determine the semantics for two events recorded on a queue. Done means the API can report elapsed milliseconds between the start and end events.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
backend-api-design, compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.