Вопрос

Is there any way to profile the total number of arithmetic operations used in a certain C/C++ program? By arithmetic operations I mean any operation that uses the integer/floating/special arithmetic unit in hardware.

Это было полезно?

Решение

If it is on intel X86-64 architecture, I would suggest to use pin tools: PIN for Ubuntu. There has been a plug-in built, namely, MICA on top of it which can instrument independently. One of the 99 outputs is exactly "Floating-point". Look into "Arithmetic-control flows" and "SSE/MMX" as well since based on the compiler different registers are being used. This makes sure you are monitoring all floating points.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top