Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
#error "Operating system not recognized"
#endif
#include <assert.h>
#ifndef AUDIOMARK_LOG_INFO
#define AUDIOMARK_LOG_INFO(fmt, ...) printf("[INFO] " fmt "\n", ##__VA_ARGS__)
#endif
#ifndef AUDIOMARK_LOG_ERROR
#define AUDIOMARK_LOG_ERROR(fmt, ...) printf("[ERROR] " fmt "\n", ##__VA_ARGS__)
#endif



Expand Down Expand Up @@ -85,15 +91,15 @@ main(void)
uint32_t iterations = 1;
uint64_t dt = 0;

printf("Initializing\n");
AUDIOMARK_LOG_INFO("Initializing");

if (ee_audiomark_initialize())
{
printf("Failed to initialize\n");
AUDIOMARK_LOG_ERROR("Failed to initialize");
return -1;
}

printf("Computing run speed\n");
AUDIOMARK_LOG_INFO("Computing run speed");

do
{
Expand All @@ -107,7 +113,7 @@ main(void)

if (err)
{
printf("Failed to compute iteration speed\n");
AUDIOMARK_LOG_ERROR("Failed to compute iteration speed");
goto exit;
}

Expand All @@ -116,12 +122,12 @@ main(void)
iterations = (uint32_t)((float)iterations * scale);
iterations = iterations < 10 ? 10 : iterations;

printf("Measuring\n");
AUDIOMARK_LOG_INFO("Measuring");

err = time_audiomark_run(iterations, &dt);
if (err)
{
printf("Failed main performance run\n");
AUDIOMARK_LOG_ERROR("Failed main performance run");
goto exit;
}

Expand All @@ -134,9 +140,9 @@ main(void)
float sec = (float)dt / 1.0e6f;
float score = (float)iterations / sec * 1000.f * (1.0f / 1.5f);

printf("Total runtime : %.3f seconds\n", sec);
printf("Total iterations : %d iterations\n", iterations);
printf("Score : %f AudioMarks\n", score);
AUDIOMARK_LOG_INFO("Total runtime : %.3f seconds", sec);
AUDIOMARK_LOG_INFO("Total iterations : %d iterations", iterations);
AUDIOMARK_LOG_INFO("Score : %f AudioMarks", score);
exit:
ee_audiomark_release();
return err ? -1 : 0;
Expand Down