Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions src/accuracy-cuda/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ int main(int argc, char* argv[])
int count;
cudaMemcpy(&count, d_count, sizeof(int), cudaMemcpyDeviceToHost);
printf("%s\n", (count == count_ref) ? "PASS" : "FAIL");
bool ok = (count == count_ref);
if (!ok) exit(1);

// printf("Accuracy = %f\n", (float)count / nrows);

start = std::chrono::steady_clock::now();
Expand All @@ -196,5 +199,6 @@ int main(int argc, char* argv[])
free(label);
free(data);

if (!ok) return 1;
return 0;
}
3 changes: 3 additions & 0 deletions src/accuracy-hip/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ int main(int argc, char* argv[])

int count;
hipMemcpy(&count, d_count, sizeof(int), hipMemcpyDeviceToHost);
bool ok = (count == count_ref);
if (!ok) exit(1);
printf("%s\n", (count == count_ref) ? "PASS" : "FAIL");
// printf("Accuracy = %f\n", (float)count / nrows);

Expand All @@ -196,5 +198,6 @@ int main(int argc, char* argv[])
free(label);
free(data);

if (!ok) return 1;
return 0;
}
1 change: 1 addition & 0 deletions src/accuracy-omp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,6 @@ int main(int argc, char* argv[])
free(label);
free(data);

if (!ok) return 1;
return 0;
}
2 changes: 2 additions & 0 deletions src/accuracy-sycl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ int main(int argc, char* argv[])

int count;
q.memcpy(&count, d_count, sizeof(int)).wait();
bool ok = (count == count_ref);
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The added ok declaration appears to be introduced with inconsistent indentation (tab) and may be scoped too narrowly (e.g., inside a loop/block) while being used later for the final exit status. Declare ok in the outer scope of main and assign to it (do not redeclare) so the final if (!ok) return 1; reliably reflects the verification result.

Copilot uses AI. Check for mistakes.
printf("%s\n", (count == count_ref) ? "PASS" : "FAIL");

// printf("Accuracy = %f\n", (float)count / nrows);
Expand Down Expand Up @@ -213,5 +214,6 @@ int main(int argc, char* argv[])
free(label);
free(data);

if (!ok) return 1;
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The added ok declaration appears to be introduced with inconsistent indentation (tab) and may be scoped too narrowly (e.g., inside a loop/block) while being used later for the final exit status. Declare ok in the outer scope of main and assign to it (do not redeclare) so the final if (!ok) return 1; reliably reflects the verification result.

Copilot uses AI. Check for mistakes.
return 0;
}
1 change: 1 addition & 0 deletions src/ace-cuda/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -444,5 +444,6 @@ int main(int argc, char *argv[])

free(phi_host);
free(u_host);
if (!ok) return 1;
return 0;
}
1 change: 1 addition & 0 deletions src/ace-hip/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -444,5 +444,6 @@ int main(int argc, char *argv[])

free(phi_host);
free(u_host);
if (!ok) return 1;
return 0;
}
1 change: 1 addition & 0 deletions src/ace-omp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,5 +427,6 @@ int main(int argc, char *argv[])
free(d_Fx);
free(d_Fy);
free(d_Fz);
if (!ok) return 1;
return 0;
}
1 change: 1 addition & 0 deletions src/ace-sycl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,5 +496,6 @@ int main(int argc, char *argv[])
free(phi_host);
free(u_host);

if (!ok) return 1;
return 0;
}
1 change: 1 addition & 0 deletions src/adam-cuda/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,6 @@ int main(int argc, char* argv[])
free(v);
free(g);
free(r);
if (!ok) return 1;
return 0;
}
1 change: 1 addition & 0 deletions src/adam-hip/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,6 @@ int main(int argc, char* argv[])
free(v);
free(g);
free(r);
if (!ok) return 1;
return 0;
}
1 change: 1 addition & 0 deletions src/adam-omp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,6 @@ int main(int argc, char* argv[])
free(v);
free(g);
free(r);
if (!ok) return 1;
return 0;
}
1 change: 1 addition & 0 deletions src/adam-sycl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,6 @@ int main(int argc, char* argv[])
free(v);
free(g);
free(r);
if (!ok) return 1;
return 0;
}
1 change: 1 addition & 0 deletions src/adamw-cuda/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,6 @@ int main(int argc, char* argv[])
free(v);
free(g);
free(r);
if (absmax_error > 1e-3f) return 1;
return 0;
}
1 change: 1 addition & 0 deletions src/adamw-hip/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,6 @@ int main(int argc, char* argv[])
free(v);
free(g);
free(r);
if (absmax_error > 1e-3f) return 1;
return 0;
}
1 change: 1 addition & 0 deletions src/adamw-omp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,6 @@ int main(int argc, char* argv[])
free(v);
free(g);
free(r);
if (absmax_error > 1e-3f) return 1;
return 0;
}
1 change: 1 addition & 0 deletions src/adamw-sycl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,6 @@ int main(int argc, char* argv[])
free(v);
free(g);
free(r);
if (absmax_error > 1e-3f) return 1;
return 0;
}
3 changes: 3 additions & 0 deletions src/adjacent-cuda/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <cstring>
#include <iostream>
#include <cub/cub.cuh>
#include <cstdlib>

