From fc45d201913daab53085d6fb7ba27e429172cbbd Mon Sep 17 00:00:00 2001 From: vinayak sharma Date: Sun, 18 Jan 2026 17:44:01 +0530 Subject: [PATCH 1/4] CI --- .github/workflow/build.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflow/build.yml diff --git a/.github/workflow/build.yml b/.github/workflow/build.yml new file mode 100644 index 00000000..d35d59bc --- /dev/null +++ b/.github/workflow/build.yml @@ -0,0 +1,21 @@ +name: Build AudioMark + +on: + push: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install dependencies + run: sudo apt-get install cmake gcc g++ + + - name: Configure + run: cmake -S . -B build + + - name: Build + run: cmake --build build From c7780013ce60db308aead00233d25bd6397b3810 Mon Sep 17 00:00:00 2001 From: vinayak sharma Date: Sun, 18 Jan 2026 19:11:46 +0530 Subject: [PATCH 2/4] ci --- .github/workflow/build.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflow/build.yml b/.github/workflow/build.yml index d35d59bc..33a12cf0 100644 --- a/.github/workflow/build.yml +++ b/.github/workflow/build.yml @@ -1,4 +1,4 @@ -name: Build AudioMark +name: AudioMark CI on: push: @@ -9,13 +9,17 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout repo + uses: actions/checkout@v3 - - name: Install dependencies - run: sudo apt-get install cmake gcc g++ + - name: Install dependencies + run: sudo apt-get update && sudo apt-get install -y cmake gcc g++ - - name: Configure - run: cmake -S . -B build + - name: Configure project + run: cmake -S . -B build - - name: Build - run: cmake --build build + - name: Build project + run: cmake --build build + + - name: Run Tests + run: ctest --test-dir build From f93b55baeff18cdbcb40ba3baff983161bbd0e91 Mon Sep 17 00:00:00 2001 From: vinayak sharma Date: Sun, 1 Feb 2026 17:44:04 +0530 Subject: [PATCH 3/4] Refactor: replace printf with logging macros --- .github/workflow/build.yml | 25 ------------------------- main.c | 20 +++++++++++--------- 2 files changed, 11 insertions(+), 34 deletions(-) delete mode 100644 .github/workflow/build.yml diff --git a/.github/workflow/build.yml b/.github/workflow/build.yml deleted file mode 100644 index 33a12cf0..00000000 --- a/.github/workflow/build.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: AudioMark CI - -on: - push: - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y cmake gcc g++ - - - name: Configure project - run: cmake -S . -B build - - - name: Build project - run: cmake --build build - - - name: Run Tests - run: ctest --test-dir build diff --git a/main.c b/main.c index c5465c4a..a39ecf36 100755 --- a/main.c +++ b/main.c @@ -31,6 +31,8 @@ #error "Operating system not recognized" #endif #include +#define LOG_INFO(fmt, ...) printf("[INFO] " fmt "\n", ##__VA_ARGS__) +#define LOG_ERROR(fmt, ...) printf("[ERROR] " fmt "\n", ##__VA_ARGS__) @@ -85,15 +87,15 @@ main(void) uint32_t iterations = 1; uint64_t dt = 0; - printf("Initializing\n"); + LOG_INFO("Initializing"); if (ee_audiomark_initialize()) { - printf("Failed to initialize\n"); + LOG_ERROR("Failed to initialize"); return -1; } - printf("Computing run speed\n"); + LOG_INFO("Computing run speed"); do { @@ -107,7 +109,7 @@ main(void) if (err) { - printf("Failed to compute iteration speed\n"); + LOG_ERROR("Failed to compute iteration speed"); goto exit; } @@ -116,12 +118,12 @@ main(void) iterations = (uint32_t)((float)iterations * scale); iterations = iterations < 10 ? 10 : iterations; - printf("Measuring\n"); + LOG_INFO("Measuring"); err = time_audiomark_run(iterations, &dt); if (err) { - printf("Failed main performance run\n"); + LOG_ERROR("Failed main performance run"); goto exit; } @@ -134,9 +136,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); + LOG_INFO("Total runtime : %.3f seconds", sec); + LOG_INFO("Total iterations : %d iterations", iterations); + LOG_INFO("Score : %f AudioMarks", score); exit: ee_audiomark_release(); return err ? -1 : 0; From 7f581de867c7ca099a1cc6877c273e7b6bb9970b Mon Sep 17 00:00:00 2001 From: vinayak sharma Date: Tue, 3 Feb 2026 16:46:23 +0530 Subject: [PATCH 4/4] m --- main.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/main.c b/main.c index a39ecf36..dbe722a9 100755 --- a/main.c +++ b/main.c @@ -31,8 +31,12 @@ #error "Operating system not recognized" #endif #include -#define LOG_INFO(fmt, ...) printf("[INFO] " fmt "\n", ##__VA_ARGS__) -#define LOG_ERROR(fmt, ...) printf("[ERROR] " fmt "\n", ##__VA_ARGS__) +#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 @@ -87,15 +91,15 @@ main(void) uint32_t iterations = 1; uint64_t dt = 0; - LOG_INFO("Initializing"); + AUDIOMARK_LOG_INFO("Initializing"); if (ee_audiomark_initialize()) { - LOG_ERROR("Failed to initialize"); + AUDIOMARK_LOG_ERROR("Failed to initialize"); return -1; } - LOG_INFO("Computing run speed"); + AUDIOMARK_LOG_INFO("Computing run speed"); do { @@ -109,7 +113,7 @@ main(void) if (err) { - LOG_ERROR("Failed to compute iteration speed"); + AUDIOMARK_LOG_ERROR("Failed to compute iteration speed"); goto exit; } @@ -118,12 +122,12 @@ main(void) iterations = (uint32_t)((float)iterations * scale); iterations = iterations < 10 ? 10 : iterations; - LOG_INFO("Measuring"); + AUDIOMARK_LOG_INFO("Measuring"); err = time_audiomark_run(iterations, &dt); if (err) { - LOG_ERROR("Failed main performance run"); + AUDIOMARK_LOG_ERROR("Failed main performance run"); goto exit; } @@ -136,9 +140,9 @@ main(void) float sec = (float)dt / 1.0e6f; float score = (float)iterations / sec * 1000.f * (1.0f / 1.5f); - LOG_INFO("Total runtime : %.3f seconds", sec); - LOG_INFO("Total iterations : %d iterations", iterations); - LOG_INFO("Score : %f AudioMarks", 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;