More changes.

This commit is contained in:
Alan Mishchenko 2024-03-02 16:57:00 -08:00
parent ce44eda85a
commit b627aa7cb5
1 changed files with 12 additions and 3 deletions

View File

@ -22,7 +22,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
#define Minisat_System_h #define Minisat_System_h
#if defined(__linux__) #if defined(__linux__)
#include <fpu_control.h> //#include <fpu_control.h>
#endif #endif
#include "sat/bsat2/IntTypes.h" #include "sat/bsat2/IntTypes.h"
@ -39,26 +39,35 @@ extern double memUsedPeak(); // Peak-memory in mega bytes (returns 0 for
} }
ABC_NAMESPACE_CXX_HEADER_END
//------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------
// Implementation of inline functions: // Implementation of inline functions:
#if defined(_MSC_VER) || defined(__MINGW32__) #if defined(_MSC_VER) || defined(__MINGW32__)
#include <time.h> #include <time.h>
ABC_NAMESPACE_CXX_HEADER_START
static inline double Minisat::cpuTime(void) { return (double)clock() / CLOCKS_PER_SEC; } static inline double Minisat::cpuTime(void) { return (double)clock() / CLOCKS_PER_SEC; }
ABC_NAMESPACE_CXX_HEADER_END
#else #else
#include <sys/time.h> #include <sys/time.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <unistd.h> #include <unistd.h>
ABC_NAMESPACE_CXX_HEADER_START
static inline double Minisat::cpuTime(void) { static inline double Minisat::cpuTime(void) {
struct rusage ru; struct rusage ru;
getrusage(RUSAGE_SELF, &ru); getrusage(RUSAGE_SELF, &ru);
return (double)ru.ru_utime.tv_sec + (double)ru.ru_utime.tv_usec / 1000000; } return (double)ru.ru_utime.tv_sec + (double)ru.ru_utime.tv_usec / 1000000; }
#endif
ABC_NAMESPACE_CXX_HEADER_END ABC_NAMESPACE_CXX_HEADER_END
#endif #endif
#endif