//---------------------------------------------------------------------
// Kernels
Expand Down Expand Up @@ -184,5 +185,7 @@ int main(int argc, char** argv)
Test< 512>(nelems, repeat);
Test<1024>(nelems, repeat);

if (compare) return 1;
if (compare) return 1;
return 0;
}
3 changes: 3 additions & 0 deletions src/adjacent-hip/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <cstring>
#include <iostream>
#include <hipcub/hipcub.hpp>
#include <cstdlib>

//---------------------------------------------------------------------
// Kernels
Expand Down Expand Up @@ -184,5 +185,7 @@ int main(int argc, char** argv)
Test< 512>(nelems, repeat);
Test<1024>(nelems, repeat);

if (compare) return 1;
if (compare) return 1;
return 0;
}
3 changes: 3 additions & 0 deletions src/adjacent-omp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <cstring>
#include <iostream>
#include <omp.h>
#include <cstdlib>

/**
* Simple kernel for performing a block-wide adjacent difference.
Expand Down Expand Up @@ -149,5 +150,7 @@ int main(int argc, char** argv)
Test< 512>(nelems, repeat);
Test<1024>(nelems, repeat);

if (compare) return 1;
if (compare) return 1;
return 0;
}
3 changes: 3 additions & 0 deletions src/adjacent-sycl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <iostream>
#include <sycl/sycl.hpp>
#include "block.h"
#include <cstdlib>

//---------------------------------------------------------------------
// Kernels
Expand Down Expand Up @@ -205,5 +206,7 @@ int main(int argc, char** argv)
Test< 512>(q, nelems, repeat);
Test<1024>(q, nelems, repeat);

if (compare) return 1;
if (compare) return 1;
return 0;
}
2 changes: 2 additions & 0 deletions src/aidw-cuda/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -277,5 +277,7 @@ int main(int argc, char *argv[])
cudaFree(d_iy);
cudaFree(d_iz);
cudaFree(d_avg_dist);
if (!ok) return 1;
if (!ok) return 1;
return 0;
}
2 changes: 2 additions & 0 deletions src/aidw-hip/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -277,5 +277,7 @@ int main(int argc, char *argv[])
hipFree(d_iy);
hipFree(d_iz);
hipFree(d_avg_dist);
if (!ok) return 1;
if (!ok) return 1;
return 0;
}
2 changes: 2 additions & 0 deletions src/aidw-omp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,15 @@ int main(int argc, char *argv[])
if (check) {
bool ok = verify (iz.data(), h_iz.data(), inum, EPS);
printf("%s\n", ok ? "PASS" : "FAIL");
if (!ok) exit(1);
}

AIDW_Kernel_Tiled(d_dx, d_dy, d_dz, dnum, d_ix, d_iy, d_iz, inum, area, d_avg_dist);
#pragma omp target update from (d_iz[0:inum])
if (check) {
bool ok = verify (iz.data(), h_iz.data(), inum, EPS);
printf("%s\n", ok ? "PASS" : "FAIL");
if (!ok) exit(1);
}

auto start = std::chrono::steady_clock::now();
Expand Down
2 changes: 2 additions & 0 deletions src/aidw-sycl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,5 +355,7 @@ int main(int argc, char *argv[])
sycl::free(d_iz, q);
sycl::free(d_avg_dist, q);

if (!ok) return 1;
if (!ok) return 1;
return 0;
}
1 change: 1 addition & 0 deletions src/aligned-types-cuda/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ template<class TData> int runTest(
packedElementSize);

printf("\tTEST %s\n", flag ? "PASS" : "FAIL");
if (!flag) exit(1);

return !flag;
}
Expand Down
1 change: 1 addition & 0 deletions src/aligned-types-hip/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ template<class TData> int runTest(
packedElementSize);

printf("\tTEST %s\n", flag ? "PASS" : "FAIL");
if (!flag) exit(1);

return !flag;
}
Expand Down
1 change: 1 addition & 0 deletions src/aligned-types-omp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ template<class TData> int runTest(
packedElementSize);

printf("\tTEST %s\n", flag ? "PASS" : "FAIL");
if (!flag) exit(1);

return !flag;
}
Expand Down
1 change: 1 addition & 0 deletions src/aligned-types-sycl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ int runTest(
packedElementSize);

printf("\tTEST %s\n", flag ? "PASS" : "FAIL");
if (!flag) exit(1);

return !flag;
}
Expand Down
3 changes: 3 additions & 0 deletions src/all-pairs-distance-cuda/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ int main(int argc, char **argv) {
status = memcmp(cpu_distance, gpu_distance, INSTANCES * INSTANCES * sizeof(int));
if (status != 0) printf("FAIL\n");
else printf("PASS\n");
if (status != 0) exit(1);

elapsedTime = 0;
for (int n = 0; n < iterations; n++) {
Expand All @@ -290,6 +291,7 @@ int main(int argc, char **argv) {
status = memcmp(cpu_distance, gpu_distance, INSTANCES * INSTANCES * sizeof(int));
if (status != 0) printf("FAIL\n");
else printf("PASS\n");
if (status != 0) exit(1);

elapsedTime = 0;
for (int n = 0; n < iterations; n++) {
Expand All @@ -315,6 +317,7 @@ int main(int argc, char **argv) {
status = memcmp(cpu_distance, gpu_distance, INSTANCES * INSTANCES * sizeof(int));
if (status != 0) printf("FAIL\n");
else printf("PASS\n");
if (status != 0) exit(1);

free(cpu_distance);
free(gpu_distance);
Expand Down
3 changes: 3 additions & 0 deletions src/all-pairs-distance-hip/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ int main(int argc, char **argv) {
status = memcmp(cpu_distance, gpu_distance, INSTANCES * INSTANCES * sizeof(int));
if (status != 0) printf("FAIL\n");
else printf("PASS\n");
if (status != 0) exit(1);

elapsedTime = 0;
for (int n = 0; n < iterations; n++) {
Expand All @@ -290,6 +291,7 @@ int main(int argc, char **argv) {
status = memcmp(cpu_distance, gpu_distance, INSTANCES * INSTANCES * sizeof(int));
if (status != 0) printf("FAIL\n");
else printf("PASS\n");
if (status != 0) exit(1);

elapsedTime = 0;
for (int n = 0; n < iterations; n++) {
Expand All @@ -315,6 +317,7 @@ int main(int argc, char **argv) {
status = memcmp(cpu_distance, gpu_distance, INSTANCES * INSTANCES * sizeof(int));
if (status != 0) printf("FAIL\n");
else printf("PASS\n");
if (status != 0) exit(1);

free(cpu_distance);
free(gpu_distance);
Expand Down
2 changes: 2 additions & 0 deletions src/all-pairs-distance-omp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ int main(int argc, char **argv) {
status = memcmp(cpu_distance, gpu_distance, INSTANCES * INSTANCES * sizeof(int));
if (status != 0) printf("FAIL\n");
else printf("PASS\n");
if (status != 0) exit(1);

elapsedTime = 0;
for (int n = 0; n < iterations; n++) {
Expand Down Expand Up @@ -216,6 +217,7 @@ int main(int argc, char **argv) {
status = memcmp(cpu_distance, gpu_distance, INSTANCES * INSTANCES * sizeof(int));
if (status != 0) printf("FAIL\n");
else printf("PASS\n");
if (status != 0) exit(1);
}

free(cpu_distance);
Expand Down
3 changes: 3 additions & 0 deletions src/all-pairs-distance-sycl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ int main(int argc, char **argv) {
status = memcmp(cpu_distance, gpu_distance, INSTANCES * INSTANCES * sizeof(int));
if (status != 0) printf("FAIL\n");
else printf("PASS\n");
if (status != 0) exit(1);

elapsedTime = 0;
for (int n = 0; n < iterations; n++) {
Expand Down Expand Up @@ -244,6 +245,7 @@ int main(int argc, char **argv) {
status = memcmp(cpu_distance, gpu_distance, INSTANCES * INSTANCES * sizeof(int));
if (status != 0) printf("FAIL\n");
else printf("PASS\n");
if (status != 0) exit(1);

elapsedTime = 0;
for (int n = 0; n < iterations; n++) {
Expand Down Expand Up @@ -299,6 +301,7 @@ int main(int argc, char **argv) {
status = memcmp(cpu_distance, gpu_distance, INSTANCES * INSTANCES * sizeof(int));
if (status != 0) printf("FAIL\n");
else printf("PASS\n");
if (status != 0) exit(1);

free(cpu_distance);
free(gpu_distance);
Expand Down
2 changes: 1 addition & 1 deletion src/amgmk-cuda/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ LAUNCHER =
# Program name & source code list
#===============================================================================

program = AMGMk
program = main

source = csr_matrix.cu csr_matvec.cu hypre_error.cu hypre_memory.cu laplace.cu main.cu vector.cu

Expand Down
2 changes: 1 addition & 1 deletion src/amgmk-hip/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LAUNCHER =
# Program name & source code list
#===============================================================================

program = AMGMk
program = main

source = csr_matrix.cu csr_matvec.cu hypre_error.cu hypre_memory.cu laplace.cu main.cu vector.cu

Expand Down
2 changes: 1 addition & 1 deletion src/amgmk-hip/Makefile.hipcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DEBUG = no
# Program name & source code list
#===============================================================================

program = AMGMk
program = main

source = csr_matrix.cu csr_matvec.cu hypre_error.cu hypre_memory.cu laplace.cu main.cu vector.cu

Expand Down
2 changes: 1 addition & 1 deletion src/amgmk-omp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ LAUNCHER =
# Program name & source code list
#===============================================================================

program = AMGMk
program = main

source = csr_matrix.cpp csr_matvec.cpp hypre_error.cpp hypre_memory.cpp laplace.cpp main.cpp vector.cpp

Expand Down
Loading