mirror of
https://github.com/asmjit/asmjit.git
synced 2025-12-18 13:04:36 +03:00
[ABI] Added ABI version as an inline namespace, which forms asmjit::_abi_MAJOR_MINOR
[ABI] Added support for AVX512_FP16, 16-bit broadcast, and AVX512_FP16 tests
[ABI] Added initial support for consecutive registers into instruction database and register allocator
[ABI] Added a possibility to use temporary memory in CodeHolder's zone
[ABI] Compiler::setArg() is now deprecated, use FuncNode::setArg()
[Bug] Fixed correct RW information of instructions that only support implicit zeroing with {k}
[Bug] Fixed broadcast to be able to broadcast bcst16 operands
42 lines
1010 B
C++
42 lines
1010 B
C++
// This file is part of AsmJit project <https://asmjit.com>
|
|
//
|
|
// See asmjit.h or LICENSE.md for license and copyright information
|
|
// SPDX-License-Identifier: Zlib
|
|
|
|
#ifndef PERFORMANCETIMER_H_INCLUDED
|
|
#define PERFORMANCETIMER_H_INCLUDED
|
|
|
|
#include <asmjit/core.h>
|
|
#include <chrono>
|
|
|
|
class PerformanceTimer {
|
|
public:
|
|
typedef std::chrono::high_resolution_clock::time_point TimePoint;
|
|
|
|
TimePoint _startTime {};
|
|
TimePoint _endTime {};
|
|
|
|
inline void start() {
|
|
_startTime = std::chrono::high_resolution_clock::now();
|
|
}
|
|
|
|
inline void stop() {
|
|
_endTime = std::chrono::high_resolution_clock::now();
|
|
}
|
|
|
|
inline double duration() const {
|
|
std::chrono::duration<double> elapsed = _endTime - _startTime;
|
|
return elapsed.count() * 1000;
|
|
}
|
|
};
|
|
|
|
static inline double mbps(double duration, uint64_t outputSize) noexcept {
|
|
if (duration == 0)
|
|
return 0.0;
|
|
|
|
double bytesTotal = double(outputSize);
|
|
return (bytesTotal * 1000) / (duration * 1024 * 1024);
|
|
}
|
|
|
|
#endif // PERFORMANCETIMER_H_INCLUDED
|