onnxruntime/onnxruntime/core/providers/rocm/tunable/util.h
cloudhan a24b41d92e
Move all TunableOp related falicilities to EP level directory (#12857)
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.
2022-09-23 11:10:19 +08:00

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