mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Some Ops in EP directory instead of contrib_ops directory will require TunableOp. We will also need to add EP level session tuning options for it. So move those code all at once. Also remove duplicated utility functions.
30 lines
516 B
C++
30 lines
516 B
C++
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
#pragma once
|
|
|
|
#include <hip/hip_runtime.h>
|
|
#include <cstdlib>
|
|
#include <iostream>
|
|
|
|
namespace onnxruntime {
|
|
namespace rocm {
|
|
namespace tunable {
|
|
|
|
class Timer {
|
|
public:
|
|
explicit Timer(hipStream_t stream);
|
|
void Start();
|
|
void End();
|
|
float Duration();
|
|
~Timer();
|
|
|
|
private:
|
|
hipStream_t stream_;
|
|
hipEvent_t start_;
|
|
hipEvent_t end_;
|
|
};
|
|
|
|
} // namespace tunable
|
|
} // namespace rocm
|
|
} // namespace onnxruntime
|