Skip to content

GPU timing functions #5

Description

@jrcccc

Just a suggestion on how to implement GPU kernel timing functions using Events:

cuda Event_t startTime, stopTime;
float timeInMs;
cudaEventCreate(&startTime);
cudaEventCreate(&stopTime);

And before / after every kernel launch:

cudaEventRecord(startTime);
launch_kernel<<<blablabla>>>(...);
cudaEventRecord(stopTime);


cudaEventSynchronize(stopTime);

cudaEventElapsedTime(&timeInMs, startTime, stopTime);

And of course equivalent hip functions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions