Is your feature request related to a problem?
Currently the library can used for testing on Linux with x86_64 due to the code at
|
// Linux Target |
|
#include <x86intrin.h> |
|
#define dsp_get_cpu_cycle_count __rdtsc |
.
Describe the solution you'd like.
However, this could be easily adjusted to support other architectures by using some of the following:
- If the compiler is clang, it always has
__builtin_readcyclecounter() which works on any architecture that supports it (x86, ARM, etc). On x86_64 it is equivalent to __rdtsc().
- Using
PMCCNTR on most ARM architectures (but only under certain circumstances).
- Falling back to the vDSO
clock_gettime(CLOCK_MONOTONIC) which is slightly slower than __rdtsc() due to conversion to nanoseconds.
A very complete system is outlined at https://github.com/google/benchmark/blob/v1.1.0/src/cycleclock.h but that is likely overkill.
Another solution would be to disable all timing codes if necessary.
Describe alternatives you've considered.
I modified the dsp_common.h header myself to use __builtin_readcyclecounter() in my environment and to not include the intrinsics file (which is the real problem on other architectures).
Additional context.
No response
Is your feature request related to a problem?
Currently the library can used for testing on Linux with x86_64 due to the code at
esp-dsp/modules/common/include/dsp_common.h
Lines 86 to 88 in 3c12d05
Describe the solution you'd like.
However, this could be easily adjusted to support other architectures by using some of the following:
__builtin_readcyclecounter()which works on any architecture that supports it (x86, ARM, etc). On x86_64 it is equivalent to__rdtsc().PMCCNTRon most ARM architectures (but only under certain circumstances).clock_gettime(CLOCK_MONOTONIC)which is slightly slower than__rdtsc()due to conversion to nanoseconds.A very complete system is outlined at https://github.com/google/benchmark/blob/v1.1.0/src/cycleclock.h but that is likely overkill.
Another solution would be to disable all timing codes if necessary.
Describe alternatives you've considered.
I modified the
dsp_common.hheader myself to use__builtin_readcyclecounter()in my environment and to not include the intrinsics file (which is the real problem on other architectures).Additional context.
No response