diff --git a/src/accuracy-cuda/main.cu b/src/accuracy-cuda/main.cu index 51071c0fc0..db28968de8 100644 --- a/src/accuracy-cuda/main.cu +++ b/src/accuracy-cuda/main.cu @@ -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(); @@ -196,5 +199,6 @@ int main(int argc, char* argv[]) free(label); free(data); + if (!ok) return 1; return 0; } diff --git a/src/accuracy-hip/main.cu b/src/accuracy-hip/main.cu index d2b55e4740..c48371005b 100644 --- a/src/accuracy-hip/main.cu +++ b/src/accuracy-hip/main.cu @@ -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); @@ -196,5 +198,6 @@ int main(int argc, char* argv[]) free(label); free(data); + if (!ok) return 1; return 0; } diff --git a/src/accuracy-omp/main.cpp b/src/accuracy-omp/main.cpp index 2ffb61da87..bc79c38253 100644 --- a/src/accuracy-omp/main.cpp +++ b/src/accuracy-omp/main.cpp @@ -87,5 +87,6 @@ int main(int argc, char* argv[]) free(label); free(data); + if (!ok) return 1; return 0; } diff --git a/src/accuracy-sycl/main.cpp b/src/accuracy-sycl/main.cpp index ded2b775b9..ae31bbcff6 100644 --- a/src/accuracy-sycl/main.cpp +++ b/src/accuracy-sycl/main.cpp @@ -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); printf("%s\n", (count == count_ref) ? "PASS" : "FAIL"); // printf("Accuracy = %f\n", (float)count / nrows); @@ -213,5 +214,6 @@ int main(int argc, char* argv[]) free(label); free(data); + if (!ok) return 1; return 0; } diff --git a/src/ace-cuda/main.cu b/src/ace-cuda/main.cu index 3d06a3e740..3b8c1d9112 100644 --- a/src/ace-cuda/main.cu +++ b/src/ace-cuda/main.cu @@ -444,5 +444,6 @@ int main(int argc, char *argv[]) free(phi_host); free(u_host); + if (!ok) return 1; return 0; } diff --git a/src/ace-hip/main.cu b/src/ace-hip/main.cu index 82780d2766..9c110c4835 100644 --- a/src/ace-hip/main.cu +++ b/src/ace-hip/main.cu @@ -444,5 +444,6 @@ int main(int argc, char *argv[]) free(phi_host); free(u_host); + if (!ok) return 1; return 0; } diff --git a/src/ace-omp/main.cpp b/src/ace-omp/main.cpp index f94a973096..bbfd5afcda 100644 --- a/src/ace-omp/main.cpp +++ b/src/ace-omp/main.cpp @@ -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; } diff --git a/src/ace-sycl/main.cpp b/src/ace-sycl/main.cpp index 72ed3a42af..f2eb6be5a2 100644 --- a/src/ace-sycl/main.cpp +++ b/src/ace-sycl/main.cpp @@ -496,5 +496,6 @@ int main(int argc, char *argv[]) free(phi_host); free(u_host); + if (!ok) return 1; return 0; } diff --git a/src/adam-cuda/main.cu b/src/adam-cuda/main.cu index ada91a2a52..3fe524d5fe 100644 --- a/src/adam-cuda/main.cu +++ b/src/adam-cuda/main.cu @@ -159,5 +159,6 @@ int main(int argc, char* argv[]) free(v); free(g); free(r); + if (!ok) return 1; return 0; } diff --git a/src/adam-hip/main.cu b/src/adam-hip/main.cu index efcdd20b8c..2f50341ef6 100644 --- a/src/adam-hip/main.cu +++ b/src/adam-hip/main.cu @@ -159,5 +159,6 @@ int main(int argc, char* argv[]) free(v); free(g); free(r); + if (!ok) return 1; return 0; } diff --git a/src/adam-omp/main.cpp b/src/adam-omp/main.cpp index d38b7782ae..7d2daf5969 100644 --- a/src/adam-omp/main.cpp +++ b/src/adam-omp/main.cpp @@ -133,5 +133,6 @@ int main(int argc, char* argv[]) free(v); free(g); free(r); + if (!ok) return 1; return 0; } diff --git a/src/adam-sycl/main.cpp b/src/adam-sycl/main.cpp index dd822f4f7f..da7f3fc493 100644 --- a/src/adam-sycl/main.cpp +++ b/src/adam-sycl/main.cpp @@ -172,5 +172,6 @@ int main(int argc, char* argv[]) free(v); free(g); free(r); + if (!ok) return 1; return 0; } diff --git a/src/adamw-cuda/main.cu b/src/adamw-cuda/main.cu index 3ac5eb55ac..53b63070b6 100644 --- a/src/adamw-cuda/main.cu +++ b/src/adamw-cuda/main.cu @@ -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; } diff --git a/src/adamw-hip/main.cu b/src/adamw-hip/main.cu index 0f3adf01ac..0108e91621 100644 --- a/src/adamw-hip/main.cu +++ b/src/adamw-hip/main.cu @@ -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; } diff --git a/src/adamw-omp/main.cpp b/src/adamw-omp/main.cpp index d0c15ae250..0d9151c637 100644 --- a/src/adamw-omp/main.cpp +++ b/src/adamw-omp/main.cpp @@ -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; } diff --git a/src/adamw-sycl/main.cpp b/src/adamw-sycl/main.cpp index 5500bc1e60..8b57f80d11 100644 --- a/src/adamw-sycl/main.cpp +++ b/src/adamw-sycl/main.cpp @@ -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; } diff --git a/src/adjacent-cuda/main.cu b/src/adjacent-cuda/main.cu index debfeda46f..4e7e8ca646 100644 --- a/src/adjacent-cuda/main.cu +++ b/src/adjacent-cuda/main.cu @@ -30,6 +30,7 @@ #include #include #include +#include //--------------------------------------------------------------------- // Kernels @@ -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; } diff --git a/src/adjacent-hip/main.cu b/src/adjacent-hip/main.cu index 2b3c7e2b94..3ce0b8680e 100644 --- a/src/adjacent-hip/main.cu +++ b/src/adjacent-hip/main.cu @@ -30,6 +30,7 @@ #include #include #include +#include //--------------------------------------------------------------------- // Kernels @@ -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; } diff --git a/src/adjacent-omp/main.cpp b/src/adjacent-omp/main.cpp index d9c2fe525e..8b96b62f00 100644 --- a/src/adjacent-omp/main.cpp +++ b/src/adjacent-omp/main.cpp @@ -30,6 +30,7 @@ #include #include #include +#include /** * Simple kernel for performing a block-wide adjacent difference. @@ -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; } diff --git a/src/adjacent-sycl/main.cpp b/src/adjacent-sycl/main.cpp index 8baf1cd372..9011b26fa5 100644 --- a/src/adjacent-sycl/main.cpp +++ b/src/adjacent-sycl/main.cpp @@ -31,6 +31,7 @@ #include #include #include "block.h" +#include //--------------------------------------------------------------------- // Kernels @@ -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; } diff --git a/src/aidw-cuda/main.cu b/src/aidw-cuda/main.cu index ffb8bd1ea5..bbc321099a 100644 --- a/src/aidw-cuda/main.cu +++ b/src/aidw-cuda/main.cu @@ -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; } diff --git a/src/aidw-hip/main.cu b/src/aidw-hip/main.cu index 7938536e3b..02dc2c257c 100644 --- a/src/aidw-hip/main.cu +++ b/src/aidw-hip/main.cu @@ -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; } diff --git a/src/aidw-omp/main.cpp b/src/aidw-omp/main.cpp index 18d292b134..29cc761db4 100644 --- a/src/aidw-omp/main.cpp +++ b/src/aidw-omp/main.cpp @@ -229,6 +229,7 @@ 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); @@ -236,6 +237,7 @@ 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); } auto start = std::chrono::steady_clock::now(); diff --git a/src/aidw-sycl/main.cpp b/src/aidw-sycl/main.cpp index be1e708b6c..b07c151677 100644 --- a/src/aidw-sycl/main.cpp +++ b/src/aidw-sycl/main.cpp @@ -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; } diff --git a/src/aligned-types-cuda/main.cu b/src/aligned-types-cuda/main.cu index e0274784a3..26f5ca8eb8 100644 --- a/src/aligned-types-cuda/main.cu +++ b/src/aligned-types-cuda/main.cu @@ -242,6 +242,7 @@ template int runTest( packedElementSize); printf("\tTEST %s\n", flag ? "PASS" : "FAIL"); + if (!flag) exit(1); return !flag; } diff --git a/src/aligned-types-hip/main.cu b/src/aligned-types-hip/main.cu index 5a519b1085..35de20a602 100644 --- a/src/aligned-types-hip/main.cu +++ b/src/aligned-types-hip/main.cu @@ -242,6 +242,7 @@ template int runTest( packedElementSize); printf("\tTEST %s\n", flag ? "PASS" : "FAIL"); + if (!flag) exit(1); return !flag; } diff --git a/src/aligned-types-omp/main.cpp b/src/aligned-types-omp/main.cpp index 77b8693aa2..9e1485bca0 100644 --- a/src/aligned-types-omp/main.cpp +++ b/src/aligned-types-omp/main.cpp @@ -219,6 +219,7 @@ template int runTest( packedElementSize); printf("\tTEST %s\n", flag ? "PASS" : "FAIL"); + if (!flag) exit(1); return !flag; } diff --git a/src/aligned-types-sycl/main.cpp b/src/aligned-types-sycl/main.cpp index 0d06ca32f4..a29ad5d41e 100644 --- a/src/aligned-types-sycl/main.cpp +++ b/src/aligned-types-sycl/main.cpp @@ -243,6 +243,7 @@ int runTest( packedElementSize); printf("\tTEST %s\n", flag ? "PASS" : "FAIL"); + if (!flag) exit(1); return !flag; } diff --git a/src/all-pairs-distance-cuda/main.cu b/src/all-pairs-distance-cuda/main.cu index 575c7244e9..d5976e499e 100644 --- a/src/all-pairs-distance-cuda/main.cu +++ b/src/all-pairs-distance-cuda/main.cu @@ -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++) { @@ -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++) { @@ -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); diff --git a/src/all-pairs-distance-hip/main.cu b/src/all-pairs-distance-hip/main.cu index 9f7adc927b..f3421fb0f8 100644 --- a/src/all-pairs-distance-hip/main.cu +++ b/src/all-pairs-distance-hip/main.cu @@ -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++) { @@ -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++) { @@ -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); diff --git a/src/all-pairs-distance-omp/main.cpp b/src/all-pairs-distance-omp/main.cpp index 5ab508818a..51e40f0e44 100644 --- a/src/all-pairs-distance-omp/main.cpp +++ b/src/all-pairs-distance-omp/main.cpp @@ -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++) { @@ -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); diff --git a/src/all-pairs-distance-sycl/main.cpp b/src/all-pairs-distance-sycl/main.cpp index 6ef741ca67..c17dfebdcb 100644 --- a/src/all-pairs-distance-sycl/main.cpp +++ b/src/all-pairs-distance-sycl/main.cpp @@ -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++) { @@ -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++) { @@ -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); diff --git a/src/amgmk-cuda/Makefile b/src/amgmk-cuda/Makefile index 7de109d987..3d626218f0 100644 --- a/src/amgmk-cuda/Makefile +++ b/src/amgmk-cuda/Makefile @@ -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 diff --git a/src/amgmk-hip/Makefile b/src/amgmk-hip/Makefile index 0f0931282f..8d95b82694 100644 --- a/src/amgmk-hip/Makefile +++ b/src/amgmk-hip/Makefile @@ -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 diff --git a/src/amgmk-hip/Makefile.hipcl b/src/amgmk-hip/Makefile.hipcl index c35a0a720c..a80f7b4d47 100644 --- a/src/amgmk-hip/Makefile.hipcl +++ b/src/amgmk-hip/Makefile.hipcl @@ -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 diff --git a/src/amgmk-omp/Makefile b/src/amgmk-omp/Makefile index 77dcb866c9..4491d99d60 100644 --- a/src/amgmk-omp/Makefile +++ b/src/amgmk-omp/Makefile @@ -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 diff --git a/src/amgmk-omp/Makefile.aomp b/src/amgmk-omp/Makefile.aomp index d8eba4cf82..ca21bc3146 100644 --- a/src/amgmk-omp/Makefile.aomp +++ b/src/amgmk-omp/Makefile.aomp @@ -14,7 +14,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 diff --git a/src/amgmk-omp/Makefile.nvc b/src/amgmk-omp/Makefile.nvc index 7ba7b38d82..6157b2274e 100644 --- a/src/amgmk-omp/Makefile.nvc +++ b/src/amgmk-omp/Makefile.nvc @@ -14,7 +14,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 diff --git a/src/amgmk-sycl/Makefile b/src/amgmk-sycl/Makefile index e322a1435a..53e2aa9984 100644 --- a/src/amgmk-sycl/Makefile +++ b/src/amgmk-sycl/Makefile @@ -19,7 +19,7 @@ HIP_ARCH = gfx908 # 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 diff --git a/src/amgmk-sycl/Makefile.hipsycl b/src/amgmk-sycl/Makefile.hipsycl index 47122134f1..e3d5f0171f 100644 --- a/src/amgmk-sycl/Makefile.hipsycl +++ b/src/amgmk-sycl/Makefile.hipsycl @@ -15,7 +15,7 @@ DEVICE = gpu # 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 diff --git a/src/aobench-hip/Makefile.hipcl b/src/aobench-hip/Makefile.hipcl index 68031e5ab4..91498d8dd5 100644 --- a/src/aobench-hip/Makefile.hipcl +++ b/src/aobench-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = ao +program = main source = ao.cu diff --git a/src/aobench-sycl/Makefile.hipsycl b/src/aobench-sycl/Makefile.hipsycl index ad13cbc8cc..16b6e39b81 100644 --- a/src/aobench-sycl/Makefile.hipsycl +++ b/src/aobench-sycl/Makefile.hipsycl @@ -14,7 +14,7 @@ DEVICE = gpu # Program name & source code list #=============================================================================== -program = ao +program = main source = ao.cpp diff --git a/src/asmooth-cuda/reference.h b/src/asmooth-cuda/reference.h index d766e3ad60..6e6d3b0092 100644 --- a/src/asmooth-cuda/reference.h +++ b/src/asmooth-cuda/reference.h @@ -91,6 +91,7 @@ void verify ( } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); if (ok) { printf("Distribution of box sizes:\n"); for (int j = 1; j < MaxRad; j++) diff --git a/src/asta-cuda/main.cu b/src/asta-cuda/main.cu index 99ca6c1231..e819ae5a7f 100644 --- a/src/asta-cuda/main.cu +++ b/src/asta-cuda/main.cu @@ -43,6 +43,7 @@ #include "support/common.h" #include "support/verify.h" +#include // GPU kernel __global__ void PTTWAC_soa_asta(const int A, @@ -294,5 +295,6 @@ int main(int argc, char **argv) { cudaFree(d_finished); cudaFree(d_head); + if (!(status == 0)) return 1; return 0; } diff --git a/src/asta-hip/main.cu b/src/asta-hip/main.cu index 91b5518894..4f236f2308 100644 --- a/src/asta-hip/main.cu +++ b/src/asta-hip/main.cu @@ -43,6 +43,7 @@ #include "support/common.h" #include "support/verify.h" +#include // GPU kernel __global__ void PTTWAC_soa_asta(const int A, @@ -294,5 +295,6 @@ int main(int argc, char **argv) { hipFree(d_finished); hipFree(d_head); + if (!(status == 0)) return 1; return 0; } diff --git a/src/asta-omp/main.cpp b/src/asta-omp/main.cpp index d0397a925f..9fb463a8ee 100644 --- a/src/asta-omp/main.cpp +++ b/src/asta-omp/main.cpp @@ -43,6 +43,7 @@ #include "support/common.h" #include "support/verify.h" +#include // Params --------------------------------------------------------------------- @@ -293,5 +294,6 @@ int main(int argc, char **argv) { free(h_head); free(h_in_backup); + if (!(status == 0)) return 1; return 0; } diff --git a/src/asta-sycl/main.cpp b/src/asta-sycl/main.cpp index fcade1d97e..b9ffae822f 100644 --- a/src/asta-sycl/main.cpp +++ b/src/asta-sycl/main.cpp @@ -43,6 +43,7 @@ #include "support/common.h" #include "support/verify.h" +#include // Params --------------------------------------------------------------------- @@ -308,5 +309,6 @@ int main(int argc, char **argv) { sycl::free(d_in_out, q); sycl::free(d_finished, q); sycl::free(d_head, q); + if (!(status == 0)) return 1; return 0; } diff --git a/src/atomicAggregate-cuda/main.cu b/src/atomicAggregate-cuda/main.cu index 01c50629ca..2b65782028 100644 --- a/src/atomicAggregate-cuda/main.cu +++ b/src/atomicAggregate-cuda/main.cu @@ -1,6 +1,7 @@ #include #include #include +#include // reference // https://stackoverflow.com/questions/59879285/whats-the-alternative-for-match-any-sync-on-compute-capability-6 @@ -75,5 +76,6 @@ int main(int argc, char* argv[]) { cudaFree(d_d); delete [] h_d; } + if (!ok) return 1; return 0; } diff --git a/src/atomicAggregate-hip/main.cu b/src/atomicAggregate-hip/main.cu index e1698403c2..d87170d526 100644 --- a/src/atomicAggregate-hip/main.cu +++ b/src/atomicAggregate-hip/main.cu @@ -1,6 +1,7 @@ #include #include #include +#include // reference // https://stackoverflow.com/questions/59879285/whats-the-alternative-for-match-any-sync-on-compute-capability-6 @@ -109,5 +110,6 @@ int main(int argc, char* argv[]) { hipFree(d_d); delete [] h_d; } + if (!ok) return 1; return 0; } diff --git a/src/atomicAggregate-sycl/main.cpp b/src/atomicAggregate-sycl/main.cpp index e69fe241f4..7353f18b2d 100644 --- a/src/atomicAggregate-sycl/main.cpp +++ b/src/atomicAggregate-sycl/main.cpp @@ -1,6 +1,7 @@ #include #include #include +#include // reference // https://stackoverflow.com/questions/59879285/whats-the-alternative-for-match-any-sync-on-compute-capability-6 @@ -142,5 +143,6 @@ int main(int argc, char *argv[]) { sycl::free(d_d, q); delete [] h_d; } + if (!ok) return 1; return 0; } diff --git a/src/atomicCAS-cuda/main.cu b/src/atomicCAS-cuda/main.cu index 794b9b6763..a5f4bf105c 100644 --- a/src/atomicCAS-cuda/main.cu +++ b/src/atomicCAS-cuda/main.cu @@ -129,5 +129,6 @@ int main(int argc, char** argv) { cudaFree(d_res_u64); cudaFree(d_res_s64); cudaFree(d_res_f64); + if (error) return 1; return 0; } diff --git a/src/atomicCAS-hip/main.cu b/src/atomicCAS-hip/main.cu index f89e54c543..cf21d138ad 100644 --- a/src/atomicCAS-hip/main.cu +++ b/src/atomicCAS-hip/main.cu @@ -129,5 +129,6 @@ int main(int argc, char** argv) { hipFree(d_res_u64); hipFree(d_res_s64); hipFree(d_res_f64); + if (error) return 1; return 0; } diff --git a/src/atomicCAS-sycl/main.cpp b/src/atomicCAS-sycl/main.cpp index 4ca7e184c1..13f7acf80c 100644 --- a/src/atomicCAS-sycl/main.cpp +++ b/src/atomicCAS-sycl/main.cpp @@ -218,5 +218,6 @@ int main(int argc, char** argv) { sycl::free(d_res_s64, q); sycl::free(d_res_f64, q); + if (error) return 1; return 0; } diff --git a/src/atomicCost-cuda/main.cu b/src/atomicCost-cuda/main.cu index d6faa56a5a..9b4aef4a30 100644 --- a/src/atomicCost-cuda/main.cu +++ b/src/atomicCost-cuda/main.cu @@ -114,5 +114,6 @@ int main(int argc, char* argv[]) printf("\nFP32 atomic add\n"); atomicCost(length, nelems, repeat); + if (diff) return 1; return 0; } diff --git a/src/atomicCost-hip/main.cu b/src/atomicCost-hip/main.cu index 1c6b5345f8..004441fca8 100644 --- a/src/atomicCost-hip/main.cu +++ b/src/atomicCost-hip/main.cu @@ -114,5 +114,6 @@ int main(int argc, char* argv[]) printf("\nFP32 atomic add\n"); atomicCost(length, nelems, repeat); + if (diff) return 1; return 0; } diff --git a/src/atomicCost-omp/main.cpp b/src/atomicCost-omp/main.cpp index feb7aa938f..969c1a9c76 100644 --- a/src/atomicCost-omp/main.cpp +++ b/src/atomicCost-omp/main.cpp @@ -103,5 +103,6 @@ int main(int argc, char* argv[]) printf("\nFP32 atomic add\n"); atomicCost(length, nelems, repeat); + if (diff) return 1; return 0; } diff --git a/src/atomicCost-sycl/main.cpp b/src/atomicCost-sycl/main.cpp index b9b2209ca7..c871d55c65 100644 --- a/src/atomicCost-sycl/main.cpp +++ b/src/atomicCost-sycl/main.cpp @@ -133,5 +133,6 @@ int main(int argc, char* argv[]) printf("\nFP32 atomic add\n"); atomicCost(length, nelems, repeat); + if (diff) return 1; return 0; } diff --git a/src/atomicIntrinsics-cuda/reference.h b/src/atomicIntrinsics-cuda/reference.h index 935178b2b8..2c7e5e56b5 100644 --- a/src/atomicIntrinsics-cuda/reference.h +++ b/src/atomicIntrinsics-cuda/reference.h @@ -128,4 +128,5 @@ void computeGold(T *gpuData, const size_t len) } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } diff --git a/src/atomicPerf-cuda/main.cu b/src/atomicPerf-cuda/main.cu index 5cf7522e84..24ce032395 100644 --- a/src/atomicPerf-cuda/main.cu +++ b/src/atomicPerf-cuda/main.cu @@ -236,5 +236,11 @@ int main(int argc, char* argv[]) printf("\nFP32 atomic add\n"); atomicPerf(n, len, repeat); + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; return 0; } diff --git a/src/atomicPerf-hip/main.cu b/src/atomicPerf-hip/main.cu index 299070a219..991df97048 100644 --- a/src/atomicPerf-hip/main.cu +++ b/src/atomicPerf-hip/main.cu @@ -236,5 +236,11 @@ int main(int argc, char* argv[]) printf("\nFP32 atomic add\n"); atomicPerf(n, len, repeat); + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; return 0; } diff --git a/src/atomicPerf-omp/main.cpp b/src/atomicPerf-omp/main.cpp index 75083a83a2..3bb776785a 100644 --- a/src/atomicPerf-omp/main.cpp +++ b/src/atomicPerf-omp/main.cpp @@ -252,5 +252,11 @@ int main(int argc, char* argv[]) printf("\nFP32 atomic add\n"); atomicPerf(n, len, repeat); + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; return 0; } diff --git a/src/atomicPerf-sycl/main.cpp b/src/atomicPerf-sycl/main.cpp index 01bbb1a6fd..9e84b3472a 100644 --- a/src/atomicPerf-sycl/main.cpp +++ b/src/atomicPerf-sycl/main.cpp @@ -286,5 +286,11 @@ int main(int argc, char* argv[]) printf("\nFP32 atomic add\n"); atomicPerf(n, len, repeat); + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; return 0; } diff --git a/src/atomicReduction-hip/Makefile.hipcl b/src/atomicReduction-hip/Makefile.hipcl index cd8b0fcbb5..0e7f38b973 100644 --- a/src/atomicReduction-hip/Makefile.hipcl +++ b/src/atomicReduction-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = reduction +program = main source = reduction.cu diff --git a/src/atomicReduction-sycl/Makefile.hipsycl b/src/atomicReduction-sycl/Makefile.hipsycl index 7e73b0f167..067ca8908d 100644 --- a/src/atomicReduction-sycl/Makefile.hipsycl +++ b/src/atomicReduction-sycl/Makefile.hipsycl @@ -16,7 +16,7 @@ ROCM_DEVICE_LIB = -nogpulib \ # Program name & source code list #=============================================================================== -program = reduction +program = main source = reduction.cpp diff --git a/src/attention-cuda/main.cu b/src/attention-cuda/main.cu index 51abb62433..722230c259 100644 --- a/src/attention-cuda/main.cu +++ b/src/attention-cuda/main.cu @@ -171,5 +171,6 @@ int main(int argc, char* argv[]) { free(query); free(dout); free(hout); + if (!ok) return 1; return 0; } diff --git a/src/attention-hip/main.cu b/src/attention-hip/main.cu index bf13062788..ab1c209318 100644 --- a/src/attention-hip/main.cu +++ b/src/attention-hip/main.cu @@ -184,5 +184,6 @@ int main(int argc, char* argv[]) { free(query); free(dout); free(hout); + if (!ok) return 1; return 0; } diff --git a/src/attention-omp/main.cpp b/src/attention-omp/main.cpp index e3601f8d9f..7c6fdcfd94 100644 --- a/src/attention-omp/main.cpp +++ b/src/attention-omp/main.cpp @@ -107,5 +107,6 @@ int main(int argc, char* argv[]) { free(query); free(dout); free(hout); + if (!ok) return 1; return 0; } diff --git a/src/attention-paged-cuda/main.cu b/src/attention-paged-cuda/main.cu index 5fd6fb0875..62ebafa317 100644 --- a/src/attention-paged-cuda/main.cu +++ b/src/attention-paged-cuda/main.cu @@ -24,6 +24,7 @@ #include "attention_kernels.cuh" #include "kvcache.h" #include "reference.h" +#include #define LAUNCH_PAGED_ATTENTION_V1(HEAD_SIZE) \ @@ -342,5 +343,6 @@ int main(int argc, char* argv[]) attention_page<__nv_bfloat16, 32>(num_seqs, num_query_heads, num_kv_heads, head_size, max_seq_len, num_blocks, repeat); + if (!ok) return 1; return 0; } diff --git a/src/attention-paged-hip/main.cu b/src/attention-paged-hip/main.cu index 8f4a6d8f4d..8bee6b7637 100644 --- a/src/attention-paged-hip/main.cu +++ b/src/attention-paged-hip/main.cu @@ -24,6 +24,7 @@ #include "cuda_compat.h" #include "kvcache.h" #include "reference.h" +#include #define LAUNCH_PAGED_ATTENTION_V1(HEAD_SIZE) \ @@ -342,5 +343,6 @@ int main(int argc, char* argv[]) attention_page<__nv_bfloat16, 32>(num_seqs, num_query_heads, num_kv_heads, head_size, max_seq_len, num_blocks, repeat); + if (!ok) return 1; return 0; } diff --git a/src/attention-paged-sycl/main.cpp b/src/attention-paged-sycl/main.cpp index 833c13ab91..4b9c9d2a17 100644 --- a/src/attention-paged-sycl/main.cpp +++ b/src/attention-paged-sycl/main.cpp @@ -23,6 +23,7 @@ #include "attention_kernels.h" #include "kvcache.h" #include "reference.h" +#include // Add a template parameter WARP_SIZE #define LAUNCH_PAGED_ATTENTION_V1(HEAD_SIZE) \ @@ -384,5 +385,6 @@ int main(int argc, char* argv[]) Q, num_seqs, num_query_heads, num_kv_heads, head_size, max_seq_len, num_blocks, repeat); + if (!ok) return 1; return 0; } diff --git a/src/attention-sycl/main.cpp b/src/attention-sycl/main.cpp index 149a3b815e..e2b05574f9 100644 --- a/src/attention-sycl/main.cpp +++ b/src/attention-sycl/main.cpp @@ -245,5 +245,6 @@ int main(int argc, char* argv[]) { free(query); free(dout); free(hout); + if (!ok) return 1; return 0; } diff --git a/src/attentionMultiHead-cuda/main.cu b/src/attentionMultiHead-cuda/main.cu index ceb7fcc9df..ba34aa392a 100644 --- a/src/attentionMultiHead-cuda/main.cu +++ b/src/attentionMultiHead-cuda/main.cu @@ -245,5 +245,6 @@ int main(int argc, char* argv[]) free(h_dst); free(r_dst); + if (!ok) return 1; return 0; } diff --git a/src/attentionMultiHead-hip/main.cu b/src/attentionMultiHead-hip/main.cu index ee3b7c1697..30f84d4b05 100644 --- a/src/attentionMultiHead-hip/main.cu +++ b/src/attentionMultiHead-hip/main.cu @@ -227,5 +227,6 @@ int main(int argc, char* argv[]) free(h_dst); free(r_dst); + if (!ok) return 1; return 0; } diff --git a/src/attentionMultiHead-sycl/main.cpp b/src/attentionMultiHead-sycl/main.cpp index b33dbd3818..708f23364e 100644 --- a/src/attentionMultiHead-sycl/main.cpp +++ b/src/attentionMultiHead-sycl/main.cpp @@ -240,5 +240,6 @@ int main(int argc, char* argv[]) free(r_dst); + if (!ok) return 1; return 0; } diff --git a/src/axhelm-hip/Makefile.hipcl b/src/axhelm-hip/Makefile.hipcl index 86ad5d4505..4085c1201b 100644 --- a/src/axhelm-hip/Makefile.hipcl +++ b/src/axhelm-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = axhelm +program = main #=============================================================================== # Sets Flags diff --git a/src/axhelm-sycl/Makefile.hipsycl b/src/axhelm-sycl/Makefile.hipsycl index b936e65af7..68792a5460 100644 --- a/src/axhelm-sycl/Makefile.hipsycl +++ b/src/axhelm-sycl/Makefile.hipsycl @@ -14,7 +14,7 @@ DEVICE = gpu # Program name & source code list #=============================================================================== -program = axhelm +program = main #=============================================================================== # Sets Flags diff --git a/src/axpby-cuda/main.cu b/src/axpby-cuda/main.cu index 9cdf43dfd3..6beb2c92e4 100644 --- a/src/axpby-cuda/main.cu +++ b/src/axpby-cuda/main.cu @@ -189,5 +189,6 @@ int main(int argc, char* argv[]) } } + if (!ok) return 1; return 0; } diff --git a/src/axpby-hip/main.cu b/src/axpby-hip/main.cu index 072430d93e..170afd7124 100644 --- a/src/axpby-hip/main.cu +++ b/src/axpby-hip/main.cu @@ -189,5 +189,6 @@ int main(int argc, char* argv[]) } } + if (!ok) return 1; return 0; } diff --git a/src/axpby-sycl/main.cpp b/src/axpby-sycl/main.cpp index f42032fa82..ab1604d61f 100644 --- a/src/axpby-sycl/main.cpp +++ b/src/axpby-sycl/main.cpp @@ -204,5 +204,6 @@ int main(int argc, char* argv[]) } } + if (!ok) return 1; return 0; } diff --git a/src/b+tree-cuda/Makefile b/src/b+tree-cuda/Makefile index 6cb4eaff59..1a126ee8d0 100644 --- a/src/b+tree-cuda/Makefile +++ b/src/b+tree-cuda/Makefile @@ -32,7 +32,7 @@ ifeq ($(OPTIMIZE),yes) endif -b+tree.out: ./main.o \ +main: ./main.o \ ./kernel/kernel_wrapper.o \ ./kernel/kernel2_wrapper.o \ ./util/timer/timer.o \ @@ -42,7 +42,7 @@ b+tree.out: ./main.o \ ./kernel/kernel2_wrapper.o \ ./util/timer/timer.o \ ./util/num/num.o \ - -lm -o b+tree.out + -lm -o main @@ -69,11 +69,11 @@ main.o: ./common.h ./main.h ./main.cu ./util/num/num.o: ./common.h ./util/num/num.h ./util/num/num.c $(CC) ./util/num/num.c -c -o ./util/num/num.o -run: b+tree.out - $(LAUNCHER) ./b+tree.out file ../data/b+tree/mil.txt command ../data/b+tree/command.txt +run: main + $(LAUNCHER) ./main file ../data/b+tree/mil.txt command ../data/b+tree/command.txt clean: - rm -rf *.o *.out \ + rm -rf *.o main \ ./kernel/*.o \ ./util/timer/*.o \ ./util/num/*.o \ diff --git a/src/b+tree-hip/Makefile b/src/b+tree-hip/Makefile index 3d93dae20e..900eb9389d 100644 --- a/src/b+tree-hip/Makefile +++ b/src/b+tree-hip/Makefile @@ -31,7 +31,7 @@ ifeq ($(OPTIMIZE),yes) endif -b+tree.out: ./main.o \ +main: ./main.o \ ./kernel/kernel_wrapper.o \ ./kernel/kernel2_wrapper.o \ ./util/timer/timer.o \ @@ -41,7 +41,7 @@ b+tree.out: ./main.o \ ./kernel/kernel2_wrapper.o \ ./util/timer/timer.o \ ./util/num/num.o \ - -lm -o b+tree.out + -lm -o main @@ -90,8 +90,8 @@ main.o: ./common.h \ -c \ -o ./util/num/num.o -run: b+tree.out - $(LAUNCHER) ./b+tree.out file ../data/b+tree/mil.txt command ../data/b+tree/command.txt +run: main + $(LAUNCHER) ./main file ../data/b+tree/mil.txt command ../data/b+tree/command.txt clean: rm -rf *.o *.out \ @@ -99,4 +99,3 @@ clean: ./util/timer/*.o \ ./util/num/*.o \ output.txt - diff --git a/src/b+tree-hip/Makefile.hipcl b/src/b+tree-hip/Makefile.hipcl index 49963f2d83..0078978307 100644 --- a/src/b+tree-hip/Makefile.hipcl +++ b/src/b+tree-hip/Makefile.hipcl @@ -30,7 +30,7 @@ ifeq ($(OPTIMIZE),yes) endif -b+tree.out: ./main.o \ +main: ./main.o \ ./kernel/kernel_wrapper.o \ ./kernel/kernel2_wrapper.o \ ./util/timer/timer.o \ @@ -40,7 +40,7 @@ b+tree.out: ./main.o \ ./kernel/kernel2_wrapper.o \ ./util/timer/timer.o \ ./util/num/num.o \ - -o b+tree.out $(LDFLAGS) + -o main $(LDFLAGS) @@ -88,11 +88,11 @@ main.o: ./common.h \ -c \ -o ./util/num/num.o -run: b+tree.out - ./b+tree.out file ../data/b+tree/mil.txt command ../data/b+tree/command.txt +run: main + ./main file ../data/b+tree/mil.txt command ../data/b+tree/command.txt clean: - rm -rf *.o *.out \ + rm -rf *.o main \ ./kernel/*.o \ ./util/timer/*.o \ ./util/num/*.o \ diff --git a/src/b+tree-omp/Makefile b/src/b+tree-omp/Makefile index 11ae704df5..13b520fda1 100644 --- a/src/b+tree-omp/Makefile +++ b/src/b+tree-omp/Makefile @@ -29,7 +29,7 @@ else endif -b+tree.out: ./main.o \ +main: ./main.o \ ./kernel/kernel_wrapper.o \ ./kernel/kernel2_wrapper.o \ ./util/timer/timer.o \ @@ -40,7 +40,7 @@ b+tree.out: ./main.o \ ./util/timer/timer.o \ ./util/num/num.o \ $(LDFLAGS) \ - -o b+tree.out + -o main # ========================================================================================================================================================================================================200 # OBJECTS (COMPILE SOURCE FILES INTO OBJECTS) # ========================================================================================================================================================================================================200 @@ -97,15 +97,15 @@ main.o: ./common.h \ # END # ======================================================================================================================================================150 # -run: b+tree.out - $(LAUNCHER) ./b+tree.out file ../data/b+tree/mil.txt command ../data/b+tree/command.txt +run: main + $(LAUNCHER) ./main file ../data/b+tree/mil.txt command ../data/b+tree/command.txt # ========================================================================================================================================================================================================200 # DELETE # ========================================================================================================================================================================================================200 clean: - rm -f *.o *.out \ + rm -f *.o main \ ./kernel/*.o \ ./util/timer/*.o \ ./util/num/*.o \ diff --git a/src/b+tree-omp/Makefile.aomp b/src/b+tree-omp/Makefile.aomp index 0844350731..2643118067 100644 --- a/src/b+tree-omp/Makefile.aomp +++ b/src/b+tree-omp/Makefile.aomp @@ -33,7 +33,7 @@ else endif -b+tree.out: ./main.o \ +main: ./main.o \ ./kernel/kernel_wrapper.o \ ./kernel/kernel2_wrapper.o \ ./util/timer/timer.o \ @@ -44,7 +44,7 @@ b+tree.out: ./main.o \ ./util/timer/timer.o \ ./util/num/num.o \ $(LDFLAGS) \ - -o b+tree.out + -o main # ========================================================================================================================================================================================================200 # OBJECTS (COMPILE SOURCE FILES INTO OBJECTS) # ========================================================================================================================================================================================================200 @@ -101,15 +101,15 @@ main.o: ./common.h \ # END # ======================================================================================================================================================150 # -run: b+tree.out - $(LAUNCHER) ./b+tree.out file ../data/b+tree/mil.txt command ../data/b+tree/command.txt +run: main + $(LAUNCHER) ./main file ../data/b+tree/mil.txt command ../data/b+tree/command.txt # ========================================================================================================================================================================================================200 # DELETE # ========================================================================================================================================================================================================200 clean: - rm -f *.o *.out \ + rm -f *.o main \ ./kernel/*.o \ ./util/timer/*.o \ ./util/num/*.o \ diff --git a/src/b+tree-omp/Makefile.nvc b/src/b+tree-omp/Makefile.nvc index 32712ac647..22a25b5371 100644 --- a/src/b+tree-omp/Makefile.nvc +++ b/src/b+tree-omp/Makefile.nvc @@ -30,7 +30,7 @@ else endif -b+tree.out: ./main.o \ +main: ./main.o \ ./kernel/kernel_wrapper.o \ ./kernel/kernel2_wrapper.o \ ./util/timer/timer.o \ @@ -41,7 +41,7 @@ b+tree.out: ./main.o \ ./util/timer/timer.o \ ./util/num/num.o \ $(LDFLAGS) \ - -o b+tree.out + -o main # ========================================================================================================================================================================================================200 # OBJECTS (COMPILE SOURCE FILES INTO OBJECTS) # ========================================================================================================================================================================================================200 @@ -98,15 +98,15 @@ main.o: ./common.h \ # END # ======================================================================================================================================================150 # -run: b+tree.out - $(LAUNCHER) ./b+tree.out file ../data/b+tree/mil.txt command ../data/b+tree/command.txt +run: main + $(LAUNCHER) ./main file ../data/b+tree/mil.txt command ../data/b+tree/command.txt # ========================================================================================================================================================================================================200 # DELETE # ========================================================================================================================================================================================================200 clean: - rm -f *.o *.out \ + rm -f *.o main \ ./kernel/*.o \ ./util/timer/*.o \ ./util/num/*.o \ diff --git a/src/b+tree-sycl/Makefile b/src/b+tree-sycl/Makefile index e685959cbd..e9c43d7173 100644 --- a/src/b+tree-sycl/Makefile +++ b/src/b+tree-sycl/Makefile @@ -66,18 +66,18 @@ endif # Targets to Build #=============================================================================== -b+tree.out:./main.o \ +main: ./main.o \ ./kernel/kernel_wrapper.o \ ./kernel/kernel2_wrapper.o \ ./util/timer/timer.o \ - ./util/num/num.o + ./util/num/num.o $(CC) $(CFLAGS) ./main.o \ ./kernel/kernel_wrapper.o \ ./kernel/kernel2_wrapper.o \ ./util/timer/timer.o \ ./util/num/num.o \ $(LDFLAGS) \ - -o b+tree.out + -o main main.o: ./b+tree.h ./main.c @@ -117,11 +117,11 @@ main.o: ./b+tree.h ./main.c -o ./util/num/num.o \ -O3 -run: b+tree.out - $(LAUNCHER) ./b+tree.out file ../data/b+tree/mil.txt command ../data/b+tree/command.txt +run: main + $(LAUNCHER) ./main file ../data/b+tree/mil.txt command ../data/b+tree/command.txt clean: - rm -f *.o *.out \ + rm -f *.o main \ ./kernel/*.o \ ./util/timer/*.o \ ./util/num/*.o \ diff --git a/src/background-subtract-cuda/main.cu b/src/background-subtract-cuda/main.cu index 18987cbcb4..4682670841 100644 --- a/src/background-subtract-cuda/main.cu +++ b/src/background-subtract-cuda/main.cu @@ -198,5 +198,6 @@ int main(int argc, char* argv[]) { cudaFree(d_Mp); cudaFree(d_Bn); + if (max_error) return 1; return 0; } diff --git a/src/background-subtract-hip/main.cu b/src/background-subtract-hip/main.cu index 586f8c2019..c9347975a3 100644 --- a/src/background-subtract-hip/main.cu +++ b/src/background-subtract-hip/main.cu @@ -198,5 +198,6 @@ int main(int argc, char* argv[]) { hipFree(d_Mp); hipFree(d_Bn); + if (max_error) return 1; return 0; } diff --git a/src/background-subtract-omp/main.cpp b/src/background-subtract-omp/main.cpp index 5c25edb303..d13a54a45a 100644 --- a/src/background-subtract-omp/main.cpp +++ b/src/background-subtract-omp/main.cpp @@ -180,5 +180,6 @@ int main(int argc, char* argv[]) { free(Bn_ref); free(Mp); + if (max_error) return 1; return 0; } diff --git a/src/background-subtract-sycl/main.cpp b/src/background-subtract-sycl/main.cpp index 5a4f6e96e8..ef8bb25237 100644 --- a/src/background-subtract-sycl/main.cpp +++ b/src/background-subtract-sycl/main.cpp @@ -228,5 +228,6 @@ int main(int argc, char* argv[]) { sycl::free(d_Mp, q); sycl::free(d_Bn, q); + if (max_error) return 1; return 0; } diff --git a/src/backprop-cuda/main.cu b/src/backprop-cuda/main.cu index 454c8c244b..15160557bb 100644 --- a/src/backprop-cuda/main.cu +++ b/src/backprop-cuda/main.cu @@ -151,5 +151,6 @@ int bpnn_train_kernel(BPNN *net, float *eo, float *eh) free(input_weights_one_dim); free(input_weights_one_dim_r); + if (!ok) return 1; return 0; } diff --git a/src/backprop-hip/main.cu b/src/backprop-hip/main.cu index 4d04e438a8..d58625cfbb 100644 --- a/src/backprop-hip/main.cu +++ b/src/backprop-hip/main.cu @@ -151,5 +151,6 @@ int bpnn_train_kernel(BPNN *net, float *eo, float *eh) free(input_weights_one_dim); free(input_weights_one_dim_r); + if (!ok) return 1; return 0; } diff --git a/src/backprop-omp/main.cpp b/src/backprop-omp/main.cpp index 3e76561ef4..2fc6c94e95 100644 --- a/src/backprop-omp/main.cpp +++ b/src/backprop-omp/main.cpp @@ -192,5 +192,6 @@ int bpnn_train_kernel(BPNN *net, float *eo, float *eh) free(input_weights_one_dim); free(input_weights_one_dim_r); + if (!ok) return 1; return 0; } diff --git a/src/backprop-sycl/main.cpp b/src/backprop-sycl/main.cpp index 6e7ddfb30b..02e47f187b 100644 --- a/src/backprop-sycl/main.cpp +++ b/src/backprop-sycl/main.cpp @@ -164,5 +164,6 @@ int bpnn_train_kernel(BPNN *net, float *eo, float *eh) free(input_weights_one_dim); free(input_weights_one_dim_r); + if (!ok) return 1; return 0; } diff --git a/src/bezier-surface-cuda/main.cu b/src/bezier-surface-cuda/main.cu index 0e13b40c47..ccf7809b9e 100644 --- a/src/bezier-surface-cuda/main.cu +++ b/src/bezier-surface-cuda/main.cu @@ -40,6 +40,7 @@ #include #include #include +#include #if DOUBLE_PRECISION @@ -307,5 +308,6 @@ int main(int argc, char **argv) { run(h_in, p.in_size_i, p.in_size_j, p.out_size_i, p.out_size_j, p); free(h_in); + if (!(status == 0)) return 1; return 0; } diff --git a/src/bezier-surface-hip/Makefile.hipcl b/src/bezier-surface-hip/Makefile.hipcl index 31003ad9aa..0c19382bcc 100644 --- a/src/bezier-surface-hip/Makefile.hipcl +++ b/src/bezier-surface-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = bs +program = main source = main.cu diff --git a/src/bezier-surface-hip/main.cu b/src/bezier-surface-hip/main.cu index 8ce5a69c00..82a6d51e8a 100644 --- a/src/bezier-surface-hip/main.cu +++ b/src/bezier-surface-hip/main.cu @@ -40,6 +40,7 @@ #include #include #include +#include #if DOUBLE_PRECISION @@ -307,5 +308,6 @@ int main(int argc, char **argv) { run(h_in, p.in_size_i, p.in_size_j, p.out_size_i, p.out_size_j, p); free(h_in); + if (!(status == 0)) return 1; return 0; } diff --git a/src/bezier-surface-omp/Makefile.aomp b/src/bezier-surface-omp/Makefile.aomp index e83ef1c7a6..2fa75f0934 100644 --- a/src/bezier-surface-omp/Makefile.aomp +++ b/src/bezier-surface-omp/Makefile.aomp @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = bs +program = main source = main.cpp diff --git a/src/bezier-surface-omp/main.cpp b/src/bezier-surface-omp/main.cpp index e4e4441c92..dc5b95105c 100644 --- a/src/bezier-surface-omp/main.cpp +++ b/src/bezier-surface-omp/main.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #if DOUBLE_PRECISION @@ -289,5 +290,6 @@ int main(int argc, char **argv) { run(h_in, p.in_size_i, p.in_size_j, p.out_size_i, p.out_size_j, p); free(h_in); + if (!(status == 0)) return 1; return 0; } diff --git a/src/bezier-surface-sycl/main.cpp b/src/bezier-surface-sycl/main.cpp index af22cedadf..ab6238bc01 100644 --- a/src/bezier-surface-sycl/main.cpp +++ b/src/bezier-surface-sycl/main.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #if DOUBLE_PRECISION @@ -309,5 +310,6 @@ int main(int argc, char **argv) { run(h_in, p.in_size_i, p.in_size_j, p.out_size_i, p.out_size_j, p); free(h_in); + if (!(status == 0)) return 1; return 0; } diff --git a/src/bilateral-cuda/main.cu b/src/bilateral-cuda/main.cu index 10b605eeb0..4ac94117a1 100644 --- a/src/bilateral-cuda/main.cu +++ b/src/bilateral-cuda/main.cu @@ -187,5 +187,6 @@ int main(int argc, char *argv[]) { free(h_src); cudaFree(d_dst); cudaFree(d_src); + if (!ok) return 1; return 0; } diff --git a/src/bilateral-hip/main.cu b/src/bilateral-hip/main.cu index 2982f9bbc4..e95a6d300a 100644 --- a/src/bilateral-hip/main.cu +++ b/src/bilateral-hip/main.cu @@ -187,5 +187,6 @@ int main(int argc, char *argv[]) { free(h_src); hipFree(d_dst); hipFree(d_src); + if (!ok) return 1; return 0; } diff --git a/src/bilateral-omp/main.cpp b/src/bilateral-omp/main.cpp index dcc95252e8..cb6718226f 100644 --- a/src/bilateral-omp/main.cpp +++ b/src/bilateral-omp/main.cpp @@ -171,5 +171,6 @@ int main(int argc, char *argv[]) { free(h_dst); free(r_dst); free(h_src); + if (!ok) return 1; return 0; } diff --git a/src/bilateral-sycl/main.cpp b/src/bilateral-sycl/main.cpp index 33286b9b36..532aa177e4 100644 --- a/src/bilateral-sycl/main.cpp +++ b/src/bilateral-sycl/main.cpp @@ -213,5 +213,6 @@ int main(int argc, char *argv[]) { free(h_src); sycl::free(d_dst, q); sycl::free(d_src, q); + if (!ok) return 1; return 0; } diff --git a/src/bitonic-sort-cuda/main.cu b/src/bitonic-sort-cuda/main.cu index 413732b76e..8966e343a7 100644 --- a/src/bitonic-sort-cuda/main.cu +++ b/src/bitonic-sort-cuda/main.cu @@ -40,6 +40,7 @@ #include #include #include +#include #define BLOCK_SIZE 256 @@ -222,5 +223,6 @@ int main(int argc, char *argv[]) { free(data_cpu); free(data_gpu); + if (unequal) return 1; return 0; } diff --git a/src/bitonic-sort-hip/main.cu b/src/bitonic-sort-hip/main.cu index 6f97dcbe80..f5d5cfcdb2 100644 --- a/src/bitonic-sort-hip/main.cu +++ b/src/bitonic-sort-hip/main.cu @@ -40,6 +40,7 @@ #include #include #include +#include #define BLOCK_SIZE 256 @@ -221,5 +222,6 @@ int main(int argc, char *argv[]) { free(data_cpu); free(data_gpu); + if (unequal) return 1; return 0; } diff --git a/src/bitonic-sort-omp/main.cpp b/src/bitonic-sort-omp/main.cpp index 05226b5082..293bc12db0 100644 --- a/src/bitonic-sort-omp/main.cpp +++ b/src/bitonic-sort-omp/main.cpp @@ -40,6 +40,7 @@ #include #include #include +#include void ParallelBitonicSort(int input[], int n) { @@ -216,5 +217,6 @@ int main(int argc, char *argv[]) { free(data_cpu); free(data_gpu); + if (unequal) return 1; return 0; } diff --git a/src/bitonic-sort-sycl/main.cpp b/src/bitonic-sort-sycl/main.cpp index 8c78e7bdc8..49de53a48c 100644 --- a/src/bitonic-sort-sycl/main.cpp +++ b/src/bitonic-sort-sycl/main.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #define BLOCK_SIZE 256 @@ -234,5 +235,6 @@ int main(int argc, char *argv[]) { free(data_cpu); free(data_gpu); + if (unequal) return 1; return 0; } diff --git a/src/bitpacking-cuda/main.cu b/src/bitpacking-cuda/main.cu index f872a015fe..e3a02472d6 100644 --- a/src/bitpacking-cuda/main.cu +++ b/src/bitpacking-cuda/main.cu @@ -1,4 +1,5 @@ #include "utils.h" +#include template void toGPU(T* const output, T const* const input, size_t const num) @@ -143,6 +144,7 @@ int main() { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } free(inputHost); diff --git a/src/bitpacking-hip/main.cu b/src/bitpacking-hip/main.cu index f82840136c..00c82febc0 100644 --- a/src/bitpacking-hip/main.cu +++ b/src/bitpacking-hip/main.cu @@ -1,4 +1,5 @@ #include "utils.h" +#include template void toGPU(T* const output, T const* const input, size_t const num) @@ -144,6 +145,7 @@ int main() { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } free(inputHost); diff --git a/src/bitpacking-sycl/main.cpp b/src/bitpacking-sycl/main.cpp index 640fc01cb4..97aebb23da 100644 --- a/src/bitpacking-sycl/main.cpp +++ b/src/bitpacking-sycl/main.cpp @@ -1,4 +1,5 @@ #include "utils.h" +#include template void toGPU(sycl::queue &q, T* const output, T const* const input, size_t const num) @@ -150,6 +151,7 @@ int main() { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } free(inputHost); diff --git a/src/bitpermute-cuda/main.cu b/src/bitpermute-cuda/main.cu index c2a0fa7b2c..7fcab1b27f 100644 --- a/src/bitpermute-cuda/main.cu +++ b/src/bitpermute-cuda/main.cu @@ -9,6 +9,7 @@ #include #include "kernels.h" #include "reference.h" +#include void cuda_check(cudaError_t error, const char *file, int line) { if (error != cudaSuccess) { @@ -71,6 +72,7 @@ void bit_permute(const int lg_domain_size, const int repeat) cudaCheck(cudaMemcpy(inout, d_inout, domain_size_bytes, cudaMemcpyDeviceToHost)); int error = memcmp(out, inout, domain_size_bytes); printf("%s\n", error ? "FAIL" : "PASS"); + if (error) exit(1); auto start = std::chrono::steady_clock::now(); diff --git a/src/bitpermute-hip/main.cu b/src/bitpermute-hip/main.cu index 874b5c154b..584714e494 100644 --- a/src/bitpermute-hip/main.cu +++ b/src/bitpermute-hip/main.cu @@ -9,6 +9,7 @@ #include #include "kernels.h" #include "reference.h" +#include void hip_check(hipError_t error, const char *file, int line) { if (error != hipSuccess) { @@ -69,6 +70,7 @@ void bit_permute(const int lg_domain_size, const int repeat) hipCheck(hipMemcpy(inout, d_inout, domain_size_bytes, hipMemcpyDeviceToHost)); int error = memcmp(out, inout, domain_size_bytes); printf("%s\n", error ? "FAIL" : "PASS"); + if (error) exit(1); auto start = std::chrono::steady_clock::now(); diff --git a/src/bitpermute-sycl/main.cpp b/src/bitpermute-sycl/main.cpp index 10c7bd5ee9..5fe3bfb6e4 100644 --- a/src/bitpermute-sycl/main.cpp +++ b/src/bitpermute-sycl/main.cpp @@ -9,6 +9,7 @@ #include #include "kernels.h" #include "reference.h" +#include static void bit_rev(sycl::queue &q, fr_t* d_out, const fr_t* d_inp, uint32_t lg_domain_size) { @@ -86,6 +87,7 @@ void bit_permute(sycl::queue &q, const int lg_domain_size, const int repeat) q.memcpy(inout, d_inout, domain_size_bytes).wait(); int error = memcmp(out, inout, domain_size_bytes); printf("%s\n", error ? "FAIL" : "PASS"); + if (error) exit(1); auto start = std::chrono::steady_clock::now(); diff --git a/src/black-scholes-hip/Makefile.hipcl b/src/black-scholes-hip/Makefile.hipcl index c34ce2f8c5..d9cf7604a3 100644 --- a/src/black-scholes-hip/Makefile.hipcl +++ b/src/black-scholes-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = BlackScholesEngine +program = main source = blackScholesAnalyticEngine.cu diff --git a/src/blas-dot-cuda/main.cu b/src/blas-dot-cuda/main.cu index a8924f5616..b37871ad2f 100644 --- a/src/blas-dot-cuda/main.cu +++ b/src/blas-dot-cuda/main.cu @@ -107,5 +107,6 @@ int main(int argc, char **argv) printf("\nBF16 Dot\n"); dot<__nv_bfloat16>(iNumElements, iNumIterations); + if (!(fabs(double(dst) - sum) < 1e-1)) return 1; return EXIT_SUCCESS; } diff --git a/src/blas-dot-hip/main.cu b/src/blas-dot-hip/main.cu index 3df7cab299..62af315a92 100644 --- a/src/blas-dot-hip/main.cu +++ b/src/blas-dot-hip/main.cu @@ -107,5 +107,6 @@ int main(int argc, char **argv) printf("\nBF16 Dot\n"); dot<__hip_bfloat16>(iNumElements, iNumIterations); + if (!(fabs(double(dst) - sum) < 1e-1)) return 1; return EXIT_SUCCESS; } diff --git a/src/blas-dot-sycl/main.cpp b/src/blas-dot-sycl/main.cpp index 9526fec8f4..4cabee9a44 100644 --- a/src/blas-dot-sycl/main.cpp +++ b/src/blas-dot-sycl/main.cpp @@ -87,5 +87,6 @@ int main(int argc, char **argv) printf("\nBF16 Dot\n"); dot(iNumElements, iNumIterations); + if (!(fabs(double(dst) - sum) < 1e-1)) return 1; return EXIT_SUCCESS; } diff --git a/src/blas-gemm-cuda/main.cu b/src/blas-gemm-cuda/main.cu index 42e4f03172..a599d6c34f 100644 --- a/src/blas-gemm-cuda/main.cu +++ b/src/blas-gemm-cuda/main.cu @@ -173,5 +173,6 @@ int main (int argc, char ** argv) { std::cout << "\tRunning with double precision data type:" << std::endl; run_gemm_example(m, k, n, repeat); + if (error) return 1; return 0; } diff --git a/src/blas-gemm-hip/main.cu b/src/blas-gemm-hip/main.cu index 276be22650..2c13aad302 100644 --- a/src/blas-gemm-hip/main.cu +++ b/src/blas-gemm-hip/main.cu @@ -174,5 +174,6 @@ int main (int argc, char ** argv) { std::cout << "\tRunning with double precision data type:" << std::endl; run_gemm_example(m, k, n, repeat); + if (error) return 1; return 0; } diff --git a/src/blas-gemm-sycl/main.cpp b/src/blas-gemm-sycl/main.cpp index 50eca277cd..14a9e2ee3c 100644 --- a/src/blas-gemm-sycl/main.cpp +++ b/src/blas-gemm-sycl/main.cpp @@ -206,5 +206,6 @@ int main (int argc, char ** argv) { std::cout << "\tRunning with double precision data type:" << std::endl; run_gemm_example(m, k, n, repeat); + if (error) return 1; return 0; } diff --git a/src/blockAccess-cuda/main.cu b/src/blockAccess-cuda/main.cu index 72cce7973d..f259659ce4 100644 --- a/src/blockAccess-cuda/main.cu +++ b/src/blockAccess-cuda/main.cu @@ -153,5 +153,6 @@ int main(int argc, char* argv[]) free(A); free(out); free(out_ref); + if (error) return 1; return 0; } diff --git a/src/blockAccess-hip/main.cu b/src/blockAccess-hip/main.cu index 7ffcc96440..e75e610dee 100644 --- a/src/blockAccess-hip/main.cu +++ b/src/blockAccess-hip/main.cu @@ -154,5 +154,6 @@ int main(int argc, char* argv[]) free(A); free(out); free(out_ref); + if (error) return 1; return 0; } diff --git a/src/blockAccess-sycl/main.cpp b/src/blockAccess-sycl/main.cpp index a2693dff74..493b0a1154 100644 --- a/src/blockAccess-sycl/main.cpp +++ b/src/blockAccess-sycl/main.cpp @@ -248,5 +248,6 @@ int main(int argc, char* argv[]) free(out); free(out2); free(out_ref); + if (error) return 1; return 0; } diff --git a/src/blockScan-cuda/main.cu b/src/blockScan-cuda/main.cu index decd822ca8..f62eed621d 100644 --- a/src/blockScan-cuda/main.cu +++ b/src/blockScan-cuda/main.cu @@ -31,6 +31,7 @@ #include #include #include +#include using namespace cub; @@ -268,5 +269,7 @@ int main(int argc, char** argv) Test<64, 16, BLOCK_SCAN_WARP_SCANS>(); Test<32, 32, BLOCK_SCAN_WARP_SCANS>(); + if (compare) return 1; + if (compare) return 1; return 0; } diff --git a/src/blockScan-hip/main.cu b/src/blockScan-hip/main.cu index 9556d349bf..fae16a1ee1 100644 --- a/src/blockScan-hip/main.cu +++ b/src/blockScan-hip/main.cu @@ -32,6 +32,7 @@ #include #include #include +#include using namespace hipcub; @@ -269,5 +270,7 @@ int main(int argc, char** argv) Test<64, 16, BLOCK_SCAN_WARP_SCANS>(); //Test<32, 32, BLOCK_SCAN_WARP_SCANS>(); + if (compare) return 1; + if (compare) return 1; return 0; } diff --git a/src/blockScan-sycl/main.cpp b/src/blockScan-sycl/main.cpp index faca744059..ae7de363f2 100644 --- a/src/blockScan-sycl/main.cpp +++ b/src/blockScan-sycl/main.cpp @@ -32,6 +32,7 @@ #include "block_load.hpp" #include "block_store.hpp" #include "block_scan.hpp" +#include int grid_size = 1; int repeat = 100; @@ -266,5 +267,7 @@ int main(int argc, char** argv) Test<64, 16, BLOCK_SCAN_WARP_SCANS>(q); Test<32, 32, BLOCK_SCAN_WARP_SCANS>(q); + if (compare) return 1; + if (compare) return 1; return 0; } diff --git a/src/blockexchange-cuda/main.cu b/src/blockexchange-cuda/main.cu index 1b6785f732..8779a98ba0 100644 --- a/src/blockexchange-cuda/main.cu +++ b/src/blockexchange-cuda/main.cu @@ -127,5 +127,6 @@ int main(int argc, char* argv[]) cudaFree(d_out); free(A); free(out); + if (!ok) return 1; return 0; } diff --git a/src/blockexchange-hip/main.cu b/src/blockexchange-hip/main.cu index 465b388237..f2a3bbf21d 100644 --- a/src/blockexchange-hip/main.cu +++ b/src/blockexchange-hip/main.cu @@ -127,5 +127,6 @@ int main(int argc, char* argv[]) hipFree(d_out); free(A); free(out); + if (!ok) return 1; return 0; } diff --git a/src/blockexchange-sycl/main.cpp b/src/blockexchange-sycl/main.cpp index 6a7df2a0f7..eca8c127a8 100644 --- a/src/blockexchange-sycl/main.cpp +++ b/src/blockexchange-sycl/main.cpp @@ -148,5 +148,6 @@ int main(int argc, char* argv[]) sycl::free(d_out, q); free(A); free(out); + if (!ok) return 1; return 0; } diff --git a/src/boxfilter-cuda/main.cu b/src/boxfilter-cuda/main.cu index ae1b370fbf..e60db4b1d7 100644 --- a/src/boxfilter-cuda/main.cu +++ b/src/boxfilter-cuda/main.cu @@ -15,6 +15,7 @@ #include #include "shrUtils.h" #include "helper_math.h" +#include extern void BoxFilterHost(unsigned int* uiInputImage, unsigned int* uiTempImage, unsigned int* uiOutputImage, int uiWidth, int uiHeight, int iRadius, float fScale ); @@ -289,5 +290,6 @@ int main(int argc, char** argv) free(uiTmp); free(uiDevOutput); free(uiHostOutput); + if (error) return 1; return 0; } diff --git a/src/boxfilter-hip/main.cu b/src/boxfilter-hip/main.cu index 0de8d309c6..5d6b3973a1 100644 --- a/src/boxfilter-hip/main.cu +++ b/src/boxfilter-hip/main.cu @@ -14,6 +14,7 @@ #include #include #include "shrUtils.h" +#include extern void BoxFilterHost(unsigned int* uiInputImage, unsigned int* uiTempImage, unsigned int* uiOutputImage, int uiWidth, int uiHeight, int iRadius, float fScale ); @@ -288,5 +289,6 @@ int main(int argc, char** argv) free(uiTmp); free(uiDevOutput); free(uiHostOutput); + if (error) return 1; return 0; } diff --git a/src/boxfilter-omp/main.cpp b/src/boxfilter-omp/main.cpp index c3809848f9..3a5ecebf54 100644 --- a/src/boxfilter-omp/main.cpp +++ b/src/boxfilter-omp/main.cpp @@ -14,6 +14,7 @@ #include #include #include "shrUtils.h" +#include typedef struct __attribute__((__aligned__(4))) { @@ -287,5 +288,6 @@ int main(int argc, char** argv) free(uiTmp); free(uiDevOutput); free(uiHostOutput); + if (error) return 1; return 0; } diff --git a/src/boxfilter-sycl/main.cpp b/src/boxfilter-sycl/main.cpp index 22986aeb67..9718ddd261 100644 --- a/src/boxfilter-sycl/main.cpp +++ b/src/boxfilter-sycl/main.cpp @@ -14,6 +14,7 @@ #include #include #include "shrUtils.h" +#include extern void BoxFilterHost( unsigned int* uiInputImage, unsigned int* uiTempImage, unsigned int* uiOutputImage, @@ -267,5 +268,6 @@ int main(int argc, char** argv) free(uiTmp); free(uiDevOutput); free(uiHostOutput); + if (error) return 1; return 0; } diff --git a/src/bscan-cuda/main.cu b/src/bscan-cuda/main.cu index 99f7a3ec35..02643faa05 100644 --- a/src/bscan-cuda/main.cu +++ b/src/bscan-cuda/main.cu @@ -10,6 +10,7 @@ #include #include #include +#include __device__ __inline__ int warp_scan(int val, volatile int *s_data) { @@ -183,5 +184,6 @@ int main(int argc, char* argv[]) bscan<512>(repeat); bscan<1024>(repeat); + if (!ok) return 1; return 0; } diff --git a/src/bscan-hip/main-wave64.cu b/src/bscan-hip/main-wave64.cu index 38b3e2cbab..a5d4cc2e2b 100644 --- a/src/bscan-hip/main-wave64.cu +++ b/src/bscan-hip/main-wave64.cu @@ -12,6 +12,7 @@ #include #include #include +#include __device__ __inline__ int warp_scan(int val, volatile int *s_data) { @@ -171,5 +172,6 @@ int main(int argc, char* argv[]) bscan<512>(repeat); bscan<1024>(repeat); + if (!ok) return 1; return 0; } diff --git a/src/bscan-hip/main.cu b/src/bscan-hip/main.cu index e15986a9b5..cae96e8ef1 100644 --- a/src/bscan-hip/main.cu +++ b/src/bscan-hip/main.cu @@ -10,6 +10,7 @@ #include #include #include +#include __device__ __inline__ int warp_scan(int val, volatile int *s_data) { @@ -172,5 +173,6 @@ int main(int argc, char* argv[]) bscan<512>(repeat); bscan<1024>(repeat); + if (!ok) return 1; return 0; } diff --git a/src/bscan-sycl/main-wave64.cpp b/src/bscan-sycl/main-wave64.cpp index 6054a82031..a8b44343b5 100644 --- a/src/bscan-sycl/main-wave64.cpp +++ b/src/bscan-sycl/main-wave64.cpp @@ -10,6 +10,7 @@ #include #include #include +#include inline int warp_scan(sycl::nd_item<1> &item, int val, volatile int *s_data) { @@ -187,5 +188,6 @@ int main(int argc, char* argv[]) bscan<512>(repeat); bscan<1024>(repeat); + if (!ok) return 1; return 0; } diff --git a/src/bscan-sycl/main.cpp b/src/bscan-sycl/main.cpp index d53c1d422d..9c0480fc4c 100644 --- a/src/bscan-sycl/main.cpp +++ b/src/bscan-sycl/main.cpp @@ -9,6 +9,7 @@ #include #include #include +#include inline int warp_scan(sycl::nd_item<1> &item, int val, volatile int *s_data) { @@ -189,5 +190,6 @@ int main(int argc, char* argv[]) bscan<512>(repeat); bscan<1024>(repeat); + if (!ok) return 1; return 0; } diff --git a/src/bspline-vgh-cuda/main.cu b/src/bspline-vgh-cuda/main.cu index 6d8c82877c..40c1e2fb10 100644 --- a/src/bspline-vgh-cuda/main.cu +++ b/src/bspline-vgh-cuda/main.cu @@ -291,5 +291,6 @@ int main(int argc, char ** argv) { cudaFree(d_d2a); cudaFree(d_d2b); cudaFree(d_d2c); + if (!ok) return 1; return 0; } diff --git a/src/bspline-vgh-hip/main.cu b/src/bspline-vgh-hip/main.cu index eb0f9a9881..7e97af2d7c 100644 --- a/src/bspline-vgh-hip/main.cu +++ b/src/bspline-vgh-hip/main.cu @@ -292,5 +292,6 @@ int main(int argc, char ** argv) { hipFree(d_d2a); hipFree(d_d2b); hipFree(d_d2c); + if (!ok) return 1; return 0; } diff --git a/src/bspline-vgh-omp/main.cpp b/src/bspline-vgh-omp/main.cpp index 8e86fe3655..cfb5bd5ae7 100644 --- a/src/bspline-vgh-omp/main.cpp +++ b/src/bspline-vgh-omp/main.cpp @@ -299,5 +299,6 @@ int main(int argc, char ** argv) { free(walkers_z); free(spline_coefs); + if (!ok) return 1; return 0; } diff --git a/src/bspline-vgh-sycl/main.cpp b/src/bspline-vgh-sycl/main.cpp index 5ab8e91a0f..8d27dfae4a 100644 --- a/src/bspline-vgh-sycl/main.cpp +++ b/src/bspline-vgh-sycl/main.cpp @@ -353,5 +353,6 @@ int main(int argc, char ** argv) { sycl::free(d_d2a, q); sycl::free(d_d2b, q); sycl::free(d_d2c, q); + if (!ok) return 1; return 0; } diff --git a/src/burger-cuda/main.cu b/src/burger-cuda/main.cu index 14324353ee..76b5f8aa21 100644 --- a/src/burger-cuda/main.cu +++ b/src/burger-cuda/main.cu @@ -199,5 +199,6 @@ int main(int argc, char* argv[]) cudaFree(d_u_new); cudaFree(d_v_new); + if (!ok) return 1; return 0; } diff --git a/src/burger-hip/main.cu b/src/burger-hip/main.cu index 271d49dd1f..252b37625f 100644 --- a/src/burger-hip/main.cu +++ b/src/burger-hip/main.cu @@ -199,5 +199,6 @@ int main(int argc, char* argv[]) hipFree(d_u_new); hipFree(d_v_new); + if (!ok) return 1; return 0; } diff --git a/src/burger-omp/main.cpp b/src/burger-omp/main.cpp index c0f84ae930..bb72b326ce 100644 --- a/src/burger-omp/main.cpp +++ b/src/burger-omp/main.cpp @@ -201,5 +201,6 @@ int main(int argc, char* argv[]) free(u_new); free(v_new); + if (!ok) return 1; return 0; } diff --git a/src/burger-sycl/main.cpp b/src/burger-sycl/main.cpp index c0b6656095..4c15b81135 100644 --- a/src/burger-sycl/main.cpp +++ b/src/burger-sycl/main.cpp @@ -252,5 +252,6 @@ int main(int argc, char* argv[]) sycl::free(d_u_new, q); sycl::free(d_v_new, q); + if (!ok) return 1; return 0; } diff --git a/src/bwt-cuda/main.cpp b/src/bwt-cuda/main.cpp index ea7f9ff141..82a7781331 100644 --- a/src/bwt-cuda/main.cpp +++ b/src/bwt-cuda/main.cpp @@ -69,6 +69,7 @@ int main(int argc, char const *argv[]) std::cout << "PASS\n"; } else { std::cout << "FAIL\n"; + exit(1); } free(sequence); diff --git a/src/cbsfil-cuda/main.cu b/src/cbsfil-cuda/main.cu index f90a8704a0..164a325956 100644 --- a/src/cbsfil-cuda/main.cu +++ b/src/cbsfil-cuda/main.cu @@ -87,5 +87,6 @@ int main(int argc, char* argv[]) { cudaFree(d_image); free(image); free(image_ref); + if (!ok) return 1; return 0; } diff --git a/src/cbsfil-hip/main.cu b/src/cbsfil-hip/main.cu index fef538f5c2..6b222c3ec2 100644 --- a/src/cbsfil-hip/main.cu +++ b/src/cbsfil-hip/main.cu @@ -87,5 +87,6 @@ int main(int argc, char* argv[]) { hipFree(d_image); free(image); free(image_ref); + if (!ok) return 1; return 0; } diff --git a/src/cbsfil-omp/main.cpp b/src/cbsfil-omp/main.cpp index f03e0339f8..45ffbade4b 100644 --- a/src/cbsfil-omp/main.cpp +++ b/src/cbsfil-omp/main.cpp @@ -78,5 +78,6 @@ int main(int argc, char* argv[]) { free(image); free(image_ref); + if (!ok) return 1; return 0; } diff --git a/src/cbsfil-sycl/main.cpp b/src/cbsfil-sycl/main.cpp index aa74b81fb2..90127db2bc 100644 --- a/src/cbsfil-sycl/main.cpp +++ b/src/cbsfil-sycl/main.cpp @@ -113,5 +113,6 @@ int main(int argc, char* argv[]) { sycl::free(d_image, q); free(image); free(image_ref); + if (!ok) return 1; return 0; } diff --git a/src/cc-cuda/main.cu b/src/cc-cuda/main.cu index b22b252fa8..8b977ddc17 100644 --- a/src/cc-cuda/main.cu +++ b/src/cc-cuda/main.cu @@ -435,5 +435,6 @@ int main(int argc, char* argv[]) cudaFreeHost(nodestatus); freeECLgraph(g); + if (!ok) return 1; return 0; } diff --git a/src/cc-hip/main.cu b/src/cc-hip/main.cu index 56ac4aad9b..a7595b349c 100644 --- a/src/cc-hip/main.cu +++ b/src/cc-hip/main.cu @@ -431,6 +431,7 @@ int main(int argc, char* argv[]) } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); hipHostFree(nodestatus); freeECLgraph(g); diff --git a/src/cc-sycl/main.cpp b/src/cc-sycl/main.cpp index e5444c644a..e9bf71c8cc 100644 --- a/src/cc-sycl/main.cpp +++ b/src/cc-sycl/main.cpp @@ -511,5 +511,6 @@ int main(int argc, char* argv[]) free(nodestatus); freeECLgraph(g); + if (!ok) return 1; return 0; } diff --git a/src/ccl-cuda/main.cu b/src/ccl-cuda/main.cu index bc72a02e7a..8d358d9f35 100644 --- a/src/ccl-cuda/main.cu +++ b/src/ccl-cuda/main.cu @@ -145,6 +145,7 @@ int main(int argc, char* argv[]) free(h_recvbuff); printf("MPI Rank %d: %s\n", mpi_rank, ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } // NCCL cleanup diff --git a/src/ccl-hip/main.cu b/src/ccl-hip/main.cu index 94b3eab58e..b27a47c200 100644 --- a/src/ccl-hip/main.cu +++ b/src/ccl-hip/main.cu @@ -145,6 +145,7 @@ int main(int argc, char* argv[]) free(h_recvbuff); printf("MPI Rank %d: %s\n", mpi_rank, ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } // NCCL cleanup diff --git a/src/ccl-sycl/main.cpp b/src/ccl-sycl/main.cpp index bc993be1c4..0cefb423b6 100644 --- a/src/ccl-sycl/main.cpp +++ b/src/ccl-sycl/main.cpp @@ -138,6 +138,7 @@ int main(int argc, char *argv[]) { free(h_recvbuff); printf("MPI Rank %d: %s\n", mpi_rank, ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } return 0; diff --git a/src/ccsd-trpdrv-cuda/main.cu b/src/ccsd-trpdrv-cuda/main.cu index 21a13d8f99..82fecd1861 100644 --- a/src/ccsd-trpdrv-cuda/main.cu +++ b/src/ccsd-trpdrv-cuda/main.cu @@ -227,5 +227,6 @@ maxed_out: free(t1v1 ); free(t1v2 ); + if (!ok) return 1; return 0; } diff --git a/src/ccsd-trpdrv-hip/Makefile.hipcl b/src/ccsd-trpdrv-hip/Makefile.hipcl index 5f7a7235dd..df34da2112 100644 --- a/src/ccsd-trpdrv-hip/Makefile.hipcl +++ b/src/ccsd-trpdrv-hip/Makefile.hipcl @@ -12,7 +12,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = test +program = main source = ccsd_tengy.cu ccsd_trpdrv.cu main.cu diff --git a/src/ccsd-trpdrv-omp/main.cpp b/src/ccsd-trpdrv-omp/main.cpp index bf3abb7c8b..9f95e6b6f8 100644 --- a/src/ccsd-trpdrv-omp/main.cpp +++ b/src/ccsd-trpdrv-omp/main.cpp @@ -226,5 +226,6 @@ int main(int argc, char* argv[]) free(t1v1 ); free(t1v2 ); + if (!ok) return 1; return 0; } diff --git a/src/ccsd-trpdrv-sycl/main.cpp b/src/ccsd-trpdrv-sycl/main.cpp index a6229e8780..d3c1cb5ddf 100644 --- a/src/ccsd-trpdrv-sycl/main.cpp +++ b/src/ccsd-trpdrv-sycl/main.cpp @@ -242,5 +242,6 @@ int main(int argc, char* argv[]) free(t1v1 ); free(t1v2 ); + if (!ok) return 1; return 0; } diff --git a/src/ced-cuda/Makefile b/src/ced-cuda/Makefile index 95be7a695b..d0d662bd87 100644 --- a/src/ced-cuda/Makefile +++ b/src/ced-cuda/Makefile @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = ced +program = main source = main.cu kernel_reference.cu diff --git a/src/ced-hip/Makefile.hipcl b/src/ced-hip/Makefile.hipcl index 27f7929192..776b489434 100644 --- a/src/ced-hip/Makefile.hipcl +++ b/src/ced-hip/Makefile.hipcl @@ -12,7 +12,7 @@ OPENCV = no # Program name & source code list #=============================================================================== -program = ced +program = main source = main.cu kernel_reference.cu diff --git a/src/chacha20-cuda/main.cu b/src/chacha20-cuda/main.cu index 0f59ea56ce..ca65c6e292 100644 --- a/src/chacha20-cuda/main.cu +++ b/src/chacha20-cuda/main.cu @@ -126,5 +126,6 @@ int main(int argc, char* argv[]) cudaFree(d_result); cudaFree(d_char_to_uint); + if (error) return 1; return 0; } diff --git a/src/chacha20-hip/main.cu b/src/chacha20-hip/main.cu index 5ee76eb1c7..3331e34f21 100644 --- a/src/chacha20-hip/main.cu +++ b/src/chacha20-hip/main.cu @@ -126,5 +126,6 @@ int main(int argc, char* argv[]) hipFree(d_result); hipFree(d_char_to_uint); + if (error) return 1; return 0; } diff --git a/src/chacha20-omp/main.cpp b/src/chacha20-omp/main.cpp index e5ee7ccdd4..daec77a219 100644 --- a/src/chacha20-omp/main.cpp +++ b/src/chacha20-omp/main.cpp @@ -107,5 +107,6 @@ int main(int argc, char* argv[]) free(raw_key); free(raw_nonce); + if (error) return 1; return 0; } diff --git a/src/chacha20-sycl/main.cpp b/src/chacha20-sycl/main.cpp index ff2c79706f..31bc161c1e 100644 --- a/src/chacha20-sycl/main.cpp +++ b/src/chacha20-sycl/main.cpp @@ -141,5 +141,6 @@ int main(int argc, char* argv[]) sycl::free(d_result, q); sycl::free(d_char_to_uint, q); + if (error) return 1; return 0; } diff --git a/src/channelSum-cuda/main.cu b/src/channelSum-cuda/main.cu index db54e0d2c4..71769d5e64 100644 --- a/src/channelSum-cuda/main.cu +++ b/src/channelSum-cuda/main.cu @@ -211,6 +211,7 @@ int main(int argc, char* argv[]) printf("Average time of channel sum (nhwc): %f (ms)\n", (time * 1e-6f) / repeat); printf("Verification %s for channel sum (nhwc)\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); ComputeChannelSumNCHW (N, C, W*H, d_X, d_sum, d_sumsq, time, repeat); @@ -220,6 +221,7 @@ int main(int argc, char* argv[]) printf("Average time of channel sum (nchw): %f (ms)\n", (time * 1e-6f) / repeat); printf("Verification %s for channel sum (nchw)\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); cudaFree(d_X); cudaFree(d_sum); diff --git a/src/channelSum-hip/main.cu b/src/channelSum-hip/main.cu index 33a8a8786c..afddafaedc 100644 --- a/src/channelSum-hip/main.cu +++ b/src/channelSum-hip/main.cu @@ -210,6 +210,7 @@ int main(int argc, char* argv[]) printf("Average time of channel sum (nhwc): %f (ms)\n", (time * 1e-6f) / repeat); printf("Verification %s for channel sum (nhwc)\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); ComputeChannelSumNCHW (N, C, W*H, d_X, d_sum, d_sumsq, time, repeat); @@ -219,6 +220,7 @@ int main(int argc, char* argv[]) printf("Average time of channel sum (nchw): %f (ms)\n", (time * 1e-6f) / repeat); printf("Verification %s for channel sum (nchw)\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); hipFree(d_X); hipFree(d_sum); diff --git a/src/channelSum-omp/main.cpp b/src/channelSum-omp/main.cpp index ad9ac2c1ea..2066052055 100644 --- a/src/channelSum-omp/main.cpp +++ b/src/channelSum-omp/main.cpp @@ -141,6 +141,7 @@ int main(int argc, char* argv[]) printf("Average time of channel sum (nhwc): %f (ms)\n", (time * 1e-6f) / repeat); printf("Verification %s for channel sum (nhwc)\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); ComputeChannelSumNCHW (N, C, W*H, h_X, h_sum, h_sumsq, time, repeat); @@ -150,6 +151,7 @@ int main(int argc, char* argv[]) printf("Average time of channel sum (nchw): %f (ms)\n", (time * 1e-6f) / repeat); printf("Verification %s for channel sum (nchw)\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } free(h_X); diff --git a/src/channelSum-sycl/main.cpp b/src/channelSum-sycl/main.cpp index 51952daec9..a34169365e 100644 --- a/src/channelSum-sycl/main.cpp +++ b/src/channelSum-sycl/main.cpp @@ -230,6 +230,7 @@ int main(int argc, char *argv[]) { printf("Average time of channel sum (nhwc): %f (ms)\n", (time * 1e-6f) / repeat); printf("Verification %s for channel sum (nhwc)\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); ComputeChannelSumNCHW (q, N, C, W*H, d_X, d_sum, d_sumsq, time, repeat); @@ -239,6 +240,7 @@ int main(int argc, char *argv[]) { printf("Average time of channel sum (nchw): %f (ms)\n", (time * 1e-6f) / repeat); printf("Verification %s for channel sum (nchw)\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); sycl::free(d_X, q); sycl::free(d_sum, q); diff --git a/src/chi2-cuda/chi2.cu b/src/chi2-cuda/chi2.cu index 001b0068ae..5d614b19c6 100644 --- a/src/chi2-cuda/chi2.cu +++ b/src/chi2-cuda/chi2.cu @@ -158,5 +158,6 @@ int main(int argc, char* argv[]) { free(h_results); free(cpu_results); + if (error) return 1; return 0; } diff --git a/src/chi2-hip/Makefile b/src/chi2-hip/Makefile index ba1e9e0405..987a468cc9 100644 --- a/src/chi2-hip/Makefile +++ b/src/chi2-hip/Makefile @@ -12,7 +12,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = chi2 +program = main source = chi2.cu diff --git a/src/chi2-hip/chi2.cu b/src/chi2-hip/chi2.cu index 9e6c201ea1..f5086ba5c3 100644 --- a/src/chi2-hip/chi2.cu +++ b/src/chi2-hip/chi2.cu @@ -158,5 +158,6 @@ int main(int argc, char* argv[]) { free(h_results); free(cpu_results); + if (error) return 1; return 0; } diff --git a/src/chi2-omp/chi2.cpp b/src/chi2-omp/chi2.cpp index 80fbee9b48..de0ec741a5 100644 --- a/src/chi2-omp/chi2.cpp +++ b/src/chi2-omp/chi2.cpp @@ -126,5 +126,6 @@ int main(int argc, char* argv[]) { free(h_results); free(cpu_results); + if (error) return 1; return 0; } diff --git a/src/chi2-sycl/chi2.cpp b/src/chi2-sycl/chi2.cpp index bf2f75354a..e3180217f9 100644 --- a/src/chi2-sycl/chi2.cpp +++ b/src/chi2-sycl/chi2.cpp @@ -158,5 +158,6 @@ int main(int argc, char* argv[]) { free(h_results); free(cpu_results); + if (error) return 1; return 0; } diff --git a/src/clenergy-hip/Makefile.hipcl b/src/clenergy-hip/Makefile.hipcl index cca1fe5b49..dd3ead97b2 100644 --- a/src/clenergy-hip/Makefile.hipcl +++ b/src/clenergy-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = clenergy +program = main source = clenergy.cu WKFUtils.cu diff --git a/src/clink-cuda/reference.h b/src/clink-cuda/reference.h index 45e0b6bba3..ac45ca6276 100644 --- a/src/clink-cuda/reference.h +++ b/src/clink-cuda/reference.h @@ -1,4 +1,5 @@ #include +#include void reference ( const float*__restrict__ d_x, @@ -77,6 +78,7 @@ void reference ( } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); free(h_y); } diff --git a/src/cmembench-cuda/main.cu b/src/cmembench-cuda/main.cu index 4a6b4b44f3..12f298b481 100644 --- a/src/cmembench-cuda/main.cu +++ b/src/cmembench-cuda/main.cu @@ -159,5 +159,6 @@ int main(int argc, char* argv[]) { free(v); + if (!(c == VECTOR_SIZE)) return 1; return 0; } diff --git a/src/cmembench-hip/main.cu b/src/cmembench-hip/main.cu index 84161bcd1a..18088a6ade 100644 --- a/src/cmembench-hip/main.cu +++ b/src/cmembench-hip/main.cu @@ -159,5 +159,6 @@ int main(int argc, char* argv[]) { free(v); + if (!(c == VECTOR_SIZE)) return 1; return 0; } diff --git a/src/columnarSolver-cuda/main.cu b/src/columnarSolver-cuda/main.cu index 78154e0ac9..63a7e72ecf 100644 --- a/src/columnarSolver-cuda/main.cu +++ b/src/columnarSolver-cuda/main.cu @@ -140,5 +140,6 @@ int main(int argc, char* argv[]) { cudaFree(devStates); delete[] decrypted; delete[] scoreHistory; + if (!pass) return 1; return 0; } diff --git a/src/columnarSolver-hip/main.cu b/src/columnarSolver-hip/main.cu index 58c7c89a9a..793b9fa8f5 100644 --- a/src/columnarSolver-hip/main.cu +++ b/src/columnarSolver-hip/main.cu @@ -140,5 +140,6 @@ int main(int argc, char* argv[]) { hipFree(devStates); delete[] decrypted; delete[] scoreHistory; + if (!pass) return 1; return 0; } diff --git a/src/columnarSolver-omp/main.cpp b/src/columnarSolver-omp/main.cpp index e7b829afb1..a16b37858d 100644 --- a/src/columnarSolver-omp/main.cpp +++ b/src/columnarSolver-omp/main.cpp @@ -140,5 +140,6 @@ int main(int argc, char* argv[]) { delete[] decrypted; delete[] scoreHistory; + if (!pass) return 1; return 0; } diff --git a/src/columnarSolver-sycl/main.cpp b/src/columnarSolver-sycl/main.cpp index a1ebbe919a..7eccebbff8 100644 --- a/src/columnarSolver-sycl/main.cpp +++ b/src/columnarSolver-sycl/main.cpp @@ -163,5 +163,6 @@ int main(int argc, char* argv[]) { sycl::free(d_states, q); delete[] decrypted; delete[] scoreHistory; + if (!pass) return 1; return 0; } diff --git a/src/complex-cuda/main.cu b/src/complex-cuda/main.cu index 4b66c71b04..6acf2cf3c1 100644 --- a/src/complex-cuda/main.cu +++ b/src/complex-cuda/main.cu @@ -107,5 +107,6 @@ int main(int argc, char* argv[]) { cudaFree(d_cs); free(cs); + if (!(complex_float_check && complex_double_check)) return 1; return 0; } diff --git a/src/complex-hip/main.cu b/src/complex-hip/main.cu index a8c1e75018..5c0849844c 100644 --- a/src/complex-hip/main.cu +++ b/src/complex-hip/main.cu @@ -107,5 +107,6 @@ int main(int argc, char* argv[]) { hipFree(d_cs); free(cs); + if (!(complex_float_check && complex_double_check)) return 1; return 0; } diff --git a/src/complex-omp/main.cpp b/src/complex-omp/main.cpp index 404eb759e5..bc92ffec6b 100644 --- a/src/complex-omp/main.cpp +++ b/src/complex-omp/main.cpp @@ -68,5 +68,6 @@ int main(int argc, char* argv[]) { free(cs); + if (!(complex_float_check && complex_double_check)) return 1; return 0; } diff --git a/src/complex-sycl/main.cpp b/src/complex-sycl/main.cpp index 9b995042b0..f9d7a47a77 100644 --- a/src/complex-sycl/main.cpp +++ b/src/complex-sycl/main.cpp @@ -135,5 +135,6 @@ int main(int argc, char* argv[]) { sycl::free(d_cs, q); free(cs); + if (!(complex_float_check && complex_double_check)) return 1; return 0; } diff --git a/src/concat-cuda/main.cu b/src/concat-cuda/main.cu index 6908e99d32..e8dd03d772 100644 --- a/src/concat-cuda/main.cu +++ b/src/concat-cuda/main.cu @@ -109,6 +109,7 @@ int main(int argc, char* argv[]) cudaMemcpy (outp, d_outp, outp_size_bytes, cudaMemcpyDeviceToHost); int error = memcmp(outp_ref, outp, outp_size_bytes); printf("%s\n", error ? "FAIL" : "PASS"); + if (error) exit(1); auto start = std::chrono::steady_clock::now(); diff --git a/src/concat-hip/main.cu b/src/concat-hip/main.cu index 88e9acd249..799d1eb868 100644 --- a/src/concat-hip/main.cu +++ b/src/concat-hip/main.cu @@ -109,6 +109,7 @@ int main(int argc, char* argv[]) hipMemcpy (outp, d_outp, outp_size_bytes, hipMemcpyDeviceToHost); int error = memcmp(outp_ref, outp, outp_size_bytes); printf("%s\n", error ? "FAIL" : "PASS"); + if (error) exit(1); auto start = std::chrono::steady_clock::now(); diff --git a/src/concat-omp/main.cpp b/src/concat-omp/main.cpp index 803496661b..5d24ade7f2 100644 --- a/src/concat-omp/main.cpp +++ b/src/concat-omp/main.cpp @@ -97,6 +97,7 @@ int main(int argc, char* argv[]) inp1, inp2, outp_ref, batch_size * beam_size * nhead, head_dim, sl1, sl2); int error = memcmp(outp_ref, outp, outp_size_bytes); printf("%s\n", error ? "FAIL" : "PASS"); + if (error) exit(1); auto start = std::chrono::steady_clock::now(); diff --git a/src/concat-sycl/main.cpp b/src/concat-sycl/main.cpp index 141abc59f6..59e781eb47 100644 --- a/src/concat-sycl/main.cpp +++ b/src/concat-sycl/main.cpp @@ -119,6 +119,7 @@ int main(int argc, char* argv[]) q.memcpy (outp, d_outp, outp_size_bytes).wait(); int error = memcmp(outp_ref, outp, outp_size_bytes); printf("%s\n", error ? "FAIL" : "PASS"); + if (error) exit(1); auto start = std::chrono::steady_clock::now(); diff --git a/src/concurrentKernels-cuda/main.cu b/src/concurrentKernels-cuda/main.cu index a75638577a..2c757b4e00 100644 --- a/src/concurrentKernels-cuda/main.cu +++ b/src/concurrentKernels-cuda/main.cu @@ -169,5 +169,6 @@ int main(int argc, char **argv) { cudaFreeHost(a); cudaFree(d_a); + if (a[0] != nkernels * sum) return 1; return 0; } diff --git a/src/concurrentKernels-hip/main.cu b/src/concurrentKernels-hip/main.cu index 59893fd598..700729e93c 100644 --- a/src/concurrentKernels-hip/main.cu +++ b/src/concurrentKernels-hip/main.cu @@ -166,5 +166,6 @@ int main(int argc, char **argv) { hipHostFree(a); hipFree(d_a); + if (a[0] != nkernels * sum) return 1; return 0; } diff --git a/src/concurrentKernels-sycl/main.cpp b/src/concurrentKernels-sycl/main.cpp index d4cc0b2dde..32c5c6c265 100644 --- a/src/concurrentKernels-sycl/main.cpp +++ b/src/concurrentKernels-sycl/main.cpp @@ -144,5 +144,6 @@ int main(int argc, char **argv) { sycl::free(a, q); sycl::free(d_a, q); + if (a[0] != nkernels * sum) return 1; return 0; } diff --git a/src/convolution1D-cuda/main.cu b/src/convolution1D-cuda/main.cu index faa705a9de..043254fdac 100644 --- a/src/convolution1D-cuda/main.cu +++ b/src/convolution1D-cuda/main.cu @@ -247,5 +247,6 @@ int main(int argc, char* argv[]) { conv1D(input_width, mask_width, repeat); } + if (!ok) return 1; return 0; } diff --git a/src/convolution1D-hip/main.cu b/src/convolution1D-hip/main.cu index 319815f029..bd175dfb20 100644 --- a/src/convolution1D-hip/main.cu +++ b/src/convolution1D-hip/main.cu @@ -247,5 +247,6 @@ int main(int argc, char* argv[]) { conv1D(input_width, mask_width, repeat); } + if (!ok) return 1; return 0; } diff --git a/src/convolution1D-omp/main.cpp b/src/convolution1D-omp/main.cpp index 3323de9131..d41b7a14b9 100644 --- a/src/convolution1D-omp/main.cpp +++ b/src/convolution1D-omp/main.cpp @@ -254,5 +254,6 @@ int main(int argc, char* argv[]) { conv1D(input_width, mask_width, repeat); } + if (!ok) return 1; return 0; } diff --git a/src/convolution1D-sycl/main.cpp b/src/convolution1D-sycl/main.cpp index 112a89ea22..caf18c2a79 100644 --- a/src/convolution1D-sycl/main.cpp +++ b/src/convolution1D-sycl/main.cpp @@ -275,5 +275,6 @@ int main(int argc, char* argv[]) { conv1D(q, input_width, mask_width, repeat); } + if (!ok) return 1; return 0; } diff --git a/src/convolution3D-cuda/main.cu b/src/convolution3D-cuda/main.cu index 6a46cb76a1..e021144a6e 100644 --- a/src/convolution3D-cuda/main.cu +++ b/src/convolution3D-cuda/main.cu @@ -295,5 +295,6 @@ int main(int argc, char* argv[]) { printf("\n========== Warmup done ==========\n"); conv3D(N, C, M, W, H, K, repeat); + if (!ok) return 1; return 0; } diff --git a/src/convolution3D-hip/main.cu b/src/convolution3D-hip/main.cu index edb14f465b..e5c7a8d98b 100644 --- a/src/convolution3D-hip/main.cu +++ b/src/convolution3D-hip/main.cu @@ -295,5 +295,6 @@ int main(int argc, char* argv[]) { printf("\n========== Warmup done ==========\n"); conv3D(N, C, M, W, H, K, repeat); + if (!ok) return 1; return 0; } diff --git a/src/convolution3D-omp/main.cpp b/src/convolution3D-omp/main.cpp index 7f5a1af593..ec0eb24124 100644 --- a/src/convolution3D-omp/main.cpp +++ b/src/convolution3D-omp/main.cpp @@ -140,5 +140,6 @@ int main(int argc, char* argv[]) { printf("\n========== Warmup done ==========\n"); conv3D(N, C, M, W, H, K, repeat); + if (!ok) return 1; return 0; } diff --git a/src/convolution3D-sycl/main.cpp b/src/convolution3D-sycl/main.cpp index d0a154b682..e4e5626740 100644 --- a/src/convolution3D-sycl/main.cpp +++ b/src/convolution3D-sycl/main.cpp @@ -312,5 +312,6 @@ int main(int argc, char* argv[]) { printf("\n========== Warmup done ==========\n"); conv3D(N, C, M, W, H, K, repeat); + if (!ok) return 1; return 0; } diff --git a/src/convolutionSeparable-cuda/main.cu b/src/convolutionSeparable-cuda/main.cu index 101aeb7565..7148ac80b1 100644 --- a/src/convolutionSeparable-cuda/main.cu +++ b/src/convolutionSeparable-cuda/main.cu @@ -120,5 +120,6 @@ int main(int argc, char **argv) cudaFree(d_Output); printf("%s\n", L2norm < 1e-6 ? "PASS" : "FAIL"); + if (L2norm >= 1e-6) exit(1); return 0; } diff --git a/src/convolutionSeparable-hip/main.cu b/src/convolutionSeparable-hip/main.cu index 86be805ec3..b66b628620 100644 --- a/src/convolutionSeparable-hip/main.cu +++ b/src/convolutionSeparable-hip/main.cu @@ -120,5 +120,6 @@ int main(int argc, char **argv) hipFree(d_Output); printf("%s\n", L2norm < 1e-6 ? "PASS" : "FAIL"); + if (L2norm >= 1e-6) exit(1); return 0; } diff --git a/src/convolutionSeparable-omp/main.cpp b/src/convolutionSeparable-omp/main.cpp index edee973c31..21879112e0 100644 --- a/src/convolutionSeparable-omp/main.cpp +++ b/src/convolutionSeparable-omp/main.cpp @@ -102,5 +102,6 @@ int main(int argc, char **argv) free(h_Kernel); printf("%s\n", L2norm < 1e-6 ? "PASS" : "FAIL"); + if (L2norm >= 1e-6) exit(1); return 0; } diff --git a/src/convolutionSeparable-sycl/main.cpp b/src/convolutionSeparable-sycl/main.cpp index 62d2161149..2cff5e5c19 100644 --- a/src/convolutionSeparable-sycl/main.cpp +++ b/src/convolutionSeparable-sycl/main.cpp @@ -129,5 +129,6 @@ int main(int argc, char **argv) sycl::free(d_Kernel, q); printf("%s\n", L2norm < 1e-6 ? "PASS" : "FAIL"); + if (L2norm >= 1e-6) exit(1); return 0; } diff --git a/src/cooling-cuda/main.cu b/src/cooling-cuda/main.cu index 103563e1dc..ba67b2c27d 100644 --- a/src/cooling-cuda/main.cu +++ b/src/cooling-cuda/main.cu @@ -189,5 +189,6 @@ int main(int argc, char* argv[]) free(T); free(r); free(h_r); + if (error) return 1; return 0; } diff --git a/src/cooling-hip/main.cu b/src/cooling-hip/main.cu index f51fd3a45f..f6f2de8662 100644 --- a/src/cooling-hip/main.cu +++ b/src/cooling-hip/main.cu @@ -189,5 +189,6 @@ int main(int argc, char* argv[]) free(T); free(r); free(h_r); + if (error) return 1; return 0; } diff --git a/src/cooling-omp/main.cpp b/src/cooling-omp/main.cpp index 01463f6069..8ac13188b0 100644 --- a/src/cooling-omp/main.cpp +++ b/src/cooling-omp/main.cpp @@ -179,5 +179,6 @@ int main(int argc, char* argv[]) free(T); free(h_r); free(d_r); + if (error) return 1; return 0; } diff --git a/src/cooling-sycl/main.cpp b/src/cooling-sycl/main.cpp index ad681bb9ea..cd3e059253 100644 --- a/src/cooling-sycl/main.cpp +++ b/src/cooling-sycl/main.cpp @@ -224,5 +224,6 @@ int main(int argc, char* argv[]) free(T); free(r); free(h_r); + if (error) return 1; return 0; } diff --git a/src/coordinates-cuda/main.cu b/src/coordinates-cuda/main.cu index 7d1653f184..d8ff22eeee 100644 --- a/src/coordinates-cuda/main.cu +++ b/src/coordinates-cuda/main.cu @@ -59,6 +59,7 @@ void coordinates_transform(const int num_coords, const int repeat) } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } int main(int argc, char* argv[]) diff --git a/src/coordinates-hip/main.cu b/src/coordinates-hip/main.cu index e92eea6092..eb61a2506c 100644 --- a/src/coordinates-hip/main.cu +++ b/src/coordinates-hip/main.cu @@ -59,6 +59,7 @@ void coordinates_transform(const int num_coords, const int repeat) } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } int main(int argc, char* argv[]) diff --git a/src/coordinates-sycl/main.cpp b/src/coordinates-sycl/main.cpp index c017306b9b..058f1b0d37 100644 --- a/src/coordinates-sycl/main.cpp +++ b/src/coordinates-sycl/main.cpp @@ -69,6 +69,7 @@ void coordinates_transform(sycl::queue &q, const int num_coords, const int repea } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } int main(int argc, char* argv[]) diff --git a/src/cross-cuda/main.cu b/src/cross-cuda/main.cu index 6a5fa81e4b..08e413d012 100644 --- a/src/cross-cuda/main.cu +++ b/src/cross-cuda/main.cu @@ -212,5 +212,6 @@ int main(int argc, char* argv[]) printf("=========== Data type is FP64 ==========\n"); eval(nrows, repeat); + if (!ok) return 1; return 0; } diff --git a/src/cross-hip/main.cu b/src/cross-hip/main.cu index 28faa98a9b..40eded546d 100644 --- a/src/cross-hip/main.cu +++ b/src/cross-hip/main.cu @@ -212,5 +212,6 @@ int main(int argc, char* argv[]) printf("=========== Data type is FP64 ==========\n"); eval(nrows, repeat); + if (!ok) return 1; return 0; } diff --git a/src/cross-omp/main.cpp b/src/cross-omp/main.cpp index b64dc198b2..f8327d23d2 100644 --- a/src/cross-omp/main.cpp +++ b/src/cross-omp/main.cpp @@ -191,5 +191,6 @@ int main(int argc, char* argv[]) printf("=========== Data type is FP64 ==========\n"); eval(nrows, repeat); + if (!ok) return 1; return 0; } diff --git a/src/cross-sycl/main.cpp b/src/cross-sycl/main.cpp index b2108bedd9..c1ad2fce97 100644 --- a/src/cross-sycl/main.cpp +++ b/src/cross-sycl/main.cpp @@ -245,5 +245,6 @@ int main(int argc, char* argv[]) printf("=========== Data type is FP64 ==========\n"); eval(nrows, repeat); + if (!ok) return 1; return 0; } diff --git a/src/crossEntropy-cuda/main.cu b/src/crossEntropy-cuda/main.cu index 06d4a6baa2..0e9c6fa0fe 100644 --- a/src/crossEntropy-cuda/main.cu +++ b/src/crossEntropy-cuda/main.cu @@ -304,18 +304,21 @@ int main(int argc, char** argv) { LossNLL_BWD<__half, __half>(repeat); printf("%s\n", (errors == 0) ? "PASS" : "FAIL"); + if (!(errors == 0)) exit(1); printf("=========== Data type is FP32 ==========\n"); LossNLL_BWD(repeat); printf("%s\n", (errors == 0) ? "PASS" : "FAIL"); + if (!(errors == 0)) exit(1); printf("=========== Data type is FP64 ==========\n"); LossNLL_BWD(repeat); printf("%s\n", (errors == 0) ? "PASS" : "FAIL"); + if (!(errors == 0)) exit(1); return 0; } diff --git a/src/crossEntropy-hip/main.cu b/src/crossEntropy-hip/main.cu index eb57d1c59b..7667622752 100644 --- a/src/crossEntropy-hip/main.cu +++ b/src/crossEntropy-hip/main.cu @@ -304,18 +304,21 @@ int main(int argc, char** argv) { LossNLL_BWD<__half, __half>(repeat); printf("%s\n", (errors == 0) ? "PASS" : "FAIL"); + if (!(errors == 0)) exit(1); printf("=========== Data type is FP32 ==========\n"); LossNLL_BWD(repeat); printf("%s\n", (errors == 0) ? "PASS" : "FAIL"); + if (!(errors == 0)) exit(1); printf("=========== Data type is FP64 ==========\n"); LossNLL_BWD(repeat); printf("%s\n", (errors == 0) ? "PASS" : "FAIL"); + if (!(errors == 0)) exit(1); return 0; } diff --git a/src/crossEntropy-sycl/main.cpp b/src/crossEntropy-sycl/main.cpp index ded0f60538..d3ebea326d 100644 --- a/src/crossEntropy-sycl/main.cpp +++ b/src/crossEntropy-sycl/main.cpp @@ -297,18 +297,21 @@ int main(int argc, char** argv) { LossNLL_BWD(q, repeat); printf("%s\n", (errors == 0) ? "PASS" : "FAIL"); + if (!(errors == 0)) exit(1); printf("=========== Data type is FP32 ==========\n"); LossNLL_BWD(q, repeat); printf("%s\n", (errors == 0) ? "PASS" : "FAIL"); + if (!(errors == 0)) exit(1); printf("=========== Data type is FP64 ==========\n"); LossNLL_BWD(q, repeat); printf("%s\n", (errors == 0) ? "PASS" : "FAIL"); + if (!(errors == 0)) exit(1); return 0; } diff --git a/src/damage-cuda/reference.h b/src/damage-cuda/reference.h index 647f2a6bc2..00ae6c8c06 100644 --- a/src/damage-cuda/reference.h +++ b/src/damage-cuda/reference.h @@ -1,4 +1,5 @@ #include +#include void validate ( const int block_size, @@ -36,6 +37,7 @@ void validate ( } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); free(damage_ref); free(n_neigh_ref); diff --git a/src/dct8x8-cuda/main.cu b/src/dct8x8-cuda/main.cu index f3686f55a7..fb78ff01bb 100644 --- a/src/dct8x8-cuda/main.cu +++ b/src/dct8x8-cuda/main.cu @@ -139,5 +139,6 @@ int main(int argc, char **argv) free(h_OutputCPU); free(h_Input); + if (L2norm >= 1E-6) return 1; return 0; } diff --git a/src/dct8x8-hip/main.cu b/src/dct8x8-hip/main.cu index 3bb863d1fd..ca87f4cf06 100644 --- a/src/dct8x8-hip/main.cu +++ b/src/dct8x8-hip/main.cu @@ -139,5 +139,6 @@ int main(int argc, char **argv) free(h_OutputCPU); free(h_Input); + if (L2norm >= 1E-6) return 1; return 0; } diff --git a/src/dct8x8-omp/main.cpp b/src/dct8x8-omp/main.cpp index 7b10359241..6daf94a0ba 100644 --- a/src/dct8x8-omp/main.cpp +++ b/src/dct8x8-omp/main.cpp @@ -131,5 +131,6 @@ int main(int argc, char **argv) free(h_OutputCPU); free(h_Input); + if (L2norm >= 1E-6) return 1; return 0; } diff --git a/src/dct8x8-sycl/main.cpp b/src/dct8x8-sycl/main.cpp index ea1e6da405..f5db112df3 100644 --- a/src/dct8x8-sycl/main.cpp +++ b/src/dct8x8-sycl/main.cpp @@ -144,5 +144,6 @@ int main(int argc, char **argv) sycl::free(d_Output, q); sycl::free(d_Input, q); + if (L2norm >= 1E-6) return 1; return 0; } diff --git a/src/degrid-cuda/main.cu b/src/degrid-cuda/main.cu index 20cff4a348..7937edf995 100644 --- a/src/degrid-cuda/main.cu +++ b/src/degrid-cuda/main.cu @@ -139,5 +139,6 @@ int main(void) { free(img); free(gcf); + if (!ok) return 1; return 0; } diff --git a/src/degrid-hip/main.cu b/src/degrid-hip/main.cu index 40511522ff..89bda581c0 100644 --- a/src/degrid-hip/main.cu +++ b/src/degrid-hip/main.cu @@ -139,5 +139,6 @@ int main(void) { free(img); free(gcf); + if (!ok) return 1; return 0; } diff --git a/src/degrid-omp/main.cpp b/src/degrid-omp/main.cpp index 7d747f6428..79ef2be988 100644 --- a/src/degrid-omp/main.cpp +++ b/src/degrid-omp/main.cpp @@ -139,5 +139,6 @@ int main(void) { free(img); free(gcf); + if (!ok) return 1; return 0; } diff --git a/src/degrid-sycl/main.cpp b/src/degrid-sycl/main.cpp index 22d32b626b..e0bb9c620a 100644 --- a/src/degrid-sycl/main.cpp +++ b/src/degrid-sycl/main.cpp @@ -135,5 +135,6 @@ int main(void) { free(img); free(gcf); + if (!ok) return 1; return 0; } diff --git a/src/dense-embedding-cuda/main.cu b/src/dense-embedding-cuda/main.cu index 0833887bec..d3512d2229 100644 --- a/src/dense-embedding-cuda/main.cu +++ b/src/dense-embedding-cuda/main.cu @@ -229,5 +229,6 @@ int main(int argc, char* argv[]) free(input_offset); } + if (!ok) return 1; return 0; } diff --git a/src/dense-embedding-hip/main.cu b/src/dense-embedding-hip/main.cu index 82bac775a4..e3ddb855d7 100644 --- a/src/dense-embedding-hip/main.cu +++ b/src/dense-embedding-hip/main.cu @@ -229,5 +229,6 @@ int main(int argc, char* argv[]) free(input_offset); } + if (!ok) return 1; return 0; } diff --git a/src/dense-embedding-omp/main.cpp b/src/dense-embedding-omp/main.cpp index 339237cf26..0f851a6752 100644 --- a/src/dense-embedding-omp/main.cpp +++ b/src/dense-embedding-omp/main.cpp @@ -191,5 +191,6 @@ int main(int argc, char* argv[]) free(offset); } + if (!ok) return 1; return 0; } diff --git a/src/dense-embedding-sycl/main.cpp b/src/dense-embedding-sycl/main.cpp index a8e75d4c63..d9799a2b80 100644 --- a/src/dense-embedding-sycl/main.cpp +++ b/src/dense-embedding-sycl/main.cpp @@ -261,5 +261,6 @@ int main(int argc, char* argv[]) free(input_offset); } + if (!ok) return 1; return 0; } diff --git a/src/diamond-hip/Makefile.hipcl b/src/diamond-hip/Makefile.hipcl index b7a35cb2cf..338dbfac0f 100644 --- a/src/diamond-hip/Makefile.hipcl +++ b/src/diamond-hip/Makefile.hipcl @@ -12,7 +12,7 @@ DMND_PATH = ../diamond-sycl # Program name & source code list #=============================================================================== -program = diamond +program = main c_src = \ $(DMND_PATH)/src/blast/sm_blosum45.c \ diff --git a/src/diamond-omp/Makefile.aomp b/src/diamond-omp/Makefile.aomp index 045be9e4a3..c6064249d4 100644 --- a/src/diamond-omp/Makefile.aomp +++ b/src/diamond-omp/Makefile.aomp @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = diamond +program = main c_src= \ $(DMND_PATH)/src/blast/sm_blosum45.c \ diff --git a/src/diamond-omp/Makefile.nvc b/src/diamond-omp/Makefile.nvc index e3aa4b50b0..69c41d5240 100644 --- a/src/diamond-omp/Makefile.nvc +++ b/src/diamond-omp/Makefile.nvc @@ -15,7 +15,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = diamond +program = main c_src= \ $(DMND_PATH)/src/blast/sm_blosum45.c \ diff --git a/src/divergence-hip/Makefile.hipcl b/src/divergence-hip/Makefile.hipcl index 98c9f478e4..09e5bf19de 100644 --- a/src/divergence-hip/Makefile.hipcl +++ b/src/divergence-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = divergence +program = main #=============================================================================== diff --git a/src/divergence-omp/Makefile.aomp b/src/divergence-omp/Makefile.aomp index 3c2a345139..87c0991567 100644 --- a/src/divergence-omp/Makefile.aomp +++ b/src/divergence-omp/Makefile.aomp @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = divergence +program = main #=============================================================================== diff --git a/src/divergence-omp/Makefile.nvc b/src/divergence-omp/Makefile.nvc index c190c09898..333f42280f 100644 --- a/src/divergence-omp/Makefile.nvc +++ b/src/divergence-omp/Makefile.nvc @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = divergence +program = main #=============================================================================== diff --git a/src/dp-cuda/main.cu b/src/dp-cuda/main.cu index 30b5451423..b66dedad26 100644 --- a/src/dp-cuda/main.cu +++ b/src/dp-cuda/main.cu @@ -217,5 +217,8 @@ int main(int argc, char **argv) printf("------------- Data type is Float64 ---------------\n"); dot(iNumElements, iNumIterations); + if (dst != dst_ref) return 1; + if (dst != dst_ref) return 1; + if (dst != dst_ref) return 1; return EXIT_SUCCESS; } diff --git a/src/dp-hip/main.cu b/src/dp-hip/main.cu index 93417a5a6b..d37ede8e48 100644 --- a/src/dp-hip/main.cu +++ b/src/dp-hip/main.cu @@ -218,5 +218,8 @@ int main(int argc, char **argv) printf("------------- Data type is Float64 ---------------\n"); dot(iNumElements, iNumIterations); + if (dst != dst_ref) return 1; + if (dst != dst_ref) return 1; + if (dst != dst_ref) return 1; return EXIT_SUCCESS; } diff --git a/src/dp-omp/main.cpp b/src/dp-omp/main.cpp index 76d43a2ac2..df9f3a6fa8 100644 --- a/src/dp-omp/main.cpp +++ b/src/dp-omp/main.cpp @@ -112,5 +112,6 @@ int main(int argc, char **argv) printf("------------- Data type is Float64 ---------------\n"); dot(iNumElements, iNumIterations); + if (dst != dst_ref) return 1; return EXIT_SUCCESS; } diff --git a/src/dp-sycl/main.cpp b/src/dp-sycl/main.cpp index 4ef0090d1b..1a86be4a57 100644 --- a/src/dp-sycl/main.cpp +++ b/src/dp-sycl/main.cpp @@ -179,5 +179,8 @@ int main(int argc, char **argv) dot(iNumElements, iNumIterations); printf("------------- Data type is Float64 ---------------\n"); dot(iNumElements, iNumIterations); + if (dst != dst_ref) return 1; + if (dst != dst_ref) return 1; + if (dst != dst_ref) return 1; return EXIT_SUCCESS; } diff --git a/src/dp4a-cuda/main.cu b/src/dp4a-cuda/main.cu index 72b8f290bb..acd330ebcc 100644 --- a/src/dp4a-cuda/main.cu +++ b/src/dp4a-cuda/main.cu @@ -201,5 +201,7 @@ int main(int argc, char **argv) printf("------------- Data type is uint32 ---------------\n"); dot(iNumElements, iNumIterations); + if (dst_dev != M * dst_ref) return 1; + if (dst_dev != M * dst_ref) return 1; return EXIT_SUCCESS; } diff --git a/src/dp4a-hip/main.cu b/src/dp4a-hip/main.cu index c4a5b88dc8..b76c403856 100644 --- a/src/dp4a-hip/main.cu +++ b/src/dp4a-hip/main.cu @@ -245,5 +245,7 @@ int main(int argc, char **argv) printf("------------- Data type is uint32 ---------------\n"); dot(iNumElements, iNumIterations); + if (dst_dev != M * dst_ref) return 1; + if (dst_dev != M * dst_ref) return 1; return EXIT_SUCCESS; } diff --git a/src/dp4a-sycl/main.cpp b/src/dp4a-sycl/main.cpp index fe62c3b750..e07e071734 100644 --- a/src/dp4a-sycl/main.cpp +++ b/src/dp4a-sycl/main.cpp @@ -208,5 +208,7 @@ int main(int argc, char **argv) printf("------------- Data type is uint32 ---------------\n"); dot(q, iNumElements, iNumIterations); + if (dst_dev != M * dst_ref) return 1; + if (dst_dev != M * dst_ref) return 1; return EXIT_SUCCESS; } diff --git a/src/dxtc2-cuda/main.cu b/src/dxtc2-cuda/main.cu index 4c92a7c599..4daa45a09c 100644 --- a/src/dxtc2-cuda/main.cu +++ b/src/dxtc2-cuda/main.cu @@ -764,6 +764,7 @@ int main(int argc, char **argv) { printf("RMS(reference, result) = %f\n\n", rms); printf(rms <= ERROR_THRESHOLD ? "PASS\n" : "FAIL\n"); + if (rms > ERROR_THRESHOLD) exit(1); /* Return zero if test passed, one otherwise */ return rms > ERROR_THRESHOLD; } diff --git a/src/dxtc2-hip/main.cu b/src/dxtc2-hip/main.cu index 4414625d33..e4ab4ecab1 100644 --- a/src/dxtc2-hip/main.cu +++ b/src/dxtc2-hip/main.cu @@ -763,6 +763,7 @@ int main(int argc, char **argv) { printf("RMS(reference, result) = %f\n\n", rms); printf(rms <= ERROR_THRESHOLD ? "PASS\n" : "FAIL\n"); + if (rms > ERROR_THRESHOLD) exit(1); /* Return zero if test passed, one otherwise */ return rms > ERROR_THRESHOLD; } diff --git a/src/dxtc2-omp/main.cpp b/src/dxtc2-omp/main.cpp index 4b41e79e9e..aaa8a3548b 100644 --- a/src/dxtc2-omp/main.cpp +++ b/src/dxtc2-omp/main.cpp @@ -255,6 +255,7 @@ int main(int argc, char** argv) printf("PASS\n"); else printf("FAIL\n"); + if (rms > ERROR_THRESHOLD) exit(1); return 0; } diff --git a/src/dxtc2-sycl/main.cpp b/src/dxtc2-sycl/main.cpp index 0caef16a46..f74dd552f1 100644 --- a/src/dxtc2-sycl/main.cpp +++ b/src/dxtc2-sycl/main.cpp @@ -373,6 +373,7 @@ int main(int argc, char** argv) printf("PASS\n"); else printf("FAIL\n"); + if (rms > ERROR_THRESHOLD) exit(1); return 0; } diff --git a/src/ecdh-cuda/main.cu b/src/ecdh-cuda/main.cu index ead1e081d7..995ac4f5a6 100644 --- a/src/ecdh-cuda/main.cu +++ b/src/ecdh-cuda/main.cu @@ -78,5 +78,6 @@ int main(int argc, char **argv) free(pk_slow_y); free(pk_fast_x); free(pk_fast_y); + if ((fail_pk_x || fail_pk_y)) return 1; return 0; } diff --git a/src/ecdh-hip/main.cu b/src/ecdh-hip/main.cu index 1f40bf8511..acb2499a59 100644 --- a/src/ecdh-hip/main.cu +++ b/src/ecdh-hip/main.cu @@ -78,5 +78,6 @@ int main(int argc, char **argv) free(pk_slow_y); free(pk_fast_x); free(pk_fast_y); + if ((fail_pk_x || fail_pk_y)) return 1; return 0; } diff --git a/src/ecdh-omp/main.cpp b/src/ecdh-omp/main.cpp index a455e16930..49c9a9ba58 100644 --- a/src/ecdh-omp/main.cpp +++ b/src/ecdh-omp/main.cpp @@ -65,5 +65,6 @@ int main(int argc, char **argv) free(pk_slow_y); free(pk_fast_x); free(pk_fast_y); + if ((fail_pk_x || fail_pk_y)) return 1; return 0; } diff --git a/src/ecdh-sycl/main.cpp b/src/ecdh-sycl/main.cpp index 5557fda039..dd06f8eec3 100644 --- a/src/ecdh-sycl/main.cpp +++ b/src/ecdh-sycl/main.cpp @@ -103,5 +103,6 @@ int main(int argc, char **argv) free(pk_slow_y); free(pk_fast_x); free(pk_fast_y); + if ((fail_pk_x || fail_pk_y)) return 1; return 0; } diff --git a/src/eigenvalue-cuda/main.cu b/src/eigenvalue-cuda/main.cu index aaf02b829b..a64fd747dd 100644 --- a/src/eigenvalue-cuda/main.cu +++ b/src/eigenvalue-cuda/main.cu @@ -263,6 +263,7 @@ int main(int argc, char * argv[]) else { std::cout<<"FAIL\n" << std::endl; + exit(1); } // release program resources diff --git a/src/eigenvalue-hip/main.cu b/src/eigenvalue-hip/main.cu index fe242ea081..f2d5602c51 100644 --- a/src/eigenvalue-hip/main.cu +++ b/src/eigenvalue-hip/main.cu @@ -263,6 +263,7 @@ int main(int argc, char * argv[]) else { std::cout<<"FAIL\n" << std::endl; + exit(1); } // release program resources diff --git a/src/eigenvalue-omp/main.cpp b/src/eigenvalue-omp/main.cpp index 586f6c8667..1ee7203604 100644 --- a/src/eigenvalue-omp/main.cpp +++ b/src/eigenvalue-omp/main.cpp @@ -264,6 +264,7 @@ int main(int argc, char * argv[]) else { std::cout<<"FAIL\n" << std::endl; + exit(1); } // release program resources diff --git a/src/eigenvalue-sycl/main.cpp b/src/eigenvalue-sycl/main.cpp index eea67ce2da..2b62f999da 100644 --- a/src/eigenvalue-sycl/main.cpp +++ b/src/eigenvalue-sycl/main.cpp @@ -285,6 +285,7 @@ int main(int argc, char * argv[]) else { std::cout<<"FAIL\n" << std::endl; + exit(1); } // release program resources diff --git a/src/entropy-cuda/main.cu b/src/entropy-cuda/main.cu index 1ed49f2aa9..fe5c058460 100644 --- a/src/entropy-cuda/main.cu +++ b/src/entropy-cuda/main.cu @@ -170,5 +170,6 @@ int main(int argc, char* argv[]) { free(input); free(output); free(output_ref); + if (!ok) return 1; return 0; } diff --git a/src/entropy-hip/main.cu b/src/entropy-hip/main.cu index 0d9845d6e1..9e87ba4013 100644 --- a/src/entropy-hip/main.cu +++ b/src/entropy-hip/main.cu @@ -167,5 +167,6 @@ int main(int argc, char* argv[]) { free(input); free(output); free(output_ref); + if (!ok) return 1; return 0; } diff --git a/src/entropy-omp/main.cpp b/src/entropy-omp/main.cpp index 273fb27df9..6cd80ea466 100644 --- a/src/entropy-omp/main.cpp +++ b/src/entropy-omp/main.cpp @@ -160,5 +160,6 @@ int main(int argc, char* argv[]) { free(input); free(output); free(output_ref); + if (!ok) return 1; return 0; } diff --git a/src/entropy-sycl/main.cpp b/src/entropy-sycl/main.cpp index 3fd3bee008..e4c2f2af35 100644 --- a/src/entropy-sycl/main.cpp +++ b/src/entropy-sycl/main.cpp @@ -163,5 +163,6 @@ int main(int argc, char* argv[]) { free(input); free(output); free(output_ref); + if (!ok) return 1; return 0; } diff --git a/src/epistasis-cuda/main.cu b/src/epistasis-cuda/main.cu index 64267c8afe..c9afa4c8c4 100644 --- a/src/epistasis-cuda/main.cu +++ b/src/epistasis-cuda/main.cu @@ -8,6 +8,7 @@ #include #include #include "reference.h" +#include using namespace std::chrono; typedef high_resolution_clock myclock; @@ -365,5 +366,6 @@ int main(int argc, char **argv) mem_free(SNP_Data); mem_free(SNP_Data_trans); mem_free(Ph_Data); + if (!ok) return 1; return 0; } diff --git a/src/epistasis-hip/main.cu b/src/epistasis-hip/main.cu index 8ef7f959fa..cdb3efc277 100644 --- a/src/epistasis-hip/main.cu +++ b/src/epistasis-hip/main.cu @@ -8,6 +8,7 @@ #include #include #include "reference.h" +#include using namespace std::chrono; typedef high_resolution_clock myclock; @@ -365,5 +366,6 @@ int main(int argc, char **argv) mem_free(SNP_Data); mem_free(SNP_Data_trans); mem_free(Ph_Data); + if (!ok) return 1; return 0; } diff --git a/src/epistasis-omp/main.cpp b/src/epistasis-omp/main.cpp index aa6ff83193..0baa245e11 100644 --- a/src/epistasis-omp/main.cpp +++ b/src/epistasis-omp/main.cpp @@ -5,6 +5,7 @@ #include #include #include "reference.h" +#include using namespace std::chrono; typedef high_resolution_clock myclock; @@ -322,6 +323,7 @@ int main(int argc, char **argv) bool ok = (p1 == p2) && (fabsf(scores[p1] - scores_ref[p2]) < 1e-3f); std::cout << (ok ? "PASS" : "FAIL") << std::endl; + if (!ok) exit(1); mem_free(bin_data_zeros); mem_free(bin_data_ones); diff --git a/src/epistasis-sycl/main.cpp b/src/epistasis-sycl/main.cpp index e840e574ea..aa21bdf8dd 100644 --- a/src/epistasis-sycl/main.cpp +++ b/src/epistasis-sycl/main.cpp @@ -4,6 +4,7 @@ #include #include #include "reference.h" +#include using namespace std::chrono; typedef high_resolution_clock myclock; @@ -366,5 +367,6 @@ int main(int argc, char **argv) mem_free(SNP_Data); mem_free(SNP_Data_trans); mem_free(Ph_Data); + if (!ok) return 1; return 0; } diff --git a/src/f16max-cuda/main.cu b/src/f16max-cuda/main.cu index 5b139363ea..12562985c6 100644 --- a/src/f16max-cuda/main.cu +++ b/src/f16max-cuda/main.cu @@ -162,5 +162,7 @@ int main(int argc, char *argv[]) free(b); free(r); + if (!ok) return 1; + if (!ok) return 1; return EXIT_SUCCESS; } diff --git a/src/f16max-hip/main.cu b/src/f16max-hip/main.cu index 57c9773779..726dd7da4e 100644 --- a/src/f16max-hip/main.cu +++ b/src/f16max-hip/main.cu @@ -162,5 +162,7 @@ int main(int argc, char *argv[]) free(b); free(r); + if (!ok) return 1; + if (!ok) return 1; return EXIT_SUCCESS; } diff --git a/src/f16max-sycl/main.cpp b/src/f16max-sycl/main.cpp index 4e96a13ca0..d40d264ff1 100644 --- a/src/f16max-sycl/main.cpp +++ b/src/f16max-sycl/main.cpp @@ -205,5 +205,7 @@ int main(int argc, char *argv[]) free(b); free(r); + if (!ok) return 1; + if (!ok) return 1; return EXIT_SUCCESS; } diff --git a/src/f8cast-cuda/main.cu b/src/f8cast-cuda/main.cu index b1273742b3..f631a80b89 100644 --- a/src/f8cast-cuda/main.cu +++ b/src/f8cast-cuda/main.cu @@ -6,6 +6,7 @@ #include #include "kernels.h" #include "utils.h" +#include #define CUDA_CHECK(ans) \ { \ @@ -133,5 +134,6 @@ int main(int argc, char* argv[]) { printf("float -> fp8 E5M2\n"); convert(false, nelems, niters); + if (!ok) return 1; return 0; } diff --git a/src/f8cast-hip/main.cu b/src/f8cast-hip/main.cu index 2f4770ad11..4aeaa68f2a 100644 --- a/src/f8cast-hip/main.cu +++ b/src/f8cast-hip/main.cu @@ -6,6 +6,7 @@ #include #include "kernels.h" #include "utils.h" +#include #define HIP_CHECK(ans) \ { \ @@ -133,5 +134,6 @@ int main(int argc, char* argv[]) { printf("float -> fp8 E5M2\n"); convert(false, nelems, niters); + if (!ok) return 1; return 0; } diff --git a/src/f8cast-sycl/main.cpp b/src/f8cast-sycl/main.cpp index eff5dd65f1..2b5ecdcff5 100644 --- a/src/f8cast-sycl/main.cpp +++ b/src/f8cast-sycl/main.cpp @@ -5,6 +5,7 @@ #include #include "kernels.h" #include "utils.h" +#include template void convert(sycl::queue &q, bool isE4M3, int nelems, int niters) @@ -138,5 +139,6 @@ int main(int argc, char* argv[]) { printf("float -> fp8 E5M2\n"); convert(q, false, nelems, niters); + if (!ok) return 1; return 0; } diff --git a/src/face-cuda/Makefile b/src/face-cuda/Makefile index 84051da283..8bba86dec4 100644 --- a/src/face-cuda/Makefile +++ b/src/face-cuda/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = vj-cpu vj-gpu +program = main vj-cpu #=============================================================================== # Sets Flags @@ -64,7 +64,7 @@ rectangles.o: rectangles.cu $(HEADERS) vj-cpu: main.o haar-cpu.o image.o stdio-wrapper.o rectangles.o $(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS) -vj-gpu: main.o haar-gpu.o image.o stdio-wrapper.o rectangles.o +main: main.o haar-gpu.o image.o stdio-wrapper.o rectangles.o $(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS) clean: @@ -72,4 +72,4 @@ clean: run: build $(LAUNCHER) ./vj-cpu Face.pgm info.txt class.txt Output-cpu.pgm - $(LAUNCHER) ./vj-gpu Face.pgm info.txt class.txt Output-gpu.pgm + $(LAUNCHER) ./main Face.pgm info.txt class.txt Output-gpu.pgm diff --git a/src/face-hip/Makefile b/src/face-hip/Makefile index 53562629d7..a6c8a1df91 100644 --- a/src/face-hip/Makefile +++ b/src/face-hip/Makefile @@ -12,7 +12,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = vj-cpu vj-gpu +program = main vj-cpu #=============================================================================== # Sets Flags @@ -63,7 +63,7 @@ rectangles.o: ../face-cuda/rectangles.cu $(HEADERS) vj-cpu: main.o haar-cpu.o image.o stdio-wrapper.o rectangles.o $(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS) -vj-gpu: main.o haar-gpu.o image.o stdio-wrapper.o rectangles.o +main: main.o haar-gpu.o image.o stdio-wrapper.o rectangles.o $(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS) clean: @@ -71,4 +71,4 @@ clean: run: build $(LAUNCHER) ./vj-cpu ../face-cuda/Face.pgm ../face-cuda/info.txt ../face-cuda/class.txt Output-cpu.pgm - $(LAUNCHER) ./vj-gpu ../face-cuda/Face.pgm ../face-cuda/info.txt ../face-cuda/class.txt Output-gpu.pgm + $(LAUNCHER) ./main ../face-cuda/Face.pgm ../face-cuda/info.txt ../face-cuda/class.txt Output-gpu.pgm diff --git a/src/face-omp/Makefile b/src/face-omp/Makefile index fa5821f2c4..a85b2f9efc 100644 --- a/src/face-omp/Makefile +++ b/src/face-omp/Makefile @@ -12,7 +12,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = vj-cpu vj-gpu +program = main vj-cpu #=============================================================================== # Sets Flags @@ -64,7 +64,7 @@ rectangles.o: ../face-sycl/rectangles.cpp $(HEADERS) vj-cpu: main.o haar-cpu.o image.o stdio-wrapper.o rectangles.o $(CC) $(CFLAGS) -o $@ $+ -vj-gpu: main.o haar-gpu.o image.o stdio-wrapper.o rectangles.o +main: main.o haar-gpu.o image.o stdio-wrapper.o rectangles.o $(CC) $(CFLAGS) $(OMP_TARGET_FLAGS) -o $@ $+ clean: @@ -72,4 +72,4 @@ clean: run: build $(LAUNCHER) ./vj-cpu ../face-cuda/Face.pgm ../face-cuda/info.txt ../face-cuda/class.txt Output-cpu.pgm - $(LAUNCHER) ./vj-gpu ../face-cuda/Face.pgm ../face-cuda/info.txt ../face-cuda/class.txt Output-gpu.pgm + $(LAUNCHER) ./main ../face-cuda/Face.pgm ../face-cuda/info.txt ../face-cuda/class.txt Output-gpu.pgm diff --git a/src/face-omp/Makefile.aomp b/src/face-omp/Makefile.aomp index bd07e2bc45..ad83f2de1b 100644 --- a/src/face-omp/Makefile.aomp +++ b/src/face-omp/Makefile.aomp @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = vj-cpu vj-gpu +program = main vj-cpu #=============================================================================== # Sets Flags @@ -69,12 +69,12 @@ rectangles.o: ../face-sycl/rectangles.cpp $(HEADERS) vj-cpu: main.o haar-cpu.o image.o stdio-wrapper.o rectangles.o $(CC) $(CFLAGS) -o $@ $+ -vj-gpu: main.o haar-gpu.o image.o stdio-wrapper.o rectangles.o - $(CC) $(CFLAGS) $(OMP_TARGET_FLAGS) -o $@ $+ +main: main.o haar-gpu.o image.o stdio-wrapper.o rectangles.o + $(CC) $(CFLAGS) $(OMP_TARGET_FLAGS) -o $@ $+ clean: rm -f $(program) *.o Output-cpu.pgm Output-gpu.pgm run: build $(LAUNCHER) ./vj-cpu ../face-cuda/Face.pgm ../face-cuda/info.txt ../face-cuda/class.txt Output-cpu.pgm - $(LAUNCHER) ./vj-gpu ../face-cuda/Face.pgm ../face-cuda/info.txt ../face-cuda/class.txt Output-gpu.pgm + $(LAUNCHER) ./main ../face-cuda/Face.pgm ../face-cuda/info.txt ../face-cuda/class.txt Output-gpu.pgm diff --git a/src/face-omp/Makefile.nvc b/src/face-omp/Makefile.nvc index 25d6ec9049..1693db9486 100644 --- a/src/face-omp/Makefile.nvc +++ b/src/face-omp/Makefile.nvc @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = vj-cpu vj-gpu +program = main vj-cpu #=============================================================================== # Sets Flags @@ -63,7 +63,7 @@ rectangles.o: ../face-sycl/rectangles.cpp $(HEADERS) vj-cpu: main.o haar-cpu.o image.o stdio-wrapper.o rectangles.o $(CC) $(CFLAGS) -o $@ $+ -vj-gpu: main.o haar-gpu.o image.o stdio-wrapper.o rectangles.o +main: main.o haar-gpu.o image.o stdio-wrapper.o rectangles.o $(CC) $(CFLAGS) -mp=gpu -gpu=$(SM) -o $@ $+ clean: @@ -71,4 +71,4 @@ clean: run: build $(LAUNCHER) ./vj-cpu ../face-cuda/Face.pgm ../face-cuda/info.txt ../face-cuda/class.txt Output-cpu.pgm - $(LAUNCHER) ./vj-gpu ../face-cuda/Face.pgm ../face-cuda/info.txt ../face-cuda/class.txt Output-gpu.pgm + $(LAUNCHER) ./main ../face-cuda/Face.pgm ../face-cuda/info.txt ../face-cuda/class.txt Output-gpu.pgm diff --git a/src/face-sycl/Makefile b/src/face-sycl/Makefile index 884fcd5f99..d995476d06 100644 --- a/src/face-sycl/Makefile +++ b/src/face-sycl/Makefile @@ -19,7 +19,7 @@ HIP_ARCH = gfx908 # Program name & source code list #=============================================================================== -program = vj-cpu vj-gpu +program = main vj-cpu source = main.cpp @@ -98,8 +98,11 @@ vj-cpu: main.o haar-cpu.o image.o stdio-wrapper.o rectangles.o vj-gpu: main.o haar-gpu.o image.o stdio-wrapper.o rectangles.o $(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS) +main: main.o haar-gpu.o image.o stdio-wrapper.o rectangles.o + $(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS) + clean: - rm -f $(program) *.o Output-cpu.pgm Output-gpu.pgm + rm -f $(program) vj-cpu vj-gpu *.o Output-cpu.pgm Output-gpu.pgm run: build $(LAUNCHER) ./vj-cpu ../face-cuda/Face.pgm ../face-cuda/info.txt ../face-cuda/class.txt Output-cpu.pgm diff --git a/src/fdtd3d-cuda/main.cu b/src/fdtd3d-cuda/main.cu index ce29dbbdf2..5c61e95195 100644 --- a/src/fdtd3d-cuda/main.cu +++ b/src/fdtd3d-cuda/main.cu @@ -16,6 +16,7 @@ #include "FDTD3dGPU.h" #include "shrUtils.h" #include "cmd_arg_reader.h" +#include // Forward declarations bool runTest(int argc, const char **argv); @@ -37,6 +38,7 @@ int main(int argc, char **argv) printf("PASS\n"); else printf("FAIL\n"); + if (bTestResult != true) exit(1); return 0; } diff --git a/src/fdtd3d-hip/main.cu b/src/fdtd3d-hip/main.cu index ce29dbbdf2..5c61e95195 100644 --- a/src/fdtd3d-hip/main.cu +++ b/src/fdtd3d-hip/main.cu @@ -16,6 +16,7 @@ #include "FDTD3dGPU.h" #include "shrUtils.h" #include "cmd_arg_reader.h" +#include // Forward declarations bool runTest(int argc, const char **argv); @@ -37,6 +38,7 @@ int main(int argc, char **argv) printf("PASS\n"); else printf("FAIL\n"); + if (bTestResult != true) exit(1); return 0; } diff --git a/src/fdtd3d-omp/main.cpp b/src/fdtd3d-omp/main.cpp index ce29dbbdf2..5c61e95195 100644 --- a/src/fdtd3d-omp/main.cpp +++ b/src/fdtd3d-omp/main.cpp @@ -16,6 +16,7 @@ #include "FDTD3dGPU.h" #include "shrUtils.h" #include "cmd_arg_reader.h" +#include // Forward declarations bool runTest(int argc, const char **argv); @@ -37,6 +38,7 @@ int main(int argc, char **argv) printf("PASS\n"); else printf("FAIL\n"); + if (bTestResult != true) exit(1); return 0; } diff --git a/src/fdtd3d-sycl/main.cpp b/src/fdtd3d-sycl/main.cpp index a9c0c718d9..0444c74939 100644 --- a/src/fdtd3d-sycl/main.cpp +++ b/src/fdtd3d-sycl/main.cpp @@ -16,6 +16,7 @@ #include "FDTD3dGPU.h" #include "shrUtils.h" #include "cmd_arg_reader.h" +#include // Forward declarations bool runTest(int argc, const char **argv); @@ -37,6 +38,7 @@ int main(int argc, char **argv) printf("PASS\n"); else printf("FAIL\n"); + if (bTestResult != true) exit(1); return 0; } diff --git a/src/fft-cuda/main.cu b/src/fft-cuda/main.cu index 63eaf6c4aa..788f0f15b7 100644 --- a/src/fft-cuda/main.cu +++ b/src/fft-cuda/main.cu @@ -207,5 +207,7 @@ int main(int argc, char** argv) free(reference); free(source); + if (error) return 1; + if (error) return 1; return 0; } diff --git a/src/fft-hip/main.cu b/src/fft-hip/main.cu index c6f1e2caab..d79b775c49 100644 --- a/src/fft-hip/main.cu +++ b/src/fft-hip/main.cu @@ -207,5 +207,7 @@ int main(int argc, char** argv) free(reference); free(source); + if (error) return 1; + if (error) return 1; return 0; } diff --git a/src/fft-omp/main.cpp b/src/fft-omp/main.cpp index 1a90bb1af2..bb6963e63a 100644 --- a/src/fft-omp/main.cpp +++ b/src/fft-omp/main.cpp @@ -379,5 +379,7 @@ int main(int argc, char** argv) free(reference); free(source); + if (error) return 1; + if (error) return 1; return 0; } diff --git a/src/fft-sycl/main.cpp b/src/fft-sycl/main.cpp index 25bb89ab62..44bbf1c0a4 100644 --- a/src/fft-sycl/main.cpp +++ b/src/fft-sycl/main.cpp @@ -221,5 +221,7 @@ int main(int argc, char** argv) free(reference); free(source); + if (error) return 1; + if (error) return 1; return 0; } diff --git a/src/filter-cuda/main.cu b/src/filter-cuda/main.cu index f81601672e..21f09905f7 100644 --- a/src/filter-cuda/main.cu +++ b/src/filter-cuda/main.cu @@ -179,5 +179,7 @@ int main(int argc, char **argv) { cudaFree(d_output); cudaFree(d_nres); + if (!match) return 1; + if (!match) return 1; return 0; } diff --git a/src/filter-hip/main.cu b/src/filter-hip/main.cu index 0698050972..148011b0d7 100644 --- a/src/filter-hip/main.cu +++ b/src/filter-hip/main.cu @@ -178,5 +178,7 @@ int main(int argc, char **argv) { hipFree(d_output); hipFree(d_nres); + if (!match) return 1; + if (!match) return 1; return 0; } diff --git a/src/filter-omp/main.cpp b/src/filter-omp/main.cpp index de10b3276d..f962ebbe7d 100644 --- a/src/filter-omp/main.cpp +++ b/src/filter-omp/main.cpp @@ -110,6 +110,7 @@ int main(int argc, char **argv) { printf("\nFilter using shared memory %s \n", equal ? "PASS" : "FAIL"); + if (!equal) exit(1); return 0; } diff --git a/src/filter-sycl/main.cpp b/src/filter-sycl/main.cpp index 2481a93b2b..6e46c3ea23 100644 --- a/src/filter-sycl/main.cpp +++ b/src/filter-sycl/main.cpp @@ -207,5 +207,7 @@ int main(int argc, char **argv) { sycl::free(d_output, q); sycl::free(d_nres, q); + if (!match) return 1; + if (!match) return 1; return 0; } diff --git a/src/flip-cuda/main.cu b/src/flip-cuda/main.cu index 6a2134ed84..fb6e5f7a60 100644 --- a/src/flip-cuda/main.cu +++ b/src/flip-cuda/main.cu @@ -201,5 +201,6 @@ int main(int argc, char* argv[]) printf("=========== Data type is FP64 ==========\n"); flip(num_dims, num_flip_dims, dim_size, repeat); + if (error) return 1; return 0; } diff --git a/src/flip-hip/main.cu b/src/flip-hip/main.cu index 997d7efabe..5c3b7f8ce3 100644 --- a/src/flip-hip/main.cu +++ b/src/flip-hip/main.cu @@ -201,5 +201,6 @@ int main(int argc, char* argv[]) printf("=========== Data type is FP64 ==========\n"); flip(num_dims, num_flip_dims, dim_size, repeat); + if (error) return 1; return 0; } diff --git a/src/flip-omp/main.cpp b/src/flip-omp/main.cpp index 1f2a3222a8..3621500bbb 100644 --- a/src/flip-omp/main.cpp +++ b/src/flip-omp/main.cpp @@ -182,5 +182,6 @@ int main(int argc, char* argv[]) printf("=========== Data type is FP64 ==========\n"); flip(num_dims, num_flip_dims, dim_size, repeat); + if (error) return 1; return 0; } diff --git a/src/flip-sycl/main.cpp b/src/flip-sycl/main.cpp index 95548ba9fb..960cd30c02 100644 --- a/src/flip-sycl/main.cpp +++ b/src/flip-sycl/main.cpp @@ -216,5 +216,6 @@ int main(int argc, char* argv[]) printf("=========== Data type is FP64 ==========\n"); flip(num_dims, num_flip_dims, dim_size, repeat); + if (error) return 1; return 0; } diff --git a/src/floydwarshall-cuda/main.cu b/src/floydwarshall-cuda/main.cu index ad7e5c24ba..c4be87e522 100644 --- a/src/floydwarshall-cuda/main.cu +++ b/src/floydwarshall-cuda/main.cu @@ -272,6 +272,7 @@ int main(int argc, char** argv) { else { printf("FAIL\n"); + exit(1); if (numNodes <= 8) { for (unsigned int i = 0; i < numNodes; i++) { diff --git a/src/floydwarshall-hip/main.cu b/src/floydwarshall-hip/main.cu index 7c79c5bd0c..ceece16881 100644 --- a/src/floydwarshall-hip/main.cu +++ b/src/floydwarshall-hip/main.cu @@ -272,6 +272,7 @@ int main(int argc, char** argv) { else { printf("FAIL\n"); + exit(1); if (numNodes <= 8) { for (unsigned int i = 0; i < numNodes; i++) { diff --git a/src/floydwarshall-omp/main.cpp b/src/floydwarshall-omp/main.cpp index 5c1408d7d4..f65cf14d8a 100644 --- a/src/floydwarshall-omp/main.cpp +++ b/src/floydwarshall-omp/main.cpp @@ -255,6 +255,7 @@ int main(int argc, char** argv) { else { printf("FAIL\n"); + exit(1); if (numNodes <= 8) { for (unsigned int i = 0; i < numNodes; i++) { diff --git a/src/floydwarshall-sycl/main.cpp b/src/floydwarshall-sycl/main.cpp index cd46552198..49c38661c7 100644 --- a/src/floydwarshall-sycl/main.cpp +++ b/src/floydwarshall-sycl/main.cpp @@ -275,6 +275,7 @@ int main(int argc, char** argv) { else { printf("FAIL\n"); + exit(1); if (numNodes <= 8) { for (unsigned int i = 0; i < numNodes; i++) { diff --git a/src/fluidSim-cuda/reference.h b/src/fluidSim-cuda/reference.h index 4c29202bec..3e74b2aabe 100644 --- a/src/fluidSim-cuda/reference.h +++ b/src/fluidSim-cuda/reference.h @@ -277,6 +277,7 @@ void verify( bool ok = true; if(flag0 || flag1234 || flag5678) ok = false; printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } #endif diff --git a/src/fma-cuda/main.cu b/src/fma-cuda/main.cu index 4c4fe8dbf2..956e90abfa 100644 --- a/src/fma-cuda/main.cu +++ b/src/fma-cuda/main.cu @@ -154,5 +154,6 @@ int main(int argc, char* argv[]) fma(NA, NC, C, num_ops, repeat); } + if (!ok) return 1; return 0; } diff --git a/src/fma-hip/main.cu b/src/fma-hip/main.cu index 9fd7dc6d56..ba261bb8da 100644 --- a/src/fma-hip/main.cu +++ b/src/fma-hip/main.cu @@ -154,5 +154,6 @@ int main(int argc, char* argv[]) fma(NA, NC, C, num_ops, repeat); } + if (!ok) return 1; return 0; } diff --git a/src/fma-sycl/main.cpp b/src/fma-sycl/main.cpp index 8e562adf8b..63268eb72b 100644 --- a/src/fma-sycl/main.cpp +++ b/src/fma-sycl/main.cpp @@ -158,5 +158,6 @@ int main(int argc, char* argv[]) fma(q, NA, NC, C, num_ops, repeat); } + if (!ok) return 1; return 0; } diff --git a/src/fpc-cuda/main.cu b/src/fpc-cuda/main.cu index 75d0ef2418..d2d0c26d54 100644 --- a/src/fpc-cuda/main.cu +++ b/src/fpc-cuda/main.cu @@ -338,5 +338,6 @@ int main(int argc, char** argv) { free(values); free(cbuffer); + if (!ok) return 1; return 0; } diff --git a/src/fpc-hip/main.cu b/src/fpc-hip/main.cu index 4bbf63ed8c..340bfc6585 100644 --- a/src/fpc-hip/main.cu +++ b/src/fpc-hip/main.cu @@ -338,5 +338,6 @@ int main(int argc, char** argv) { free(values); free(cbuffer); + if (!ok) return 1; return 0; } diff --git a/src/fpc-omp/main.cpp b/src/fpc-omp/main.cpp index 9e8fc6add9..b5f73ee14e 100644 --- a/src/fpc-omp/main.cpp +++ b/src/fpc-omp/main.cpp @@ -316,5 +316,6 @@ int main(int argc, char** argv) { free(values); free(cbuffer); + if (!ok) return 1; return 0; } diff --git a/src/fpc-sycl/main.cpp b/src/fpc-sycl/main.cpp index 27730e8300..17668501de 100644 --- a/src/fpc-sycl/main.cpp +++ b/src/fpc-sycl/main.cpp @@ -352,5 +352,6 @@ int main(int argc, char** argv) { free(values); free(cbuffer); + if (!ok) return 1; return 0; } diff --git a/src/fresnel-cuda/main.cu b/src/fresnel-cuda/main.cu index eba9b63a80..ad835f15fb 100644 --- a/src/fresnel-cuda/main.cu +++ b/src/fresnel-cuda/main.cu @@ -80,5 +80,6 @@ int main(int argc, char *argv[]) free(x); free(output); free(h_output); + if (!ok) return 1; return 0; } diff --git a/src/fresnel-hip/main.cu b/src/fresnel-hip/main.cu index 2c3b3a34be..63442ef765 100644 --- a/src/fresnel-hip/main.cu +++ b/src/fresnel-hip/main.cu @@ -80,5 +80,6 @@ int main(int argc, char *argv[]) free(x); free(output); free(h_output); + if (!ok) return 1; return 0; } diff --git a/src/fresnel-omp/main.cpp b/src/fresnel-omp/main.cpp index e667e294c7..740297c8f1 100644 --- a/src/fresnel-omp/main.cpp +++ b/src/fresnel-omp/main.cpp @@ -61,5 +61,6 @@ int main(int argc, char *argv[]) free(x); free(output); free(h_output); + if (!ok) return 1; return 0; } diff --git a/src/fresnel-sycl/main.cpp b/src/fresnel-sycl/main.cpp index d03b9a3cd9..cccd381f8a 100644 --- a/src/fresnel-sycl/main.cpp +++ b/src/fresnel-sycl/main.cpp @@ -82,5 +82,6 @@ int main(int argc, char *argv[]) free(x); free(output); free(h_output); + if (!ok) return 1; return 0; } diff --git a/src/fsm-cuda/main.cu b/src/fsm-cuda/main.cu index a2b8cc3c26..83f2186ec8 100644 --- a/src/fsm-cuda/main.cu +++ b/src/fsm-cuda/main.cu @@ -180,5 +180,6 @@ int main(int argc, char *argv[]) cudaFree(d_smax); cudaFree(d_sbest); cudaFree(d_oldmax); + if (!ok) return 1; return 0; } diff --git a/src/fsm-hip/main.cu b/src/fsm-hip/main.cu index 5b6d61d7f1..b58a9f4314 100644 --- a/src/fsm-hip/main.cu +++ b/src/fsm-hip/main.cu @@ -180,5 +180,6 @@ int main(int argc, char *argv[]) hipFree(d_smax); hipFree(d_sbest); hipFree(d_oldmax); + if (!ok) return 1; return 0; } diff --git a/src/fsm-sycl/main.cpp b/src/fsm-sycl/main.cpp index 03d84d4d68..dca5c815f4 100644 --- a/src/fsm-sycl/main.cpp +++ b/src/fsm-sycl/main.cpp @@ -207,5 +207,6 @@ int main(int argc, char *argv[]) sycl::free(d_smax, q); sycl::free(d_sbest, q); sycl::free(d_oldmax, q); + if (!ok) return 1; return 0; } diff --git a/src/fwt-cuda/main.cu b/src/fwt-cuda/main.cu index 4c2f3230e9..345fdf02e0 100644 --- a/src/fwt-cuda/main.cu +++ b/src/fwt-cuda/main.cu @@ -142,4 +142,5 @@ int main(int argc, char *argv[]) printf("L2 norm: %E\n", L2norm); printf(L2norm < 1e-6 ? "PASS\n" : "FAIL\n"); + if (L2norm >= 1e-6) exit(1); } diff --git a/src/fwt-hip/main.cu b/src/fwt-hip/main.cu index b922c4387a..d5c8f40c38 100644 --- a/src/fwt-hip/main.cu +++ b/src/fwt-hip/main.cu @@ -142,4 +142,5 @@ int main(int argc, char *argv[]) printf("L2 norm: %E\n", L2norm); printf(L2norm < 1e-6 ? "PASS\n" : "FAIL\n"); + if (L2norm >= 1e-6) exit(1); } diff --git a/src/fwt-omp/main.cpp b/src/fwt-omp/main.cpp index 07071deb14..1ae515fc2f 100644 --- a/src/fwt-omp/main.cpp +++ b/src/fwt-omp/main.cpp @@ -143,4 +143,5 @@ int main(int argc, char *argv[]) printf("L2 norm: %E\n", L2norm); printf(L2norm < 1e-6 ? "PASS\n" : "FAIL\n"); + if (L2norm >= 1e-6) exit(1); } diff --git a/src/fwt-sycl/main.cpp b/src/fwt-sycl/main.cpp index df15e139eb..6a4c2b1fdf 100644 --- a/src/fwt-sycl/main.cpp +++ b/src/fwt-sycl/main.cpp @@ -147,4 +147,5 @@ int main(int argc, char *argv[]) printf("L2 norm: %E\n", L2norm); printf(L2norm < 1e-6 ? "PASS\n" : "FAIL\n"); + if (L2norm >= 1e-6) exit(1); } diff --git a/src/ga-cuda/main.cu b/src/ga-cuda/main.cu index cecf3ded15..ec31ddd017 100644 --- a/src/ga-cuda/main.cu +++ b/src/ga-cuda/main.cu @@ -120,5 +120,6 @@ int main(int argc, char* argv[]) cudaFree(d_target); cudaFree(d_query); cudaFree(d_batch_result); + if (error) return 1; return 0; } diff --git a/src/ga-hip/main.cu b/src/ga-hip/main.cu index 4ce2dd197b..575ffc9554 100644 --- a/src/ga-hip/main.cu +++ b/src/ga-hip/main.cu @@ -120,5 +120,6 @@ int main(int argc, char* argv[]) hipFree(d_target); hipFree(d_query); hipFree(d_batch_result); + if (error) return 1; return 0; } diff --git a/src/ga-omp/main.cpp b/src/ga-omp/main.cpp index 95e26847cf..01d506b374 100644 --- a/src/ga-omp/main.cpp +++ b/src/ga-omp/main.cpp @@ -113,5 +113,6 @@ int main(int argc, char* argv[]) } printf("Total kernel execution time %f (s)\n", total_time * 1e-9f); printf("%s\n", error ? "FAIL" : "PASS"); + if (error) exit(1); return 0; } diff --git a/src/ga-sycl/main.cpp b/src/ga-sycl/main.cpp index f13d41281c..b1ecaa7fb2 100644 --- a/src/ga-sycl/main.cpp +++ b/src/ga-sycl/main.cpp @@ -137,5 +137,6 @@ int main(int argc, char* argv[]) sycl::free(d_target, q); sycl::free(d_query, q); sycl::free(d_batch_result, q); + if (error) return 1; return 0; } diff --git a/src/gabor-cuda/main.cu b/src/gabor-cuda/main.cu index 2114abb8fa..61fd763101 100644 --- a/src/gabor-cuda/main.cu +++ b/src/gabor-cuda/main.cu @@ -113,6 +113,7 @@ int main(int argc, char* argv[]) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); free(h_filter); free(d_filter); } diff --git a/src/gabor-hip/main.cu b/src/gabor-hip/main.cu index 659a8c4762..aecd35e9b7 100644 --- a/src/gabor-hip/main.cu +++ b/src/gabor-hip/main.cu @@ -113,6 +113,7 @@ int main(int argc, char* argv[]) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); free(h_filter); free(d_filter); } diff --git a/src/gabor-omp/main.cpp b/src/gabor-omp/main.cpp index acc02ac507..d8873c647a 100644 --- a/src/gabor-omp/main.cpp +++ b/src/gabor-omp/main.cpp @@ -77,6 +77,7 @@ int main(int argc, char* argv[]) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); free(h_filter); free(d_filter); } diff --git a/src/gabor-sycl/main.cpp b/src/gabor-sycl/main.cpp index 21369e2b70..077a1392bf 100644 --- a/src/gabor-sycl/main.cpp +++ b/src/gabor-sycl/main.cpp @@ -127,6 +127,7 @@ int main(int argc, char* argv[]) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); free(h_filter); free(d_filter); } diff --git a/src/gamma-correction-cuda/main.cu b/src/gamma-correction-cuda/main.cu index e11763cfd7..6ff202fa49 100644 --- a/src/gamma-correction-cuda/main.cu +++ b/src/gamma-correction-cuda/main.cu @@ -9,6 +9,7 @@ #include #include #include "utils.hpp" +#include __global__ void gamma_correction(ImgPixel* pixel) { @@ -99,6 +100,7 @@ int main(int argc, char* argv[]) { std::cout << "PASS\n"; } else { std::cout << "FAIL\n"; + exit(1); } #ifdef DEBUG diff --git a/src/gamma-correction-hip/Makefile.hipcl b/src/gamma-correction-hip/Makefile.hipcl index b0d118f14c..536e103f67 100644 --- a/src/gamma-correction-hip/Makefile.hipcl +++ b/src/gamma-correction-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = gamma-correction +program = main source = main.cu diff --git a/src/gamma-correction-hip/main.cu b/src/gamma-correction-hip/main.cu index c560ad8490..528e5dcecc 100644 --- a/src/gamma-correction-hip/main.cu +++ b/src/gamma-correction-hip/main.cu @@ -9,6 +9,7 @@ #include #include #include "utils.hpp" +#include __global__ void gamma_correction(ImgPixel* pixel) { @@ -99,6 +100,7 @@ int main(int argc, char* argv[]) { std::cout << "PASS\n"; } else { std::cout << "FAIL\n"; + exit(1); } #ifdef DEBUG diff --git a/src/gamma-correction-omp/main.cpp b/src/gamma-correction-omp/main.cpp index 93d0b579c6..0eb5de7a2b 100644 --- a/src/gamma-correction-omp/main.cpp +++ b/src/gamma-correction-omp/main.cpp @@ -9,6 +9,7 @@ #include #include #include "utils.hpp" +#include int main(int argc, char* argv[]) { if (argc != 5) { @@ -88,6 +89,7 @@ int main(int argc, char* argv[]) { std::cout << "PASS\n"; } else { std::cout << "FAIL\n"; + exit(1); } #ifdef DEBUG diff --git a/src/gamma-correction-sycl/main.cpp b/src/gamma-correction-sycl/main.cpp index c9abff9c44..058a8b6919 100644 --- a/src/gamma-correction-sycl/main.cpp +++ b/src/gamma-correction-sycl/main.cpp @@ -9,6 +9,7 @@ #include #include #include "utils.hpp" +#include int main(int argc, char* argv[]) { if (argc != 5) { @@ -101,6 +102,7 @@ int main(int argc, char* argv[]) { std::cout << "PASS\n"; } else { std::cout << "FAIL\n"; + exit(1); } #ifdef DEBUG diff --git a/src/gaussian-cuda/gaussianElim.cu b/src/gaussian-cuda/gaussianElim.cu index 0dd4e47439..f4b4d4e5e2 100644 --- a/src/gaussian-cuda/gaussianElim.cu +++ b/src/gaussian-cuda/gaussianElim.cu @@ -2,6 +2,7 @@ #include #include #include "gaussianElim.h" +#include #define BLOCK_SIZE_0 256 #define BLOCK_SIZE_1_X 16 @@ -285,6 +286,7 @@ int parseCommandline(int argc, char *argv[], char* filename, } } } + if (!ok) return 1; return 0; } diff --git a/src/gaussian-hip/gaussianElim.cu b/src/gaussian-hip/gaussianElim.cu index 81e73b92c2..714a8266e0 100644 --- a/src/gaussian-hip/gaussianElim.cu +++ b/src/gaussian-hip/gaussianElim.cu @@ -2,6 +2,7 @@ #include #include #include "gaussianElim.h" +#include #define BLOCK_SIZE_0 256 #define BLOCK_SIZE_1_X 16 @@ -285,6 +286,7 @@ int parseCommandline(int argc, char *argv[], char* filename, } } } + if (!ok) return 1; return 0; } diff --git a/src/gaussian-omp/gaussianElim.cpp b/src/gaussian-omp/gaussianElim.cpp index 515d57b08c..29aab73726 100644 --- a/src/gaussian-omp/gaussianElim.cpp +++ b/src/gaussian-omp/gaussianElim.cpp @@ -1,6 +1,7 @@ #include #include #include "gaussianElim.h" +#include #define BLOCK_SIZE_0 256 @@ -240,6 +241,7 @@ int parseCommandline(int argc, char *argv[], char* filename, } } } + if (!ok) return 1; return 0; } diff --git a/src/gaussian-sycl/gaussianElim.cpp b/src/gaussian-sycl/gaussianElim.cpp index bad34dfb0b..d0acccbf78 100644 --- a/src/gaussian-sycl/gaussianElim.cpp +++ b/src/gaussian-sycl/gaussianElim.cpp @@ -2,6 +2,7 @@ #include #include #include "gaussianElim.h" +#include #define BLOCK_SIZE_0 256 #define BLOCK_SIZE_1_X 16 @@ -292,6 +293,7 @@ int parseCommandline(int argc, char *argv[], char* filename, } } } + if (!ok) return 1; return 0; } diff --git a/src/gc-cuda/main.cu b/src/gc-cuda/main.cu index e393855a81..4f5ce39893 100644 --- a/src/gc-cuda/main.cu +++ b/src/gc-cuda/main.cu @@ -445,5 +445,6 @@ int main(int argc, char* argv[]) delete [] color; freeECLgraph(g); + if (!ok) return 1; return 0; } diff --git a/src/gc-hip/main.cu b/src/gc-hip/main.cu index 599ca6efcd..4b097c30e0 100644 --- a/src/gc-hip/main.cu +++ b/src/gc-hip/main.cu @@ -443,5 +443,6 @@ int main(int argc, char* argv[]) delete [] color; freeECLgraph(g); + if (!ok) return 1; return 0; } diff --git a/src/gc-omp/main.cpp b/src/gc-omp/main.cpp index 99365da922..12749118eb 100644 --- a/src/gc-omp/main.cpp +++ b/src/gc-omp/main.cpp @@ -397,5 +397,6 @@ int main(int argc, char* argv[]) delete [] posscol2; delete [] wl; freeECLgraph(g); + if (!ok) return 1; return 0; } diff --git a/src/gc-sycl/main.cpp b/src/gc-sycl/main.cpp index 39dd67078d..be00991973 100644 --- a/src/gc-sycl/main.cpp +++ b/src/gc-sycl/main.cpp @@ -486,5 +486,6 @@ int main(int argc, char *argv[]) { delete [] color; freeECLgraph(g); + if (!ok) return 1; return 0; } diff --git a/src/gd-cuda/reference.h b/src/gd-cuda/reference.h index ecc9c4da51..cc6705991f 100644 --- a/src/gd-cuda/reference.h +++ b/src/gd-cuda/reference.h @@ -1,4 +1,5 @@ #include +#include void L2_norm_ref (const float *x, float &l2_norm, int n) { @@ -123,6 +124,7 @@ void reference (Classification_Data_CRS &A, bool ok = (fabsf(obj_val - h_obj_val) < 1e-3f) && (fabsf(train_error - h_train_error) < 1e-3f); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); free(h_row_ptr); free(h_col_index); diff --git a/src/ge-spmm-cuda/main.cu b/src/ge-spmm-cuda/main.cu index 624fb133a5..2565d74840 100644 --- a/src/ge-spmm-cuda/main.cu +++ b/src/ge-spmm-cuda/main.cu @@ -224,6 +224,7 @@ int main(int argc, char** argv) { CLEANUP(""); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/ge-spmm-hip/main.cu b/src/ge-spmm-hip/main.cu index b5ef414514..27e1fa298e 100644 --- a/src/ge-spmm-hip/main.cu +++ b/src/ge-spmm-hip/main.cu @@ -215,6 +215,7 @@ int main(int argc, char** argv) { CLEANUP(""); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/ge-spmm-sycl/main.cpp b/src/ge-spmm-sycl/main.cpp index 7d4613b5f8..8ec9700f15 100644 --- a/src/ge-spmm-sycl/main.cpp +++ b/src/ge-spmm-sycl/main.cpp @@ -244,6 +244,7 @@ int main(int argc, char** argv) { CLEANUP(""); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/geam-cuda/main.cu b/src/geam-cuda/main.cu index 2729efd87c..14b86e89c8 100644 --- a/src/geam-cuda/main.cu +++ b/src/geam-cuda/main.cu @@ -186,5 +186,7 @@ int main(int argc, char* argv[]) { nrow, ncol); transpose_f64(nrow, ncol, repeat); + if (error) return 1; + if (error) return 1; return 0; } diff --git a/src/geam-hip/main.cu b/src/geam-hip/main.cu index 3cd8c6cb8f..eea8940cdf 100644 --- a/src/geam-hip/main.cu +++ b/src/geam-hip/main.cu @@ -186,5 +186,7 @@ int main(int argc, char* argv[]) { nrow, ncol); transpose_f64(nrow, ncol, repeat); + if (error) return 1; + if (error) return 1; return 0; } diff --git a/src/geam-sycl/main.cpp b/src/geam-sycl/main.cpp index 2ff8f29572..c5989f659f 100644 --- a/src/geam-sycl/main.cpp +++ b/src/geam-sycl/main.cpp @@ -114,5 +114,6 @@ int main(int argc, char* argv[]) { nrow, ncol); transpose(q, nrow, ncol, repeat); + if (error) return 1; return 0; } diff --git a/src/geglu-cuda/main.cu b/src/geglu-cuda/main.cu index 35b9dd517a..e29781fdec 100644 --- a/src/geglu-cuda/main.cu +++ b/src/geglu-cuda/main.cu @@ -179,5 +179,6 @@ int main(int argc, char* argv[]) } } + if (!ok) return 1; return 0; } diff --git a/src/geglu-hip/main.cu b/src/geglu-hip/main.cu index 9e8f2fecf1..d6766a1df8 100644 --- a/src/geglu-hip/main.cu +++ b/src/geglu-hip/main.cu @@ -179,5 +179,6 @@ int main(int argc, char* argv[]) } } + if (!ok) return 1; return 0; } diff --git a/src/geglu-omp/main.cpp b/src/geglu-omp/main.cpp index 107f25b09c..77a86a828c 100644 --- a/src/geglu-omp/main.cpp +++ b/src/geglu-omp/main.cpp @@ -109,5 +109,6 @@ int main(int argc, char *argv[]) { } } + if (!ok) return 1; return 0; } diff --git a/src/geglu-sycl/main.cpp b/src/geglu-sycl/main.cpp index b226429465..14b94efecf 100644 --- a/src/geglu-sycl/main.cpp +++ b/src/geglu-sycl/main.cpp @@ -180,5 +180,6 @@ int main(int argc, char *argv[]) { } } + if (!ok) return 1; return 0; } diff --git a/src/gelu-cuda/main.cu b/src/gelu-cuda/main.cu index 02dba8cfc8..a82c9495b1 100644 --- a/src/gelu-cuda/main.cu +++ b/src/gelu-cuda/main.cu @@ -166,5 +166,7 @@ int main(int argc, char* argv[]) free(output_ref); free(bias); + if (!ok) return 1; + if (!ok) return 1; return 0; } diff --git a/src/gelu-hip/main.cu b/src/gelu-hip/main.cu index 9a2f162599..bcb84de9d7 100644 --- a/src/gelu-hip/main.cu +++ b/src/gelu-hip/main.cu @@ -166,5 +166,7 @@ int main(int argc, char* argv[]) free(output_ref); free(bias); + if (!ok) return 1; + if (!ok) return 1; return 0; } diff --git a/src/gelu-sycl/main.cpp b/src/gelu-sycl/main.cpp index 2175ad9c38..8bceeee3eb 100644 --- a/src/gelu-sycl/main.cpp +++ b/src/gelu-sycl/main.cpp @@ -197,5 +197,7 @@ int main(int argc, char* argv[]) free(output_ref); free(bias); + if (!ok) return 1; + if (!ok) return 1; return 0; } diff --git a/src/glu-cuda/main.cu b/src/glu-cuda/main.cu index 02454c3675..f3299a4f34 100644 --- a/src/glu-cuda/main.cu +++ b/src/glu-cuda/main.cu @@ -124,5 +124,6 @@ int main(int argc, char* argv[]) cudaFree(d_X); cudaFree(d_Y); + if (!ok) return 1; return 0; } diff --git a/src/glu-hip/main.cu b/src/glu-hip/main.cu index c2d4d96bb3..a84e06283a 100644 --- a/src/glu-hip/main.cu +++ b/src/glu-hip/main.cu @@ -124,5 +124,6 @@ int main(int argc, char* argv[]) hipFree(d_X); hipFree(d_Y); + if (!ok) return 1; return 0; } diff --git a/src/glu-omp/main.cpp b/src/glu-omp/main.cpp index 4edb53dbba..d2d1035d8b 100644 --- a/src/glu-omp/main.cpp +++ b/src/glu-omp/main.cpp @@ -113,5 +113,6 @@ int main(int argc, char* argv[]) free(Y); free(Y_ref); + if (!ok) return 1; return 0; } diff --git a/src/glu-sycl/main.cpp b/src/glu-sycl/main.cpp index b35ba0bdbd..46efa6ee8b 100644 --- a/src/glu-sycl/main.cpp +++ b/src/glu-sycl/main.cpp @@ -133,5 +133,6 @@ int main(int argc, char* argv[]) sycl::free(d_X, q); sycl::free(d_Y, q); + if (!ok) return 1; return 0; } diff --git a/src/goulash-cuda/main.cu b/src/goulash-cuda/main.cu index 70c96412ca..404760c85e 100644 --- a/src/goulash-cuda/main.cu +++ b/src/goulash-cuda/main.cu @@ -120,5 +120,6 @@ int main(int argc, char* argv[]) if (m_gate != NULL) free(m_gate); if (m_gate_h != NULL) free(m_gate_h); if (Vm != NULL) free(Vm); + if (!ok) return 1; return 0; } diff --git a/src/goulash-hip/main.cu b/src/goulash-hip/main.cu index 23e9fa0c4b..37c2cb517d 100644 --- a/src/goulash-hip/main.cu +++ b/src/goulash-hip/main.cu @@ -120,5 +120,6 @@ int main(int argc, char* argv[]) if (m_gate != NULL) free(m_gate); if (m_gate_h != NULL) free(m_gate_h); if (Vm != NULL) free(Vm); + if (!ok) return 1; return 0; } diff --git a/src/goulash-omp/main.cpp b/src/goulash-omp/main.cpp index 6661325ac5..34c3640a4f 100644 --- a/src/goulash-omp/main.cpp +++ b/src/goulash-omp/main.cpp @@ -103,5 +103,6 @@ int main(int argc, char* argv[]) if (m_gate != NULL) free(m_gate); if (m_gate_h != NULL) free(m_gate_h); if (Vm != NULL) free(Vm); + if (!ok) return 1; return 0; } diff --git a/src/goulash-sycl/main.cpp b/src/goulash-sycl/main.cpp index 2601bab7f3..0493aeb8a5 100644 --- a/src/goulash-sycl/main.cpp +++ b/src/goulash-sycl/main.cpp @@ -126,5 +126,6 @@ int main(int argc, char* argv[]) if (m_gate != NULL) free(m_gate); if (m_gate_h != NULL) free(m_gate_h); if (Vm != NULL) free(Vm); + if (!ok) return 1; return 0; } diff --git a/src/grep-hip/Makefile.hipcl b/src/grep-hip/Makefile.hipcl index 7cce763dd4..4edffaa7d8 100644 --- a/src/grep-hip/Makefile.hipcl +++ b/src/grep-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = nfa +program = main source = main.cu nfautil.cu regex.cu diff --git a/src/grep-omp/Makefile.aomp b/src/grep-omp/Makefile.aomp index f0ee1e5f71..06e0b07219 100644 --- a/src/grep-omp/Makefile.aomp +++ b/src/grep-omp/Makefile.aomp @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = nfa +program = main source = main.cpp nfautil.cpp regex.cpp diff --git a/src/grep-omp/Makefile.nvc b/src/grep-omp/Makefile.nvc index 2a7b35b7e9..1b644d4201 100644 --- a/src/grep-omp/Makefile.nvc +++ b/src/grep-omp/Makefile.nvc @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = nfa +program = main source = main.cpp nfautil.cpp regex.cpp diff --git a/src/haccmk-cuda/haccmk.cu b/src/haccmk-cuda/haccmk.cu index 245192c4c1..4f378f10df 100644 --- a/src/haccmk-cuda/haccmk.cu +++ b/src/haccmk-cuda/haccmk.cu @@ -276,6 +276,7 @@ int main( int argc, char *argv[] ) free(vz2_hw); printf("%s\n", error ? "FAIL" : "PASS"); + if (error) exit(1); return 0; } diff --git a/src/haccmk-hip/Makefile.hipcl b/src/haccmk-hip/Makefile.hipcl index d6baf4b8cb..1713d84e3c 100644 --- a/src/haccmk-hip/Makefile.hipcl +++ b/src/haccmk-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = haccmk +program = main source = haccmk.cu diff --git a/src/haccmk-hip/haccmk.cu b/src/haccmk-hip/haccmk.cu index 30b7f24939..47fde6478c 100644 --- a/src/haccmk-hip/haccmk.cu +++ b/src/haccmk-hip/haccmk.cu @@ -276,6 +276,7 @@ int main( int argc, char *argv[] ) free(vz2_hw); printf("%s\n", error ? "FAIL" : "PASS"); + if (error) exit(1); return 0; } diff --git a/src/haccmk-omp/haccmk.cpp b/src/haccmk-omp/haccmk.cpp index 83d0c0b608..e8ea5e5834 100644 --- a/src/haccmk-omp/haccmk.cpp +++ b/src/haccmk-omp/haccmk.cpp @@ -233,6 +233,7 @@ int main( int argc, char *argv[] ) free(vz2_hw); printf("%s\n", error ? "FAIL" : "PASS"); + if (error) exit(1); return 0; } diff --git a/src/haccmk-sycl/haccmk.cpp b/src/haccmk-sycl/haccmk.cpp index 17e05ae748..5133ba1c70 100644 --- a/src/haccmk-sycl/haccmk.cpp +++ b/src/haccmk-sycl/haccmk.cpp @@ -277,6 +277,7 @@ int main( int argc, char *argv[] ) free(vz2_hw); printf("%s\n", error ? "FAIL" : "PASS"); + if (error) exit(1); return 0; } diff --git a/src/hadamard-cuda/main.cu b/src/hadamard-cuda/main.cu index c689de7883..090b4e93cd 100644 --- a/src/hadamard-cuda/main.cu +++ b/src/hadamard-cuda/main.cu @@ -318,5 +318,6 @@ int main(int argc, char* argv[]) hadamard_transform<__half>(batch_size, dim, repeat); hadamard_transform<__nv_bfloat16>(batch_size, dim, repeat); } + if (!ok) return 1; return 0; } diff --git a/src/hadamard-hip/main.cu b/src/hadamard-hip/main.cu index 084b13332d..b2abf7cdbc 100644 --- a/src/hadamard-hip/main.cu +++ b/src/hadamard-hip/main.cu @@ -322,5 +322,6 @@ int main(int argc, char* argv[]) hadamard_transform<__half>(batch_size, dim, repeat); hadamard_transform<__hip_bfloat16>(batch_size, dim, repeat); } + if (!ok) return 1; return 0; } diff --git a/src/hadamard-sycl/main.cpp b/src/hadamard-sycl/main.cpp index acc8803098..21b95f0b5d 100644 --- a/src/hadamard-sycl/main.cpp +++ b/src/hadamard-sycl/main.cpp @@ -340,5 +340,6 @@ int main(int argc, char* argv[]) hadamard_transform(q, batch_size, dim, repeat); hadamard_transform(q, batch_size, dim, repeat); } + if (!ok) return 1; return 0; } diff --git a/src/hausdorff-cuda/main.cu b/src/hausdorff-cuda/main.cu index 97027367b8..78fc7aeda0 100644 --- a/src/hausdorff-cuda/main.cu +++ b/src/hausdorff-cuda/main.cu @@ -121,5 +121,6 @@ int main(int argc, char* argv[]) { cudaFree(d_distance); cudaFree(d_Apoints); cudaFree(d_Bpoints); + if (error) return 1; return 0; } diff --git a/src/hausdorff-hip/main.cu b/src/hausdorff-hip/main.cu index 1ae01be04e..99d743a95c 100644 --- a/src/hausdorff-hip/main.cu +++ b/src/hausdorff-hip/main.cu @@ -109,5 +109,6 @@ int main(int argc, char* argv[]) { hipFree(d_distance); hipFree(d_Apoints); hipFree(d_Bpoints); + if (error) return 1; return 0; } diff --git a/src/hausdorff-omp/main.cpp b/src/hausdorff-omp/main.cpp index 00fba3c5ab..e55b307ab9 100644 --- a/src/hausdorff-omp/main.cpp +++ b/src/hausdorff-omp/main.cpp @@ -95,5 +95,6 @@ int main(int argc, char* argv[]) { free(h_Apoints); free(h_Bpoints); + if (error) return 1; return 0; } diff --git a/src/hausdorff-sycl/main.cpp b/src/hausdorff-sycl/main.cpp index 5f2d1d8b82..a3a75f96d2 100644 --- a/src/hausdorff-sycl/main.cpp +++ b/src/hausdorff-sycl/main.cpp @@ -136,5 +136,6 @@ int main(int argc, char* argv[]) { sycl::free(d_distance, q); sycl::free(d_Apoints, q); sycl::free(d_Bpoints, q); + if (error) return 1; return 0; } diff --git a/src/heartwall-cuda/Makefile b/src/heartwall-cuda/Makefile index 188208a968..33722e1638 100644 --- a/src/heartwall-cuda/Makefile +++ b/src/heartwall-cuda/Makefile @@ -28,7 +28,7 @@ ifeq ($(OPTIMIZE),yes) endif -heartwall: ./main.o \ +main: ./main.o \ ./kernel/kernel.o \ ./util/avi/avilib.o \ ./util/avi/avimod.o \ @@ -40,7 +40,7 @@ heartwall: ./main.o \ ./util/avi/avimod.o \ ./util/file/file.o \ ./util/timer/timer.o \ - $(LDFLAGS) -o heartwall + $(LDFLAGS) -o main # ======================================================================================================================================================150 # MAIN FUNCTION @@ -96,11 +96,11 @@ heartwall: ./main.o \ -c \ -o ./util/timer/timer.o -run: heartwall - $(LAUNCHER) ./heartwall 104 +run: main + $(LAUNCHER) ./main 104 clean: - rm -rf *.o heartwall \ + rm -rf *.o main \ ./kernel/*.o \ ./util/avi/*.o \ ./util/file/*.o \ diff --git a/src/heartwall-hip/Makefile b/src/heartwall-hip/Makefile index e2bdd80c34..76bb29fa3b 100644 --- a/src/heartwall-hip/Makefile +++ b/src/heartwall-hip/Makefile @@ -27,7 +27,7 @@ ifeq ($(OPTIMIZE),yes) endif -heartwall: ./main.o \ +main: ./main.o \ ./kernel/kernel.o \ ./util/avi/avilib.o \ ./util/avi/avimod.o \ @@ -39,7 +39,7 @@ heartwall: ./main.o \ ./util/avi/avimod.o \ ./util/file/file.o \ ./util/timer/timer.o \ - $(LDFLAGS) -o heartwall + $(LDFLAGS) -o main # ======================================================================================================================================================150 # MAIN FUNCTION @@ -95,12 +95,12 @@ heartwall: ./main.o \ -c \ -o ./util/timer/timer.o -run: heartwall - $(LAUNCHER) ./heartwall 104 +run: main + $(LAUNCHER) ./main 104 clean: - rm -rf *.o heartwall \ + rm -rf *.o main \ ./kernel/*.o \ ./util/avi/*.o \ ./util/file/*.o \ - ./util/timer/*.o + ./util/timer/*.o diff --git a/src/heartwall-hip/Makefile.hipcl b/src/heartwall-hip/Makefile.hipcl index 3649444ae4..ccaaf58f01 100644 --- a/src/heartwall-hip/Makefile.hipcl +++ b/src/heartwall-hip/Makefile.hipcl @@ -26,7 +26,7 @@ ifeq ($(OPTIMIZE),yes) endif -heartwall: ./main.o \ +main: ./main.o \ ./kernel/kernel.o \ ./util/avi/avilib.o \ ./util/avi/avimod.o \ @@ -38,7 +38,7 @@ heartwall: ./main.o \ ./util/avi/avimod.o \ ./util/file/file.o \ ./util/timer/timer.o \ - -o heartwall $(LDFLAGS) + -o main $(LDFLAGS) # ======================================================================================================================================================150 # MAIN FUNCTION @@ -94,11 +94,11 @@ heartwall: ./main.o \ -c \ -o ./util/timer/timer.o -run: heartwall - ./heartwall 104 +run: main + ./main 104 clean: - rm -rf *.o heartwall \ + rm -rf *.o main \ ./kernel/*.o \ ./util/avi/*.o \ ./util/file/*.o \ diff --git a/src/heartwall-omp/Makefile b/src/heartwall-omp/Makefile index a6093e4a8a..c76fd93feb 100644 --- a/src/heartwall-omp/Makefile +++ b/src/heartwall-omp/Makefile @@ -36,7 +36,7 @@ endif -heartwall: ./main.o \ +main: ./main.o \ ./kernel/kernel.o \ ./util/avi/avilib.o \ ./util/avi/avimod.o \ @@ -48,7 +48,7 @@ heartwall: ./main.o \ ./util/avi/avimod.o \ ./util/file/file.o \ ./util/timer/timer.o \ - $(LDFLAGS) -o heartwall + $(LDFLAGS) -o main # ======================================================================================================================================================150 # MAIN FUNCTION @@ -103,11 +103,11 @@ heartwall: ./main.o \ -c \ -o ./util/timer/timer.o -run: heartwall - $(LAUNCHER) ./heartwall 104 +run: main + $(LAUNCHER) ./main 104 clean: - rm -rf *.o heartwall \ + rm -rf *.o main \ ./kernel/*.o \ ./util/avi/*.o \ ./util/file/*.o \ diff --git a/src/heartwall-omp/Makefile.aomp b/src/heartwall-omp/Makefile.aomp index b9b58444e9..c07591f365 100644 --- a/src/heartwall-omp/Makefile.aomp +++ b/src/heartwall-omp/Makefile.aomp @@ -40,7 +40,7 @@ endif -heartwall: ./main.o \ +main: ./main.o \ ./kernel/kernel.o \ ./util/avi/avilib.o \ ./util/avi/avimod.o \ @@ -52,7 +52,7 @@ heartwall: ./main.o \ ./util/avi/avimod.o \ ./util/file/file.o \ ./util/timer/timer.o \ - $(LDFLAGS) -o heartwall + $(LDFLAGS) -o main # ======================================================================================================================================================150 # MAIN FUNCTION @@ -107,11 +107,11 @@ heartwall: ./main.o \ -c \ -o ./util/timer/timer.o -run: heartwall - $(LAUNCHER) ./heartwall 104 +run: main + $(LAUNCHER) ./main 104 clean: - rm -rf *.o heartwall \ + rm -rf *.o main \ ./kernel/*.o \ ./util/avi/*.o \ ./util/file/*.o \ diff --git a/src/heartwall-omp/Makefile.nvc b/src/heartwall-omp/Makefile.nvc index 32e73b204b..28c393014b 100644 --- a/src/heartwall-omp/Makefile.nvc +++ b/src/heartwall-omp/Makefile.nvc @@ -35,7 +35,7 @@ endif -heartwall: ./main.o \ +main: ./main.o \ ./kernel/kernel.o \ ./util/avi/avilib.o \ ./util/avi/avimod.o \ @@ -47,7 +47,7 @@ heartwall: ./main.o \ ./util/avi/avimod.o \ ./util/file/file.o \ ./util/timer/timer.o \ - $(LDFLAGS) -o heartwall + $(LDFLAGS) -o main # ======================================================================================================================================================150 # MAIN FUNCTION @@ -102,11 +102,11 @@ heartwall: ./main.o \ -c \ -o ./util/timer/timer.o -run: heartwall - $(LAUNCHER) ./heartwall 104 +run: main + $(LAUNCHER) ./main 104 clean: - rm -rf *.o heartwall \ + rm -rf *.o main \ ./kernel/*.o \ ./util/avi/*.o \ ./util/file/*.o \ diff --git a/src/heartwall-sycl/Makefile b/src/heartwall-sycl/Makefile index cc427dc773..dda948d6d0 100644 --- a/src/heartwall-sycl/Makefile +++ b/src/heartwall-sycl/Makefile @@ -75,7 +75,7 @@ endif # Targets to Build #=============================================================================== -heartwall:./main.o \ +main: ./main.o \ ./kernel/kernel.o \ ./util/avi/avilib.o \ ./util/avi/avimod.o \ @@ -87,7 +87,7 @@ heartwall:./main.o \ ./util/avi/avimod.o \ ./util/file/file.o \ ./util/timer/timer.o \ - $(LDFLAGS) -o heartwall + $(LDFLAGS) -o main # ======================================================================================================================================================150 # MAIN FUNCTION @@ -131,12 +131,11 @@ heartwall:./main.o \ -o ./util/timer/timer.o clean: - rm -rf *.o heartwall \ + rm -rf *.o main \ ./kernel/*.o \ ./util/avi/*.o \ ./util/file/*.o \ ./util/timer/*.o -run: heartwall - $(LAUNCHER) ./heartwall 104 - +run: main + $(LAUNCHER) ./main 104 diff --git a/src/heat2d-cuda/main.cu b/src/heat2d-cuda/main.cu index 1bbb8ee335..3ac22fa1b4 100644 --- a/src/heat2d-cuda/main.cu +++ b/src/heat2d-cuda/main.cu @@ -157,5 +157,6 @@ int main(int argc, char *argv[]) { free(h_out); free(h_in); free(d_res); + if (!ok) return 1; return 0; } diff --git a/src/heat2d-hip/main.cu b/src/heat2d-hip/main.cu index 81d57c0ae1..12fea9459e 100644 --- a/src/heat2d-hip/main.cu +++ b/src/heat2d-hip/main.cu @@ -157,5 +157,6 @@ int main(int argc, char *argv[]) { free(h_out); free(h_in); free(d_res); + if (!ok) return 1; return 0; } diff --git a/src/heat2d-omp/main.cpp b/src/heat2d-omp/main.cpp index 1b579ea799..f24532d19f 100644 --- a/src/heat2d-omp/main.cpp +++ b/src/heat2d-omp/main.cpp @@ -144,5 +144,6 @@ int main(int argc, char *argv[]) { free(h_in); free(d_in); free(d_out); + if (!ok) return 1; return 0; } diff --git a/src/heat2d-sycl/main.cpp b/src/heat2d-sycl/main.cpp index dd71d952b3..b7d7a88ad3 100644 --- a/src/heat2d-sycl/main.cpp +++ b/src/heat2d-sycl/main.cpp @@ -168,5 +168,6 @@ int main(int argc, char *argv[]) { free(h_out); free(h_in); free(d_res); + if (!ok) return 1; return 0; } diff --git a/src/hellinger-cuda/verify.h b/src/hellinger-cuda/verify.h index 12bd59e8cf..15e7815ae6 100644 --- a/src/hellinger-cuda/verify.h +++ b/src/hellinger-cuda/verify.h @@ -1,5 +1,6 @@ #ifdef VERIFY #include +#include /** * Perform matrix multiplication on host to verify results from device. @@ -57,6 +58,7 @@ void VerifyResult(FP (*a_host)[N], FP (*b_host)[P], std::cout << "PASS\n"; } else { std::cout << "FAIL\n"; + exit(1); } } #endif diff --git a/src/histogram-cuda/histogram_compare.cu b/src/histogram-cuda/histogram_compare.cu index 42817594de..8b4d542385 100644 --- a/src/histogram-cuda/histogram_compare.cu +++ b/src/histogram-cuda/histogram_compare.cu @@ -73,6 +73,7 @@ __device__ __forceinline__ void DecodePixel(uchar1 pixel, unsigned int (&bins)[A #include "histogram_gmem_atomics.h" #include "histogram_smem_atomics.h" +#include //--------------------------------------------------------------------- // Globals, constants, and type declarations //--------------------------------------------------------------------- @@ -660,5 +661,6 @@ int main(int argc, char **argv) cudaDeviceSynchronize(); printf("\n\n"); + if (compare) return 1; return 0; } diff --git a/src/histogram-hip/histogram_compare.cu b/src/histogram-hip/histogram_compare.cu index e181ecb894..2412817d1a 100644 --- a/src/histogram-hip/histogram_compare.cu +++ b/src/histogram-hip/histogram_compare.cu @@ -73,6 +73,7 @@ __device__ __forceinline__ void DecodePixel(uchar1 pixel, unsigned int (&bins)[A #include "histogram_gmem_atomics.h" #include "histogram_smem_atomics.h" +#include //--------------------------------------------------------------------- // Globals, constants, and type declarations //--------------------------------------------------------------------- @@ -660,5 +661,6 @@ int main(int argc, char **argv) hipDeviceSynchronize(); printf("\n\n"); + if (compare) return 1; return 0; } diff --git a/src/histogram-omp/histogram_compare_base.cpp b/src/histogram-omp/histogram_compare_base.cpp index bf4bddf927..c6061dba00 100644 --- a/src/histogram-omp/histogram_compare_base.cpp +++ b/src/histogram-omp/histogram_compare_base.cpp @@ -87,6 +87,7 @@ inline void DecodePixel(uchar1 pixel, unsigned int (&bins)[ACTIVE_CHANNELS]) #include "histogram_gmem_atomics.hpp" #include "histogram_smem_atomics.hpp" +#include struct less_than_value { @@ -663,5 +664,6 @@ int main(int argc, char **argv) printf("\n\n"); + if (compare) return 1; return 0; } diff --git a/src/histogram-sycl/histogram_compare_base.cpp b/src/histogram-sycl/histogram_compare_base.cpp index f2ae3fd64f..cba9c4cbbf 100644 --- a/src/histogram-sycl/histogram_compare_base.cpp +++ b/src/histogram-sycl/histogram_compare_base.cpp @@ -96,6 +96,7 @@ class hist_smem_accum; #include "histogram_gmem_atomics.hpp" #include "histogram_smem_atomics.hpp" +#include struct less_than_value { @@ -686,5 +687,6 @@ int main(int argc, char **argv) printf("\n\n"); + if (compare) return 1; return 0; } diff --git a/src/hmm-hip/Makefile.hipcl b/src/hmm-hip/Makefile.hipcl index b25d2f0bd2..1362302079 100644 --- a/src/hmm-hip/Makefile.hipcl +++ b/src/hmm-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = hmm +program = main source = HiddenMarkovModel.cu ViterbiCPU.cu ViterbiGPU.cu diff --git a/src/hogbom-cuda/main.cpp b/src/hogbom-cuda/main.cpp index a7cf206445..cb37b8fde6 100644 --- a/src/hogbom-cuda/main.cpp +++ b/src/hogbom-cuda/main.cpp @@ -85,6 +85,7 @@ int main(int argc, char* argv[]) const bool modelDiff = compare(goldenModel, deviceModel); if (!modelDiff) { std::cout << "FAIL" << std::endl; + exit(1); } else { std::cout << "PASS" << std::endl; } @@ -93,6 +94,7 @@ int main(int argc, char* argv[]) const bool residualDiff = compare(goldenResidual, deviceResidual); if (!residualDiff) { std::cout << "FAIL" << std::endl; + exit(1); } else { std::cout << "PASS" << std::endl; } diff --git a/src/hwt1d-cuda/main.cu b/src/hwt1d-cuda/main.cu index 634e705e2d..c94debd392 100644 --- a/src/hwt1d-cuda/main.cu +++ b/src/hwt1d-cuda/main.cu @@ -15,6 +15,7 @@ ********************************************************************/ #include "hwt.h" +#include // rounds to a power of 2 template @@ -119,6 +120,7 @@ int main(int argc, char * argv[]) std::cout << "PASS" << std::endl; else std::cout << "FAIL" << std::endl; + if (!ok) exit(1); return 0; } diff --git a/src/hwt1d-hip/main.cu b/src/hwt1d-hip/main.cu index b3bf500aae..4e53ee16da 100644 --- a/src/hwt1d-hip/main.cu +++ b/src/hwt1d-hip/main.cu @@ -15,6 +15,7 @@ ********************************************************************/ #include "hwt.h" +#include // rounds to a power of 2 template @@ -119,6 +120,7 @@ int main(int argc, char * argv[]) std::cout << "PASS" << std::endl; else std::cout << "FAIL" << std::endl; + if (!ok) exit(1); return 0; } diff --git a/src/hwt1d-omp/main.cpp b/src/hwt1d-omp/main.cpp index 78f8e38420..a8af0ed7e7 100644 --- a/src/hwt1d-omp/main.cpp +++ b/src/hwt1d-omp/main.cpp @@ -15,6 +15,7 @@ ********************************************************************/ #include "hwt.h" +#include // rounds to a power of 2 template @@ -239,6 +240,7 @@ int main(int argc, char * argv[]) std::cout << "PASS" << std::endl; else std::cout << "FAIL" << std::endl; + if (!ok) exit(1); return 0; } diff --git a/src/hwt1d-sycl/main.cpp b/src/hwt1d-sycl/main.cpp index 07e1f32e3b..3414989c35 100644 --- a/src/hwt1d-sycl/main.cpp +++ b/src/hwt1d-sycl/main.cpp @@ -15,6 +15,7 @@ ********************************************************************/ #include "hwt.h" +#include // rounds to a power of 2 template @@ -120,6 +121,7 @@ int main(int argc, char * argv[]) std::cout << "PASS" << std::endl; else std::cout << "FAIL" << std::endl; + if (!ok) exit(1); return 0; } diff --git a/src/hybridsort-cuda/Makefile b/src/hybridsort-cuda/Makefile index 97871b4220..aee79b60a0 100644 --- a/src/hybridsort-cuda/Makefile +++ b/src/hybridsort-cuda/Makefile @@ -30,8 +30,8 @@ ifdef TIMER override TIMER = -DTIMER endif -hybridsort: hybridsort.o bucketsort.o mergesort.o - $(CC) $(CFLAGS) -o hybridsort $(VERIFY) $(OUTPUT) $(TIMER) \ +main: hybridsort.o bucketsort.o mergesort.o + $(CC) $(CFLAGS) -o main $(VERIFY) $(OUTPUT) $(TIMER) \ hybridsort.o bucketsort.o mergesort.o $(LDFLAGS) hybridsort.o: hybridsort.cu bucketsort.h mergesort.h @@ -47,8 +47,8 @@ bucketsort.o: bucketsort.cu \ mergesort.o: mergesort.cu mergesort.h kernel_mergeSortPass.h $(CC) $(CFLAGS) -o mergesort.o -c mergesort.cu -run: hybridsort - $(LAUNCHER) ./hybridsort r +run: main + $(LAUNCHER) ./main r clean: - rm -f *.o hybridsort + rm -f *.o main diff --git a/src/hybridsort-cuda/hybridsort.cu b/src/hybridsort-cuda/hybridsort.cu index a9c2cfff07..c96ea6d778 100644 --- a/src/hybridsort-cuda/hybridsort.cu +++ b/src/hybridsort-cuda/hybridsort.cu @@ -180,6 +180,7 @@ int main(int argc, char** argv) free(nullElements); free(origOffsets); + if (count != 0) return 1; return 0; } diff --git a/src/hybridsort-hip/Makefile.hipcl b/src/hybridsort-hip/Makefile.hipcl index 4e19c95b89..bd6eac9a49 100644 --- a/src/hybridsort-hip/Makefile.hipcl +++ b/src/hybridsort-hip/Makefile.hipcl @@ -27,8 +27,8 @@ ifdef TIMER override TIMER = -DTIMER endif -hybridsort: hybridsort.o bucketsort.o mergesort.o - $(CC) -o hybridsort $(VERIFY) $(OUTPUT) $(TIMER) \ +main: hybridsort.o bucketsort.o mergesort.o + $(CC) -o main $(VERIFY) $(OUTPUT) $(TIMER) \ hybridsort.o bucketsort.o mergesort.o $(LDFLAGS) hybridsort.o: hybridsort.cu bucketsort.h mergesort.h @@ -44,8 +44,8 @@ bucketsort.o: bucketsort.cu \ mergesort.o: mergesort.cu mergesort.h kernel_mergeSortPass.h $(CC) $(CFLAGS) -o mergesort.o -c mergesort.cu -run: hybridsort - ./hybridsort r +run: main + ./main r clean: - rm -f *.o hybridsort + rm -f *.o main diff --git a/src/hybridsort-hip/hybridsort.cu b/src/hybridsort-hip/hybridsort.cu index a9c2cfff07..c96ea6d778 100644 --- a/src/hybridsort-hip/hybridsort.cu +++ b/src/hybridsort-hip/hybridsort.cu @@ -180,6 +180,7 @@ int main(int argc, char** argv) free(nullElements); free(origOffsets); + if (count != 0) return 1; return 0; } diff --git a/src/hybridsort-omp/Makefile b/src/hybridsort-omp/Makefile index 2281538957..8b79d2a13a 100644 --- a/src/hybridsort-omp/Makefile +++ b/src/hybridsort-omp/Makefile @@ -41,8 +41,8 @@ ifdef TIMER override TIMER = -DTIMER endif -hybridsort: hybridsort.o bucketsort.o mergesort.o - $(CC) $(CFLAGS) -o hybridsort $(VERIFY) $(OUTPUT) $(TIMER) \ +main: hybridsort.o bucketsort.o mergesort.o + $(CC) $(CFLAGS) -o main $(VERIFY) $(OUTPUT) $(TIMER) \ hybridsort.o \ bucketsort.o \ mergesort.o \ @@ -61,8 +61,8 @@ bucketsort.o: bucketsort.c \ mergesort.o: mergesort.c mergesort.h kernel_mergeSortPass.h $(CC) $(CFLAGS) -o mergesort.o -c mergesort.c -run: hybridsort - $(LAUNCHER) ./hybridsort r +run: main + $(LAUNCHER) ./main r clean: - rm -f *.o hybridsort + rm -f *.o main diff --git a/src/hybridsort-omp/Makefile.aomp b/src/hybridsort-omp/Makefile.aomp index a30c912ab7..7f8aea55ab 100644 --- a/src/hybridsort-omp/Makefile.aomp +++ b/src/hybridsort-omp/Makefile.aomp @@ -44,8 +44,8 @@ ifdef TIMER override TIMER = -DTIMER endif -hybridsort: hybridsort.o bucketsort.o mergesort.o - $(CC) $(CFLAGS) -o hybridsort $(VERIFY) $(OUTPUT) $(TIMER) \ +main: hybridsort.o bucketsort.o mergesort.o + $(CC) $(CFLAGS) -o main $(VERIFY) $(OUTPUT) $(TIMER) \ hybridsort.o \ bucketsort.o \ mergesort.o \ @@ -64,8 +64,8 @@ bucketsort.o: bucketsort.c \ mergesort.o: mergesort.c mergesort.h kernel_mergeSortPass.h $(CC) $(CFLAGS) -o mergesort.o -c mergesort.c -run: hybridsort - $(LAUNCHER) ./hybridsort r +run: main + $(LAUNCHER) ./main r clean: - rm -f *.o hybridsort + rm -f *.o main diff --git a/src/hybridsort-omp/Makefile.nvc b/src/hybridsort-omp/Makefile.nvc index 15250cdab1..4419be9b7f 100644 --- a/src/hybridsort-omp/Makefile.nvc +++ b/src/hybridsort-omp/Makefile.nvc @@ -41,8 +41,8 @@ ifdef TIMER override TIMER = -DTIMER endif -hybridsort: hybridsort.o bucketsort.o mergesort.o - $(CC) $(CFLAGS) -o hybridsort $(VERIFY) $(OUTPUT) $(TIMER) \ +main: hybridsort.o bucketsort.o mergesort.o + $(CC) $(CFLAGS) -o main $(VERIFY) $(OUTPUT) $(TIMER) \ hybridsort.o \ bucketsort.o \ mergesort.o \ @@ -61,8 +61,8 @@ bucketsort.o: bucketsort.c \ mergesort.o: mergesort.c mergesort.h kernel_mergeSortPass.h $(CC) $(CFLAGS) -o mergesort.o -c mergesort.c -run: hybridsort - $(LAUNCHER) ./hybridsort r +run: main + $(LAUNCHER) ./main r clean: - rm -f *.o hybridsort + rm -f *.o main diff --git a/src/hybridsort-omp/hybridsort.c b/src/hybridsort-omp/hybridsort.c index 1e7af02e26..9a2b1b32f1 100644 --- a/src/hybridsort-omp/hybridsort.c +++ b/src/hybridsort-omp/hybridsort.c @@ -178,6 +178,7 @@ int main(int argc, char** argv) free(nullElements); free(origOffsets); + if (count != 0) return 1; return 0; } diff --git a/src/hybridsort-sycl/Makefile b/src/hybridsort-sycl/Makefile index 2f4e13a597..9f86c9f41f 100644 --- a/src/hybridsort-sycl/Makefile +++ b/src/hybridsort-sycl/Makefile @@ -78,8 +78,8 @@ endif # Targets to Build #=============================================================================== -hybridsort: hybridsort.o bucketsort.o mergesort.o - $(CC) $(CFLAGS) -o hybridsort $(VERIFY) $(OUTPUT) $(TIMER) \ +main: hybridsort.o bucketsort.o mergesort.o + $(CC) $(CFLAGS) -o main $(VERIFY) $(OUTPUT) $(TIMER) \ hybridsort.o bucketsort.o mergesort.o $(LDFLAGS) hybridsort.o : hybridsort.c mergesort.h bucketsort.h @@ -95,8 +95,8 @@ bucketsort.o: bucketsort.c \ mergesort.o: mergesort.c mergesort.h kernel_mergeSortPass.sycl $(CC) $(CFLAGS) -o mergesort.o -c mergesort.c -run: hybridsort - $(LAUNCHER) ./hybridsort r +run: main + $(LAUNCHER) ./main r clean: - rm -f *.o hybridsort + rm -f *.o main diff --git a/src/hybridsort-sycl/hybridsort.c b/src/hybridsort-sycl/hybridsort.c index adefbf6843..84d2abc62b 100644 --- a/src/hybridsort-sycl/hybridsort.c +++ b/src/hybridsort-sycl/hybridsort.c @@ -189,5 +189,6 @@ int main(int argc, char** argv) free(nullElements); free(origOffsets); + if (count != 0) return 1; return 0; } diff --git a/src/interval-cuda/main.cu b/src/interval-cuda/main.cu index 7a612caab2..6a48bb8134 100644 --- a/src/interval-cuda/main.cu +++ b/src/interval-cuda/main.cu @@ -40,6 +40,7 @@ #include "interval.h" #include "gpu_interval.h" #include "cpu_interval.h" +#include int main(int argc, char *argv[]) { if (argc != 3) { @@ -125,5 +126,6 @@ int main(int argc, char *argv[]) { delete[] h_result; delete[] h_nresults; + if (!bTestResult) return 1; return 0; } diff --git a/src/interval-hip/main.cu b/src/interval-hip/main.cu index 11a21cf2ed..5b52232638 100644 --- a/src/interval-hip/main.cu +++ b/src/interval-hip/main.cu @@ -41,6 +41,7 @@ #include "interval.h" #include "gpu_interval.h" #include "cpu_interval.h" +#include int main(int argc, char *argv[]) { if (argc != 3) { @@ -126,5 +127,6 @@ int main(int argc, char *argv[]) { delete[] h_result; delete[] h_nresults; + if (!bTestResult) return 1; return 0; } diff --git a/src/interval-omp/main.cpp b/src/interval-omp/main.cpp index c45cac9f33..1070297d16 100644 --- a/src/interval-omp/main.cpp +++ b/src/interval-omp/main.cpp @@ -42,6 +42,7 @@ #include "interval.h" #include "gpu_interval.h" #include "cpu_interval.h" +#include int main(int argc, char *argv[]) { if (argc != 3) { @@ -141,5 +142,6 @@ int main(int argc, char *argv[]) { delete[] h_result; delete[] h_nresults; + if (!bTestResult) return 1; return 0; } diff --git a/src/interval-sycl/main.cpp b/src/interval-sycl/main.cpp index ceac3a1aa8..dc8eb2a845 100644 --- a/src/interval-sycl/main.cpp +++ b/src/interval-sycl/main.cpp @@ -41,6 +41,7 @@ #include "interval.h" #include "gpu_interval.h" #include "cpu_interval.h" +#include int main(int argc, char *argv[]) { if (argc != 3) { @@ -135,5 +136,6 @@ int main(int argc, char *argv[]) { delete[] h_result; delete[] h_nresults; + if (!bTestResult) return 1; return 0; } diff --git a/src/inversek2j-cuda/main.cu b/src/inversek2j-cuda/main.cu index 56b5932630..478e899da2 100644 --- a/src/inversek2j-cuda/main.cu +++ b/src/inversek2j-cuda/main.cu @@ -310,6 +310,7 @@ int main(int argc, char* argv[]) cout << "FAIL\n"; else cout << "PASS\n"; + if (error) exit(1); return 0; } diff --git a/src/inversek2j-hip/Makefile.hipcl b/src/inversek2j-hip/Makefile.hipcl index 48aee0136d..b70cdbad17 100644 --- a/src/inversek2j-hip/Makefile.hipcl +++ b/src/inversek2j-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = invkin +program = main source = main.cu diff --git a/src/inversek2j-hip/main.cu b/src/inversek2j-hip/main.cu index 9785dbed91..899bea1d2b 100644 --- a/src/inversek2j-hip/main.cu +++ b/src/inversek2j-hip/main.cu @@ -311,6 +311,7 @@ int main(int argc, char* argv[]) cout << "FAIL\n"; else cout << "PASS\n"; + if (error) exit(1); return 0; } diff --git a/src/inversek2j-omp/main.cpp b/src/inversek2j-omp/main.cpp index fff58327cc..30cdb83ec4 100644 --- a/src/inversek2j-omp/main.cpp +++ b/src/inversek2j-omp/main.cpp @@ -275,6 +275,7 @@ int main(int argc, char* argv[]) std::cout << "FAIL\n"; else std::cout << "PASS\n"; + if (error) exit(1); return 0; } diff --git a/src/inversek2j-sycl/main.cpp b/src/inversek2j-sycl/main.cpp index d7cf8a29f4..82f8e262fb 100644 --- a/src/inversek2j-sycl/main.cpp +++ b/src/inversek2j-sycl/main.cpp @@ -310,6 +310,7 @@ int main(int argc, char* argv[]) std::cout << "FAIL\n"; else std::cout << "PASS\n"; + if (error) exit(1); return 0; } diff --git a/src/is-cuda/main.cu b/src/is-cuda/main.cu index ea736ea669..a53a0f6018 100644 --- a/src/is-cuda/main.cu +++ b/src/is-cuda/main.cu @@ -359,5 +359,6 @@ int main(int argc, char** argv){ cudaFree(passed_verification_device); cudaFree(sum_device); + if (!passed_verification) return 1; return 0; } diff --git a/src/is-hip/main.cu b/src/is-hip/main.cu index 88e627ec50..4091017abc 100644 --- a/src/is-hip/main.cu +++ b/src/is-hip/main.cu @@ -345,5 +345,6 @@ int main(int argc, char** argv){ hipFree(passed_verification_device); hipFree(sum_device); + if (!passed_verification) return 1; return 0; } diff --git a/src/is-sycl/main.cpp b/src/is-sycl/main.cpp index 015432488e..90dd3c3412 100644 --- a/src/is-sycl/main.cpp +++ b/src/is-sycl/main.cpp @@ -437,5 +437,6 @@ int main(int argc, char** argv){ sycl::free(passed_verification_device, q); sycl::free(sum_device, q); + if (!passed_verification) return 1; return 0; } diff --git a/src/ising-cuda/main.cu b/src/ising-cuda/main.cu index 54e6df43b4..8584649559 100644 --- a/src/ising-cuda/main.cu +++ b/src/ising-cuda/main.cu @@ -34,6 +34,7 @@ #endif #include "cudamacro.h" +#include #define TCRIT 2.26918531421f #define THREADS 128 @@ -314,5 +315,6 @@ int main(int argc, char **argv) { cudaFree(lattice_w); cudaFree(randvals); + if (!ok) return 1; return 0; } diff --git a/src/ising-hip/main.cu b/src/ising-hip/main.cu index 2c9c4a7daf..3843582e35 100644 --- a/src/ising-hip/main.cu +++ b/src/ising-hip/main.cu @@ -34,6 +34,7 @@ #endif #include "hipmacro.h" +#include #define TCRIT 2.26918531421f #define THREADS 128 @@ -314,5 +315,6 @@ int main(int argc, char **argv) { hipFree(lattice_w); hipFree(randvals); + if (!ok) return 1; return 0; } diff --git a/src/ising-omp/main.cpp b/src/ising-omp/main.cpp index 511d1abea5..88399b2e29 100644 --- a/src/ising-omp/main.cpp +++ b/src/ising-omp/main.cpp @@ -27,6 +27,7 @@ #include #include #include "reference.h" +#include #define TCRIT 2.26918531421f #define THREADS 128 @@ -254,5 +255,6 @@ int main(int argc, char **argv) { free(lattice_w); free(lattice_b_r); free(lattice_w_r); + if (!ok) return 1; return 0; } diff --git a/src/ising-sycl/main.cpp b/src/ising-sycl/main.cpp index 52947e5037..b576c14f90 100644 --- a/src/ising-sycl/main.cpp +++ b/src/ising-sycl/main.cpp @@ -33,6 +33,7 @@ #include #include "reference.h" +#include #define TCRIT 2.26918531421f #define THREADS 128 @@ -354,5 +355,6 @@ int main(int argc, char **argv) { sycl::free(d_lattice_w, q); sycl::free(d_randvals, q); + if (!ok) return 1; return 0; } diff --git a/src/iso2dfd-cuda/iso2dfd.cu b/src/iso2dfd-cuda/iso2dfd.cu index ebe7773f90..8c55d58a1a 100644 --- a/src/iso2dfd-cuda/iso2dfd.cu +++ b/src/iso2dfd-cuda/iso2dfd.cu @@ -20,6 +20,7 @@ #include #include #include "iso2dfd.h" +#include #define BLOCK_SIZE 16 #define MIN(a, b) (a) < (b) ? (a) : (b) @@ -296,6 +297,7 @@ int main(int argc, char* argv[]) { << std::endl; error = within_epsilon(next_base, next_cpu, nRows, nCols, HALF_LENGTH, 0.1f); std::cout << (error ? "FAIL" : "PASS") << std::endl; + if (error) exit(1); // Output final wavefield (computed by CPU) to binary file outFile.open("wavefield_snapshot_cpu.bin", std::ios::out | std::ios::binary); diff --git a/src/iso2dfd-hip/Makefile.hipcl b/src/iso2dfd-hip/Makefile.hipcl index 83f3eaeef4..80098386b0 100644 --- a/src/iso2dfd-hip/Makefile.hipcl +++ b/src/iso2dfd-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = iso2dfd +program = main source = iso2dfd.cu diff --git a/src/iso2dfd-hip/iso2dfd.cu b/src/iso2dfd-hip/iso2dfd.cu index b502bf1836..d65f11534b 100644 --- a/src/iso2dfd-hip/iso2dfd.cu +++ b/src/iso2dfd-hip/iso2dfd.cu @@ -20,6 +20,7 @@ #include #include #include "iso2dfd.h" +#include #define BLOCK_SIZE 16 #define MIN(a, b) (a) < (b) ? (a) : (b) @@ -296,6 +297,7 @@ int main(int argc, char* argv[]) { << std::endl; error = within_epsilon(next_base, next_cpu, nRows, nCols, HALF_LENGTH, 0.1f); std::cout << (error ? "FAIL" : "PASS") << std::endl; + if (error) exit(1); // Output final wavefield (computed by CPU) to binary file outFile.open("wavefield_snapshot_cpu.bin", std::ios::out | std::ios::binary); diff --git a/src/iso2dfd-omp/iso2dfd.cpp b/src/iso2dfd-omp/iso2dfd.cpp index 6e16630f73..49f499396a 100644 --- a/src/iso2dfd-omp/iso2dfd.cpp +++ b/src/iso2dfd-omp/iso2dfd.cpp @@ -20,6 +20,7 @@ #include #include #include "iso2dfd.h" +#include #define MIN(a, b) (a) < (b) ? (a) : (b) @@ -264,6 +265,7 @@ int main(int argc, char* argv[]) { << std::endl; error = within_epsilon(next_base, next_cpu, nRows, nCols, HALF_LENGTH, 0.1f); std::cout << (error ? "FAIL" : "PASS") << std::endl; + if (error) exit(1); // Output final wavefield (computed by CPU) to binary file outFile.open("wavefield_snapshot_cpu.bin", std::ios::out | std::ios::binary); diff --git a/src/iso2dfd-sycl/iso2dfd.cpp b/src/iso2dfd-sycl/iso2dfd.cpp index 332f1fdea5..abeefbf895 100644 --- a/src/iso2dfd-sycl/iso2dfd.cpp +++ b/src/iso2dfd-sycl/iso2dfd.cpp @@ -20,6 +20,7 @@ #include #include #include "iso2dfd.h" +#include #define MIN(a, b) (a) < (b) ? (a) : (b) @@ -303,6 +304,7 @@ int main(int argc, char* argv[]) { << std::endl; error = within_epsilon(next_base, next_cpu, nRows, nCols, HALF_LENGTH, 0.1f); std::cout << (error ? "FAIL" : "PASS") << std::endl; + if (error) exit(1); // Output final wavefield (computed by CPU) to binary file outFile.open("wavefield_snapshot_cpu.bin", std::ios::out | std::ios::binary); diff --git a/src/jaccard-cuda/main.cu b/src/jaccard-cuda/main.cu index 4cda9944e4..7129fba8cc 100644 --- a/src/jaccard-cuda/main.cu +++ b/src/jaccard-cuda/main.cu @@ -21,6 +21,7 @@ #include #include #include +#include using namespace std; @@ -370,6 +371,7 @@ void jaccard_weight (const int iteration, const int n, const int e, if (error > 1e-5) { for (int i = 0; i < e; i++) printf("wj: %d %f\n", i, weight_j[i]); printf("FAIL"); + exit(1); } else { printf("PASS"); } diff --git a/src/jaccard-hip/main.cu b/src/jaccard-hip/main.cu index f281105479..98d511860f 100644 --- a/src/jaccard-hip/main.cu +++ b/src/jaccard-hip/main.cu @@ -21,6 +21,7 @@ #include #include #include +#include using namespace std; @@ -369,6 +370,7 @@ void jaccard_weight (const int iteration, const int n, const int e, if (error > 1e-5) { for (int i = 0; i < e; i++) printf("wj: %d %f\n", i, weight_j[i]); printf("FAILED"); + exit(1); } else { printf("PASSED"); } diff --git a/src/jaccard-sycl/main.cpp b/src/jaccard-sycl/main.cpp index 7f982ee046..e5d5b895f9 100644 --- a/src/jaccard-sycl/main.cpp +++ b/src/jaccard-sycl/main.cpp @@ -21,6 +21,7 @@ #include #include #include +#include using namespace std; @@ -393,6 +394,7 @@ void jaccard_weight (sycl::queue &q, const int iteration, const int n, const int if (error > 1e-5) { for (int i = 0; i < e; i++) printf("wj: %d %f\n", i, weight_j[i]); printf("FAIL"); + exit(1); } else { printf("PASS"); } diff --git a/src/jacobi-cuda/main.cu b/src/jacobi-cuda/main.cu index e2bf44752e..e0f9fb8782 100644 --- a/src/jacobi-cuda/main.cu +++ b/src/jacobi-cuda/main.cu @@ -19,6 +19,7 @@ #include #include #include +#include // A multiple of thread block size #define N 2048 @@ -203,6 +204,7 @@ int main () { } else { std::cout << "FAIL" << std::endl; + exit(1); return -1; } diff --git a/src/jacobi-hip/main.cu b/src/jacobi-hip/main.cu index 1dce5e8f1f..3b93df6151 100644 --- a/src/jacobi-hip/main.cu +++ b/src/jacobi-hip/main.cu @@ -19,6 +19,7 @@ #include #include #include +#include // A multiple of thread block size #define N 2048 @@ -203,6 +204,7 @@ int main () { } else { std::cout << "FAIL" << std::endl; + exit(1); return -1; } diff --git a/src/jacobi-omp/main.cpp b/src/jacobi-omp/main.cpp index 5362aa65df..9007ce2165 100644 --- a/src/jacobi-omp/main.cpp +++ b/src/jacobi-omp/main.cpp @@ -19,6 +19,7 @@ #include #include #include +#include // A multiple of thread block size #define N 2048 @@ -124,6 +125,7 @@ int main () { } else { std::cout << "FAIL" << std::endl; + exit(1); return -1; } diff --git a/src/jacobi-sycl/main.cpp b/src/jacobi-sycl/main.cpp index 4a461966fa..376bda2a4b 100644 --- a/src/jacobi-sycl/main.cpp +++ b/src/jacobi-sycl/main.cpp @@ -19,6 +19,7 @@ #include #include #include +#include // A multiple of thread block size #define N 2048 @@ -223,6 +224,7 @@ int main() { } else { std::cout << "FAIL" << std::endl; + exit(1); return -1; } diff --git a/src/jenkins-hash-cuda/main.cu b/src/jenkins-hash-cuda/main.cu index 712151a43b..c94550ed82 100644 --- a/src/jenkins-hash-cuda/main.cu +++ b/src/jenkins-hash-cuda/main.cu @@ -312,5 +312,6 @@ int main(int argc, char** argv) { free(initvals); free(out); + if (error) return 1; return 0; } diff --git a/src/jenkins-hash-hip/main.cu b/src/jenkins-hash-hip/main.cu index 0294ea0b1f..df916a0bc9 100644 --- a/src/jenkins-hash-hip/main.cu +++ b/src/jenkins-hash-hip/main.cu @@ -313,5 +313,6 @@ int main(int argc, char** argv) { free(initvals); free(out); + if (error) return 1; return 0; } diff --git a/src/jenkins-hash-omp/main.cpp b/src/jenkins-hash-omp/main.cpp index 83ad031046..69a04a0246 100644 --- a/src/jenkins-hash-omp/main.cpp +++ b/src/jenkins-hash-omp/main.cpp @@ -284,5 +284,6 @@ int main(int argc, char** argv) { free(initvals); free(out); + if (error) return 1; return 0; } diff --git a/src/jenkins-hash-sycl/main.cpp b/src/jenkins-hash-sycl/main.cpp index 4e2811f5e2..2374426310 100644 --- a/src/jenkins-hash-sycl/main.cpp +++ b/src/jenkins-hash-sycl/main.cpp @@ -312,5 +312,6 @@ int main(int argc, char** argv) { free(initvals); free(out); + if (error) return 1; return 0; } diff --git a/src/kalman-cuda/reference.h b/src/kalman-cuda/reference.h index 4529f96242..d553c25a90 100644 --- a/src/kalman-cuda/reference.h +++ b/src/kalman-cuda/reference.h @@ -277,6 +277,7 @@ void reference ( } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); free(fc); free(F_fc); diff --git a/src/keccaktreehash-cuda/Test.cu b/src/keccaktreehash-cuda/Test.cu index 049a5a531d..a345b1cfa6 100644 --- a/src/keccaktreehash-cuda/Test.cu +++ b/src/keccaktreehash-cuda/Test.cu @@ -194,4 +194,5 @@ void Print_Param(void) void Verify_results(void) { printf("%s\n", isEqual_KS(Kstate_cpu, Kstate_gpu) ? "PASS" : "FAIL"); + if (!(Kstate_gpu))) exit(1); } diff --git a/src/keccaktreehash-hip/Makefile.hipcl b/src/keccaktreehash-hip/Makefile.hipcl index df89686e2c..440f5462a4 100644 --- a/src/keccaktreehash-hip/Makefile.hipcl +++ b/src/keccaktreehash-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = keccektree +program = main source = KeccakF.cu KeccakTreeCPU.cu KeccakTreeGPU.cu Test.cu main.cu diff --git a/src/keccaktreehash-hip/Test.cu b/src/keccaktreehash-hip/Test.cu index c6554f2fb7..ad82900dae 100644 --- a/src/keccaktreehash-hip/Test.cu +++ b/src/keccaktreehash-hip/Test.cu @@ -194,4 +194,5 @@ void Print_Param(void) void Verify_results(void) { printf("%s\n", isEqual_KS(Kstate_cpu, Kstate_gpu) ? "PASS" : "FAIL"); + if (!(Kstate_gpu))) exit(1); } diff --git a/src/keccaktreehash-omp/Test.cpp b/src/keccaktreehash-omp/Test.cpp index c12fb231f8..e9e13524b6 100644 --- a/src/keccaktreehash-omp/Test.cpp +++ b/src/keccaktreehash-omp/Test.cpp @@ -182,4 +182,5 @@ void Print_Param(void) void Verify_results(void) { printf("%s\n", isEqual_KS(Kstate_cpu, Kstate_gpu) ? "PASS" : "FAIL"); + if (!(Kstate_gpu))) exit(1); } diff --git a/src/keccaktreehash-sycl/Test.cpp b/src/keccaktreehash-sycl/Test.cpp index 90991c765e..44a6faca3b 100644 --- a/src/keccaktreehash-sycl/Test.cpp +++ b/src/keccaktreehash-sycl/Test.cpp @@ -188,6 +188,7 @@ void Print_Param(void) void Verify_results(void) { printf("%s\n", isEqual_KS(Kstate_cpu, Kstate_gpu) ? "PASS" : "FAIL"); + if (!(Kstate_gpu))) exit(1); } diff --git a/src/keogh-cuda/main.cu b/src/keogh-cuda/main.cu index 962e126928..89844bd788 100644 --- a/src/keogh-cuda/main.cu +++ b/src/keogh-cuda/main.cu @@ -139,5 +139,6 @@ int main(int argc, char* argv[]) { free(subject); free(lower); free(upper); + if (!ok) return 1; return 0; } diff --git a/src/keogh-hip/main.cu b/src/keogh-hip/main.cu index 68144a16ca..af4364d9b7 100644 --- a/src/keogh-hip/main.cu +++ b/src/keogh-hip/main.cu @@ -138,5 +138,6 @@ int main(int argc, char* argv[]) { free(subject); free(lower); free(upper); + if (!ok) return 1; return 0; } diff --git a/src/keogh-omp/main.cpp b/src/keogh-omp/main.cpp index 5d439cf6e7..bb9341075c 100644 --- a/src/keogh-omp/main.cpp +++ b/src/keogh-omp/main.cpp @@ -94,5 +94,6 @@ int main(int argc, char* argv[]) { free(subject); free(lower_bound); free(upper_bound); + if (!ok) return 1; return 0; } diff --git a/src/keogh-sycl/main.cpp b/src/keogh-sycl/main.cpp index 699c360e22..7d182110e8 100644 --- a/src/keogh-sycl/main.cpp +++ b/src/keogh-sycl/main.cpp @@ -139,6 +139,7 @@ int main(int argc, char* argv[]) { free(subject); free(lower); free(upper); + if (!ok) return 1; return 0; } diff --git a/src/kmeans-cuda/Makefile b/src/kmeans-cuda/Makefile index 47df41eb6d..d0ab486b8b 100644 --- a/src/kmeans-cuda/Makefile +++ b/src/kmeans-cuda/Makefile @@ -18,10 +18,10 @@ ifeq ($(OPTIMIZE),yes) CFLAGS += -O3 endif -all: kmeans +all: main -kmeans: cluster.o getopt.o read_input.o rmse.o kmeans.cpp - $(CC) $(KERNEL_DIM) $(CFLAGS) $^ -o kmeans $(LDFLAGS) +main: cluster.o getopt.o read_input.o rmse.o kmeans.cpp + $(CC) $(KERNEL_DIM) $(CFLAGS) $^ -o main $(LDFLAGS) %.o: %.cpp $(CC) $(CFLAGS) $< -c @@ -36,9 +36,9 @@ read_input.o: read_input.cpp kmeans.h rmse.o: rmse.cpp kmeans.h clean: - rm -f *.o *~ kmeans *.linkinfo + rm -f *.o *~ main *.linkinfo -run: kmeans - $(LAUNCHER) ./kmeans -r -n 5 -m 15 -l 10 -o -i ../data/kmeans/kdd_cup +run: main + $(LAUNCHER) ./main -r -n 5 -m 15 -l 10 -o -i ../data/kmeans/kdd_cup diff --git a/src/kmeans-hip/Makefile b/src/kmeans-hip/Makefile index b165cf7988..535503246c 100644 --- a/src/kmeans-hip/Makefile +++ b/src/kmeans-hip/Makefile @@ -17,10 +17,10 @@ ifeq ($(OPTIMIZE),yes) CFLAGS += -O3 endif -all: kmeans +all: main -kmeans: cluster.o getopt.o read_input.o rmse.o kmeans.cpp - $(CC) $(KERNEL_DIM) $(CFLAGS) $^ -o kmeans $(LDFLAGS) +main: cluster.o getopt.o read_input.o rmse.o kmeans.cpp + $(CC) $(KERNEL_DIM) $(CFLAGS) $^ -o main $(LDFLAGS) %.o: %.cpp $(CC) $(CFLAGS) $< -c @@ -35,9 +35,7 @@ read_input.o: read_input.cpp kmeans.h rmse.o: rmse.cpp kmeans.h clean: - rm -f *.o *~ kmeans *.linkinfo - -run: kmeans - $(LAUNCHER) ./kmeans -r -n 5 -m 15 -l 10 -o -i ../data/kmeans/kdd_cup - + rm -f *.o *~ main *.linkinfo +run: main + $(LAUNCHER) ./main -r -n 5 -m 15 -l 10 -o -i ../data/kmeans/kdd_cup diff --git a/src/kmeans-hip/Makefile.hipcl b/src/kmeans-hip/Makefile.hipcl index 50864024aa..1ff403bfde 100644 --- a/src/kmeans-hip/Makefile.hipcl +++ b/src/kmeans-hip/Makefile.hipcl @@ -17,10 +17,10 @@ ifeq ($(OPTIMIZE),yes) CFLAGS += -O3 endif -all: kmeans +all: main -kmeans: cluster.o getopt.o read_input.o rmse.o kmeans.cpp - $(CC) $(KERNEL_DIM) $^ -o kmeans $(LDFLAGS) +main: cluster.o getopt.o read_input.o rmse.o kmeans.cpp + $(CC) $(KERNEL_DIM) $^ -o main $(LDFLAGS) %.o: %.cpp $(CC) $(CFLAGS) $< -c @@ -35,9 +35,9 @@ read_input.o: read_input.cpp kmeans.h rmse.o: rmse.cpp kmeans.h clean: - rm -f *.o *~ kmeans *.linkinfo + rm -f *.o *~ main *.linkinfo -run: kmeans - ./kmeans -r -n 5 -m 15 -l 10 -o -i ../data/kmeans/kdd_cup +run: main + ./main -r -n 5 -m 15 -l 10 -o -i ../data/kmeans/kdd_cup diff --git a/src/kmeans-omp/Makefile b/src/kmeans-omp/Makefile index dc69b7df1c..f52607a314 100644 --- a/src/kmeans-omp/Makefile +++ b/src/kmeans-omp/Makefile @@ -33,10 +33,10 @@ else CFLAGS +=-qopenmp endif -all: kmeans +all: main -kmeans: cluster.o getopt.o read_input.o rmse.o kmeans.c - $(CC) $(KERNEL_DIM) $(CFLAGS) $^ -o kmeans $(LDFLAGS) +main: cluster.o getopt.o read_input.o rmse.o kmeans.c + $(CC) $(KERNEL_DIM) $(CFLAGS) $^ -o main $(LDFLAGS) %.o: %.c $(CC) $(CFLAGS) $< -c @@ -52,9 +52,9 @@ read_input.o: read_input.c kmeans.h rmse.o: rmse.c kmeans.h clean: - rm -f *.o *~ kmeans *.linkinfo + rm -f *.o *~ main *.linkinfo -run: kmeans - $(LAUNCHER) ./kmeans -r -n 5 -m 15 -l 10 -o -i ../data/kmeans/kdd_cup +run: main + $(LAUNCHER) ./main -r -n 5 -m 15 -l 10 -o -i ../data/kmeans/kdd_cup diff --git a/src/kmeans-omp/Makefile.aomp b/src/kmeans-omp/Makefile.aomp index 591488536a..7ca2cf5eb3 100644 --- a/src/kmeans-omp/Makefile.aomp +++ b/src/kmeans-omp/Makefile.aomp @@ -37,10 +37,10 @@ else CFLAGS +=-fopenmp endif -all: kmeans +all: main -kmeans: cluster.o getopt.o read_input.o rmse.o kmeans.c - $(CC) $(KERNEL_DIM) $(CFLAGS) $^ -o kmeans $(LDFLAGS) +main: cluster.o getopt.o read_input.o rmse.o kmeans.c + $(CC) $(KERNEL_DIM) $(CFLAGS) $^ -o main $(LDFLAGS) %.o: %.c $(CC) $(CFLAGS) $< -c @@ -56,9 +56,9 @@ read_input.o: read_input.c kmeans.h rmse.o: rmse.c kmeans.h clean: - rm -f *.o *~ kmeans *.linkinfo + rm -f *.o *~ main *.linkinfo -run: kmeans - $(LAUNCHER) ./kmeans -r -n 5 -m 15 -l 10 -o -i ../data/kmeans/kdd_cup +run: main + $(LAUNCHER) ./main -r -n 5 -m 15 -l 10 -o -i ../data/kmeans/kdd_cup diff --git a/src/kmeans-omp/Makefile.nvc b/src/kmeans-omp/Makefile.nvc index b7ae166337..ccae3ad18a 100644 --- a/src/kmeans-omp/Makefile.nvc +++ b/src/kmeans-omp/Makefile.nvc @@ -34,10 +34,10 @@ else CFLAGS +=-qopenmp endif -all: kmeans +all: main -kmeans: cluster.o getopt.o read_input.o rmse.o kmeans.c - $(CC) $(KERNEL_DIM) $(CFLAGS) $^ -o kmeans $(LDFLAGS) +main: cluster.o getopt.o read_input.o rmse.o kmeans.c + $(CC) $(KERNEL_DIM) $(CFLAGS) $^ -o main $(LDFLAGS) %.o: %.c $(CC) $(CFLAGS) $< -c @@ -53,9 +53,9 @@ read_input.o: read_input.c kmeans.h rmse.o: rmse.c kmeans.h clean: - rm -f *.o *~ kmeans *.linkinfo + rm -f *.o *~ main *.linkinfo -run: kmeans - $(LAUNCHER) ./kmeans -r -n 5 -m 15 -l 10 -o -i ../data/kmeans/kdd_cup +run: main + $(LAUNCHER) ./main -r -n 5 -m 15 -l 10 -o -i ../data/kmeans/kdd_cup diff --git a/src/knn-cuda/main.cu b/src/knn-cuda/main.cu index e346ec3563..12c7404e8b 100644 --- a/src/knn-cuda/main.cu +++ b/src/knn-cuda/main.cu @@ -485,6 +485,7 @@ int main(int argc, char* argv[]) { float index_accuracy = nb_correct_indexes / ((float)query_nb * k); printf("Precision accuracy %f\nIndex accuracy %f\n", precision_accuracy, index_accuracy); printf("%s\n", (precision_accuracy == 1.f) ? "PASS" : "FAIL"); + if (!(precision_accuracy == 1.f)) exit(1); free(ind); free(dist); diff --git a/src/knn-hip/main.cu b/src/knn-hip/main.cu index 8b3d602cfe..3c2ac85a4e 100644 --- a/src/knn-hip/main.cu +++ b/src/knn-hip/main.cu @@ -486,6 +486,7 @@ int main(int argc, char* argv[]) { float index_accuracy = nb_correct_indexes / ((float)query_nb * k); printf("Precision accuracy %f\nIndex accuracy %f\n", precision_accuracy, index_accuracy); printf("%s\n", (precision_accuracy == 1.f) ? "PASS" : "FAIL"); + if (!(precision_accuracy == 1.f)) exit(1); free(ind); free(dist); diff --git a/src/knn-omp/main.cpp b/src/knn-omp/main.cpp index c3ad0a4088..8b44f6ff7d 100644 --- a/src/knn-omp/main.cpp +++ b/src/knn-omp/main.cpp @@ -334,6 +334,7 @@ int main(int argc, char* argv[]) { float index_accuracy = nb_correct_indexes / ((float)query_nb * k); printf("Precision accuracy %f\nIndex accuracy %f\n", precision_accuracy, index_accuracy); printf("%s\n", (precision_accuracy == 1.f) ? "PASS" : "FAIL"); + if (!(precision_accuracy == 1.f)) exit(1); free(ind); free(dist); diff --git a/src/knn-sycl/main.cpp b/src/knn-sycl/main.cpp index 8d993bcd81..0453228500 100644 --- a/src/knn-sycl/main.cpp +++ b/src/knn-sycl/main.cpp @@ -422,6 +422,7 @@ int main(int argc, char* argv[]) { float index_accuracy = nb_correct_indexes / ((float)query_nb * k); printf("Precision accuracy %f\nIndex accuracy %f\n", precision_accuracy, index_accuracy); printf("%s\n", (precision_accuracy == 1.f) ? "PASS" : "FAIL"); + if (!(precision_accuracy == 1.f)) exit(1); free(ind); free(dist); diff --git a/src/laplace-cuda/main.cu b/src/laplace-cuda/main.cu index 4b22882c6f..601b5af7d9 100644 --- a/src/laplace-cuda/main.cu +++ b/src/laplace-cuda/main.cu @@ -309,5 +309,6 @@ int main (void) { free(temp_red_ref); free(temp_black_ref); + if (count != 0) return 1; return 0; } diff --git a/src/laplace-hip/main.cu b/src/laplace-hip/main.cu index 9944ac796f..e6e34c0119 100644 --- a/src/laplace-hip/main.cu +++ b/src/laplace-hip/main.cu @@ -309,5 +309,6 @@ int main (void) { free(temp_red_ref); free(temp_black_ref); + if (count != 0) return 1; return 0; } diff --git a/src/laplace-omp/main.cpp b/src/laplace-omp/main.cpp index b5b37b6676..77cb30ee60 100644 --- a/src/laplace-omp/main.cpp +++ b/src/laplace-omp/main.cpp @@ -308,5 +308,6 @@ int main (void) { free(temp_black_ref); free(bl_norm_L2); + if (count != 0) return 1; return 0; } diff --git a/src/laplace-sycl/main.cpp b/src/laplace-sycl/main.cpp index 682af4f470..1302ccb92d 100644 --- a/src/laplace-sycl/main.cpp +++ b/src/laplace-sycl/main.cpp @@ -309,5 +309,6 @@ int main(void) { free(temp_red_ref); free(temp_black_ref); + if (count != 0) return 1; return 0; } diff --git a/src/laplace3d-cuda/main.cu b/src/laplace3d-cuda/main.cu index 0284616be0..f20389e793 100644 --- a/src/laplace3d-cuda/main.cu +++ b/src/laplace3d-cuda/main.cu @@ -133,6 +133,7 @@ int main(int argc, char **argv){ free(h_u2); free(h_u3); + if (!ok) return 1; return 0; } diff --git a/src/laplace3d-hip/main.cu b/src/laplace3d-hip/main.cu index 0c2e04f033..f5cc8c4709 100644 --- a/src/laplace3d-hip/main.cu +++ b/src/laplace3d-hip/main.cu @@ -133,6 +133,7 @@ int main(int argc, char **argv){ free(h_u2); free(h_u3); + if (!ok) return 1; return 0; } diff --git a/src/laplace3d-omp/main.cpp b/src/laplace3d-omp/main.cpp index 388f250721..68309cdaaf 100644 --- a/src/laplace3d-omp/main.cpp +++ b/src/laplace3d-omp/main.cpp @@ -115,6 +115,7 @@ int main(int argc, char **argv){ free(h_u2); free(h_u3); + if (!ok) return 1; return 0; } diff --git a/src/laplace3d-sycl/main.cpp b/src/laplace3d-sycl/main.cpp index 51cc83e2c8..c04bec32ca 100644 --- a/src/laplace3d-sycl/main.cpp +++ b/src/laplace3d-sycl/main.cpp @@ -151,6 +151,7 @@ int main(int argc, char **argv){ free(h_u2); free(h_u3); + if (!ok) return 1; return 0; } diff --git a/src/layout-cuda/main.cu b/src/layout-cuda/main.cu index 2ee1a77eb1..f669560ab6 100644 --- a/src/layout-cuda/main.cu +++ b/src/layout-cuda/main.cu @@ -193,5 +193,7 @@ int main(int argc, char * argv[]) free(deviceResult); free(reference); free(data); + if (fail) return 1; + if (fail) return 1; return 0; } diff --git a/src/layout-hip/main.cu b/src/layout-hip/main.cu index 7904143d3d..f4ce9f62cb 100644 --- a/src/layout-hip/main.cu +++ b/src/layout-hip/main.cu @@ -193,5 +193,7 @@ int main(int argc, char * argv[]) free(deviceResult); free(reference); free(data); + if (fail) return 1; + if (fail) return 1; return 0; } diff --git a/src/layout-omp/main.cpp b/src/layout-omp/main.cpp index b0d64f2900..ff806396e5 100644 --- a/src/layout-omp/main.cpp +++ b/src/layout-omp/main.cpp @@ -178,6 +178,8 @@ int main(int argc, char * argv[]) free(output); free(reference); free(data); + if (fail) return 1; + if (fail) return 1; return 0; } diff --git a/src/layout-sycl/main.cpp b/src/layout-sycl/main.cpp index cfec85df91..0ca0cf7dee 100644 --- a/src/layout-sycl/main.cpp +++ b/src/layout-sycl/main.cpp @@ -205,5 +205,7 @@ int main(int argc, char * argv[]) free(deviceResult); free(reference); free(data); + if (fail) return 1; + if (fail) return 1; return 0; } diff --git a/src/lebesgue-cuda/main.cpp b/src/lebesgue-cuda/main.cpp index 7b1e93e7c9..e4ad76a053 100644 --- a/src/lebesgue-cuda/main.cpp +++ b/src/lebesgue-cuda/main.cpp @@ -525,5 +525,14 @@ int main (int argc, char* argv[] ) timestamp ( ); } + if (!ok) return 1; + if (!ok) return 1; + if (!ok) return 1; + if (!ok) return 1; + if (!ok) return 1; + if (!ok) return 1; + if (!ok) return 1; + if (!ok) return 1; + if (!ok) return 1; return 0; } diff --git a/src/lebesgue-sycl/main.cpp b/src/lebesgue-sycl/main.cpp index 7172f318c0..c636e73b33 100644 --- a/src/lebesgue-sycl/main.cpp +++ b/src/lebesgue-sycl/main.cpp @@ -531,5 +531,14 @@ int main (int argc, char* argv[] ) timestamp ( ); } + if (!ok) return 1; + if (!ok) return 1; + if (!ok) return 1; + if (!ok) return 1; + if (!ok) return 1; + if (!ok) return 1; + if (!ok) return 1; + if (!ok) return 1; + if (!ok) return 1; return 0; } diff --git a/src/leukocyte-cuda/Makefile b/src/leukocyte-cuda/Makefile index 66fbab82a3..a19a6502c9 100644 --- a/src/leukocyte-cuda/Makefile +++ b/src/leukocyte-cuda/Makefile @@ -29,7 +29,7 @@ ifeq ($(OPTIMIZE),yes) CFLAGS += -O3 endif -leukocyte: detect_main.o \ +main: detect_main.o \ avilib.o \ track_ellipse.o \ track_ellipse_gpu.o \ @@ -37,7 +37,7 @@ leukocyte: detect_main.o \ misc_math.o \ helper.o \ $(MATRIX_DIR)/meschach.a - $(CC) -o leukocyte avilib.o \ + $(CC) -o main avilib.o \ track_ellipse.o \ track_ellipse_gpu.o \ find_ellipse.o \ @@ -64,9 +64,9 @@ track_ellipse_gpu.o: track_ellipse_gpu.c track_ellipse.h kernel_IMGVF.h $(MATRIX_DIR)/meschach.a: cd $(MATRIX_DIR); make cleanup; make all CC=$(CC); make clean -run: leukocyte - $(LAUNCHER) ./leukocyte ../data/leukocyte/testfile.avi 100 +run: main + $(LAUNCHER) ./main ../data/leukocyte/testfile.avi 100 clean: - rm -f *.o *~ leukocyte + rm -f *.o *~ main cd $(MATRIX_DIR); make cleanup diff --git a/src/leukocyte-hip/Makefile b/src/leukocyte-hip/Makefile index 9811ccb015..fa8bd27d50 100644 --- a/src/leukocyte-hip/Makefile +++ b/src/leukocyte-hip/Makefile @@ -28,7 +28,7 @@ ifeq ($(OPTIMIZE),yes) CFLAGS += -O3 endif -leukocyte: detect_main.o \ +main: detect_main.o \ avilib.o \ track_ellipse.o \ track_ellipse_gpu.o \ @@ -36,7 +36,7 @@ leukocyte: detect_main.o \ misc_math.o \ helper.o \ $(MATRIX_DIR)/meschach.a - $(CC) -o leukocyte avilib.o \ + $(CC) -o main avilib.o \ track_ellipse.o \ track_ellipse_gpu.o \ find_ellipse.o \ @@ -63,9 +63,9 @@ track_ellipse_gpu.o: track_ellipse_gpu.c track_ellipse.h kernel_IMGVF.h $(MATRIX_DIR)/meschach.a: cd $(MATRIX_DIR); make cleanup; make all CC=$(CC); make clean -run: leukocyte - $(LAUNCHER) ./leukocyte ../data/leukocyte/testfile.avi 100 +run: main + $(LAUNCHER) ./main ../data/leukocyte/testfile.avi 100 clean: - rm -f *.o *~ leukocyte + rm -f *.o *~ main cd $(MATRIX_DIR); make cleanup diff --git a/src/leukocyte-hip/Makefile.hipcl b/src/leukocyte-hip/Makefile.hipcl index 79653640de..b36fe8595f 100644 --- a/src/leukocyte-hip/Makefile.hipcl +++ b/src/leukocyte-hip/Makefile.hipcl @@ -27,7 +27,7 @@ ifeq ($(OPTIMIZE),yes) CFLAGS += -O3 endif -leukocyte: detect_main.o \ +main: detect_main.o \ avilib.o \ track_ellipse.o \ track_ellipse_gpu.o \ @@ -35,7 +35,7 @@ leukocyte: detect_main.o \ misc_math.o \ helper.o \ $(MATRIX_DIR)/meschach.a - $(CC) -o leukocyte avilib.o \ + $(CC) -o main avilib.o \ track_ellipse.o \ track_ellipse_gpu.o \ find_ellipse.o \ @@ -62,9 +62,9 @@ track_ellipse_gpu.o: track_ellipse_gpu.c track_ellipse.h kernel_IMGVF.h $(MATRIX_DIR)/meschach.a: cd $(MATRIX_DIR); make cleanup; make all CC=$(CC); make clean -run: leukocyte - ./leukocyte ../data/leukocyte/testfile.avi 100 +run: main + ./main ../data/leukocyte/testfile.avi 100 clean: - rm -f *.o *~ leukocyte + rm -f *.o *~ main cd $(MATRIX_DIR); make cleanup diff --git a/src/leukocyte-omp/Makefile b/src/leukocyte-omp/Makefile index c01880d3b5..6c9b372149 100644 --- a/src/leukocyte-omp/Makefile +++ b/src/leukocyte-omp/Makefile @@ -35,7 +35,7 @@ else CFLAGS +=-qopenmp endif -leukocyte: detect_main.o \ +main: detect_main.o \ avilib.o \ track_ellipse.o \ track_ellipse_gpu.o \ @@ -43,7 +43,7 @@ leukocyte: detect_main.o \ misc_math.o \ helper.o \ $(MATRIX_DIR)/meschach.a - $(CC) $(CFLAGS) -o leukocyte avilib.o \ + $(CC) $(CFLAGS) -o main avilib.o \ track_ellipse.o \ track_ellipse_gpu.o \ find_ellipse.o \ @@ -70,9 +70,9 @@ track_ellipse_gpu.o: track_ellipse_gpu.c track_ellipse.h kernel_IMGVF.h $(MATRIX_DIR)/meschach.a: cd $(MATRIX_DIR); make cleanup; make all CC=$(CC); make clean -run: leukocyte - $(LAUNCHER) ./leukocyte ../data/leukocyte/testfile.avi 100 +run: main + $(LAUNCHER) ./main ../data/leukocyte/testfile.avi 100 clean: - rm -f *.o *~ leukocyte + rm -f *.o *~ main cd $(MATRIX_DIR); make cleanup diff --git a/src/leukocyte-omp/Makefile.aomp b/src/leukocyte-omp/Makefile.aomp index 7035f02526..2219e611e6 100644 --- a/src/leukocyte-omp/Makefile.aomp +++ b/src/leukocyte-omp/Makefile.aomp @@ -38,7 +38,7 @@ else CFLAGS +=-fopenmp endif -leukocyte: detect_main.o \ +main: detect_main.o \ avilib.o \ track_ellipse.o \ track_ellipse_gpu.o \ @@ -46,7 +46,7 @@ leukocyte: detect_main.o \ misc_math.o \ helper.o \ $(MATRIX_DIR)/meschach.a - $(CC) $(CFLAGS) -o leukocyte avilib.o \ + $(CC) $(CFLAGS) -o main avilib.o \ track_ellipse.o \ track_ellipse_gpu.o \ find_ellipse.o \ @@ -73,9 +73,9 @@ track_ellipse_gpu.o: track_ellipse_gpu.c track_ellipse.h kernel_IMGVF.h $(MATRIX_DIR)/meschach.a: cd $(MATRIX_DIR); make cleanup; make all CC=$(CC); make clean -run: leukocyte - $(LAUNCHER) ./leukocyte ../data/leukocyte/testfile.avi 100 +run: main + $(LAUNCHER) ./main ../data/leukocyte/testfile.avi 100 clean: - rm -f *.o *~ leukocyte + rm -f *.o *~ main cd $(MATRIX_DIR); make cleanup diff --git a/src/leukocyte-omp/Makefile.nvc b/src/leukocyte-omp/Makefile.nvc index 1c6dac37c1..81f49803fd 100644 --- a/src/leukocyte-omp/Makefile.nvc +++ b/src/leukocyte-omp/Makefile.nvc @@ -35,7 +35,7 @@ else CFLAGS +=-qopenmp endif -leukocyte: detect_main.o \ +main: detect_main.o \ avilib.o \ track_ellipse.o \ track_ellipse_gpu.o \ @@ -43,7 +43,7 @@ leukocyte: detect_main.o \ misc_math.o \ helper.o \ $(MATRIX_DIR)/meschach.a - $(CC) $(CFLAGS) -o leukocyte avilib.o \ + $(CC) $(CFLAGS) -o main avilib.o \ track_ellipse.o \ track_ellipse_gpu.o \ find_ellipse.o \ @@ -70,9 +70,9 @@ track_ellipse_gpu.o: track_ellipse_gpu.c track_ellipse.h kernel_IMGVF.h $(MATRIX_DIR)/meschach.a: cd $(MATRIX_DIR); make cleanup; make all CC=$(CC); make clean -run: leukocyte - $(LAUNCHER) ./leukocyte ../data/leukocyte/testfile.avi 100 +run: main + $(LAUNCHER) ./main ../data/leukocyte/testfile.avi 100 clean: - rm -f *.o *~ leukocyte + rm -f *.o *~ main cd $(MATRIX_DIR); make cleanup diff --git a/src/leukocyte-sycl/Makefile b/src/leukocyte-sycl/Makefile index 1bf89ea997..d8f183527f 100644 --- a/src/leukocyte-sycl/Makefile +++ b/src/leukocyte-sycl/Makefile @@ -67,7 +67,7 @@ endif # Targets to Build #=============================================================================== -leukocyte: detect_main.o \ +main: detect_main.o \ avilib.o \ track_ellipse.o \ track_ellipse_sycl.o \ @@ -75,7 +75,7 @@ leukocyte: detect_main.o \ misc_math.o \ helper.o \ $(MATRIX_DIR)/meschach.a - $(CC) $(CFLAGS) -o leukocyte avilib.o \ + $(CC) $(CFLAGS) -o main avilib.o \ track_ellipse.o \ track_ellipse_sycl.o \ find_ellipse.o \ @@ -104,8 +104,8 @@ $(MATRIX_DIR)/meschach.a: cd $(MATRIX_DIR); make cleanup; make all CC=$(CC) CFLAGS=-O3; make clean clean: - rm -f *.o leukocyte + rm -f *.o main cd $(MATRIX_DIR); make cleanup -run: leukocyte - $(LAUNCHER) ./leukocyte ../data/leukocyte/testfile.avi 100 +run: main + $(LAUNCHER) ./main ../data/leukocyte/testfile.avi 100 diff --git a/src/lfib4-cuda/main.cu b/src/lfib4-cuda/main.cu index 60bbb5e0d4..4bf1bbc431 100644 --- a/src/lfib4-cuda/main.cu +++ b/src/lfib4-cuda/main.cu @@ -1,6 +1,7 @@ #include #include #include +#include #define P1 55 #define P2 119 @@ -264,5 +265,6 @@ int main(int argc, char**argv) { } free(x); + if (!ok) return 1; return 0; } diff --git a/src/lfib4-hip/main.cu b/src/lfib4-hip/main.cu index 21e13bbd8b..bb81e77517 100644 --- a/src/lfib4-hip/main.cu +++ b/src/lfib4-hip/main.cu @@ -1,6 +1,7 @@ #include #include #include +#include #define P1 55 #define P2 119 @@ -264,5 +265,6 @@ int main(int argc, char**argv) { } free(x); + if (!ok) return 1; return 0; } diff --git a/src/lfib4-sycl/main.cpp b/src/lfib4-sycl/main.cpp index 7832ef0c08..fb33988960 100644 --- a/src/lfib4-sycl/main.cpp +++ b/src/lfib4-sycl/main.cpp @@ -300,5 +300,6 @@ int main(int argc, char **argv) { } free(x); + if (!ok) return 1; return 0; } diff --git a/src/libor-cuda/main.cu b/src/libor-cuda/main.cu index 2980061952..9ccb4298f5 100644 --- a/src/libor-cuda/main.cu +++ b/src/libor-cuda/main.cu @@ -444,6 +444,7 @@ int main(int argc, char **argv) { free(h_Lb); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/libor-hip/main.cu b/src/libor-hip/main.cu index a5130c0d5c..6903d92fb6 100644 --- a/src/libor-hip/main.cu +++ b/src/libor-hip/main.cu @@ -442,6 +442,7 @@ int main(int argc, char **argv) { free(h_Lb); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/libor-sycl/main.cpp b/src/libor-sycl/main.cpp index ed8103444a..92fb2401ef 100644 --- a/src/libor-sycl/main.cpp +++ b/src/libor-sycl/main.cpp @@ -400,6 +400,7 @@ int main(int argc, char **argv) free(h_Lb); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/lif-cuda/main.cu b/src/lif-cuda/main.cu index 369d4f77be..a046048b35 100644 --- a/src/lif-cuda/main.cu +++ b/src/lif-cuda/main.cu @@ -203,5 +203,6 @@ int main(int argc, char* argv[]) { cudaFree(d_gain); cudaFree(d_spikes); + if (!ok) return 1; return 0; } diff --git a/src/lif-hip/main.cu b/src/lif-hip/main.cu index 0767314360..95017948ff 100644 --- a/src/lif-hip/main.cu +++ b/src/lif-hip/main.cu @@ -203,5 +203,6 @@ int main(int argc, char* argv[]) { hipFree(d_gain); hipFree(d_spikes); + if (!ok) return 1; return 0; } diff --git a/src/lif-omp/main.cpp b/src/lif-omp/main.cpp index b3e0986fce..1a4d37b5c5 100644 --- a/src/lif-omp/main.cpp +++ b/src/lif-omp/main.cpp @@ -179,5 +179,6 @@ int main(int argc, char* argv[]) { free(spikes); free(spikes_host); + if (!ok) return 1; return 0; } diff --git a/src/lif-sycl/main.cpp b/src/lif-sycl/main.cpp index dd2278cc5e..90b3ec1379 100644 --- a/src/lif-sycl/main.cpp +++ b/src/lif-sycl/main.cpp @@ -214,5 +214,6 @@ int main(int argc, char* argv[]) { free(spikes); free(spikes_host); + if (!ok) return 1; return 0; } diff --git a/src/linearprobing-cuda/main.cu b/src/linearprobing-cuda/main.cu index bbd27e4c8f..9995c2d02a 100644 --- a/src/linearprobing-cuda/main.cu +++ b/src/linearprobing-cuda/main.cu @@ -7,6 +7,7 @@ #include #include #include "linearprobing.h" +#include // Create random keys/values in the range [0, kEmpty) // kEmpty is used to indicate an empty slot @@ -173,6 +174,7 @@ int main(int argc, char* argv[]) bool ok = test_correctness(insert_kvs, delete_kvs, kvs); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/linearprobing-hip/main.cu b/src/linearprobing-hip/main.cu index 8a3861913a..ae14e5dd1e 100644 --- a/src/linearprobing-hip/main.cu +++ b/src/linearprobing-hip/main.cu @@ -7,6 +7,7 @@ #include #include #include "linearprobing.h" +#include // Create random keys/values in the range [0, kEmpty) // kEmpty is used to indicate an empty slot @@ -173,6 +174,7 @@ int main(int argc, char* argv[]) bool ok = test_correctness(insert_kvs, delete_kvs, kvs); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); printf("Success\n"); diff --git a/src/linearprobing-omp/main.cpp b/src/linearprobing-omp/main.cpp index ae83c94f7c..1b5808f893 100644 --- a/src/linearprobing-omp/main.cpp +++ b/src/linearprobing-omp/main.cpp @@ -8,6 +8,7 @@ #include #include #include "linearprobing.h" +#include // Create random keys/values in the range [0, kEmpty) // kEmpty is used to indicate an empty slot @@ -181,5 +182,6 @@ int main(int argc, char* argv[]) free(iter_kvs); + if (!ok) return 1; return 0; } diff --git a/src/linearprobing-sycl/main.cpp b/src/linearprobing-sycl/main.cpp index ef95f30ca9..71eb4fbc49 100644 --- a/src/linearprobing-sycl/main.cpp +++ b/src/linearprobing-sycl/main.cpp @@ -7,6 +7,7 @@ #include #include #include "linearprobing.h" +#include // Create random keys/values in the range [0, kEmpty) // kEmpty is used to indicate an empty slot @@ -179,6 +180,7 @@ int main(int argc, char* argv[]) bool ok = test_correctness(insert_kvs, delete_kvs, kvs); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/logan-cuda/Makefile b/src/logan-cuda/Makefile index 6d34add234..5c85383787 100644 --- a/src/logan-cuda/Makefile +++ b/src/logan-cuda/Makefile @@ -24,7 +24,7 @@ obj = $(source:.cu=.o) #=============================================================================== # Standard Flags -CFLAGS := $(EXTRA_CFLAGS) -std=c++17 \ +CFLAGS := $(EXTRA_CFLAGS) -std=c++14 \ -Xcompiler -Wall -Xcompiler -fopenmp \ -arch=$(ARCH) -Isrc diff --git a/src/logprob-cuda/main.cu b/src/logprob-cuda/main.cu index 9f6f302490..e8481fe959 100644 --- a/src/logprob-cuda/main.cu +++ b/src/logprob-cuda/main.cu @@ -295,5 +295,6 @@ int main(int argc, char* argv[]) free(h_ids); free(h_lengths); + if (error) return 1; return 0; } diff --git a/src/logprob-hip/main.cu b/src/logprob-hip/main.cu index 69f0327cd2..008788729b 100644 --- a/src/logprob-hip/main.cu +++ b/src/logprob-hip/main.cu @@ -295,5 +295,6 @@ int main(int argc, char* argv[]) free(h_ids); free(h_lengths); + if (error) return 1; return 0; } diff --git a/src/logprob-sycl/main.cpp b/src/logprob-sycl/main.cpp index a5be732130..b45d7e68f7 100644 --- a/src/logprob-sycl/main.cpp +++ b/src/logprob-sycl/main.cpp @@ -337,5 +337,6 @@ int main(int argc, char* argv[]) free(h_ids); free(h_lengths); + if (error) return 1; return 0; } diff --git a/src/lombscargle-cuda/main.cu b/src/lombscargle-cuda/main.cu index 0d83fa82ac..69cbe3961b 100644 --- a/src/lombscargle-cuda/main.cu +++ b/src/lombscargle-cuda/main.cu @@ -211,5 +211,6 @@ int main(int argc, char* argv[]) { free(f); free(p); free(p2); + if (error) return 1; return 0; } diff --git a/src/lombscargle-hip/main.cu b/src/lombscargle-hip/main.cu index ae258a48dd..07484ef23a 100644 --- a/src/lombscargle-hip/main.cu +++ b/src/lombscargle-hip/main.cu @@ -211,5 +211,6 @@ int main(int argc, char* argv[]) { free(f); free(p); free(p2); + if (error) return 1; return 0; } diff --git a/src/lombscargle-omp/main.cpp b/src/lombscargle-omp/main.cpp index 2b4081d6b5..04c9dd89ac 100644 --- a/src/lombscargle-omp/main.cpp +++ b/src/lombscargle-omp/main.cpp @@ -179,5 +179,6 @@ int main(int argc, char* argv[]) { free(f); free(p); free(p2); + if (error) return 1; return 0; } diff --git a/src/lombscargle-sycl/main.cpp b/src/lombscargle-sycl/main.cpp index d4aeb6aa25..e30d63f81a 100644 --- a/src/lombscargle-sycl/main.cpp +++ b/src/lombscargle-sycl/main.cpp @@ -206,5 +206,6 @@ int main(int argc, char* argv[]) { free(f); free(p); free(p2); + if (error) return 1; return 0; } diff --git a/src/lsqt-cuda/Makefile b/src/lsqt-cuda/Makefile index 0bd1718b64..5a894ed48c 100644 --- a/src/lsqt-cuda/Makefile +++ b/src/lsqt-cuda/Makefile @@ -17,7 +17,7 @@ HEADERS = sigma.h vector.h lsqt.h hamiltonian.h model.h anderson.h charge.h comm ODIR = obj_gpu OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ)) -all: builddir lsqt_gpu +all: builddir main builddir: mkdir -p $(ODIR) @@ -25,11 +25,11 @@ builddir: $(ODIR)/%.o: %.cu $(HEADERS) $(CC) $(CFLAGS) -c $< -o $@ -lsqt_gpu: $(OBJ) +main: $(OBJ) $(CC) $^ -o $@ clean: - rm -f $(ODIR)/*.o lsqt_gpu + rm -f $(ODIR)/*.o main -run: lsqt_gpu - ./lsqt_gpu examples/input.txt +run: main + $(LAUNCHER) ./main examples/input.txt diff --git a/src/lsqt-hip/Makefile b/src/lsqt-hip/Makefile index a13d47dca5..a639d34647 100644 --- a/src/lsqt-hip/Makefile +++ b/src/lsqt-hip/Makefile @@ -16,7 +16,7 @@ HEADERS = sigma.h vector.h lsqt.h hamiltonian.h model.h anderson.h charge.h comm ODIR = obj_gpu OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ)) -all: builddir lsqt_gpu +all: builddir main builddir: mkdir -p $(ODIR) @@ -24,12 +24,12 @@ builddir: $(ODIR)/%.o: %.cu $(HEADERS) $(CC) $(CFLAGS) -c $< -o $@ -lsqt_gpu: $(OBJ) +main: $(OBJ) $(CC) $^ -o $@ clean: - rm -f $(ODIR)/*.o lsqt_gpu *.out + rm -f $(ODIR)/*.o main *.out -run: lsqt_gpu - ./lsqt_gpu ../lsqt-cuda/examples/input.txt +run: main + $(LAUNCHER) ./main ../lsqt-cuda/examples/input.txt diff --git a/src/lsqt-omp/Makefile b/src/lsqt-omp/Makefile index 0a81702332..0921bf1a1e 100644 --- a/src/lsqt-omp/Makefile +++ b/src/lsqt-omp/Makefile @@ -29,16 +29,16 @@ HEADERS = sigma.h vector.h lsqt.h hamiltonian.h model.h anderson.h charge.h comm ODIR = obj_gpu OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ)) -all: lsqt_gpu +all: main $(ODIR)/%.o: %.cpp $(HEADERS) $(CC) $(CFLAGS) -c $< -o $@ -lsqt_gpu: $(OBJ) +main: $(OBJ) $(CC) $(CFLAGS) $^ -o $@ clean: - rm -f $(ODIR)/*.o lsqt_gpu *.out + rm -f $(ODIR)/*.o main *.out -run: lsqt_gpu - ./lsqt_gpu ../lsqt-cuda/examples/input.txt +run: main + $(LAUNCHER) ./main ../lsqt-cuda/examples/input.txt diff --git a/src/lud-hip/Makefile.hipcl b/src/lud-hip/Makefile.hipcl index cb1a2be209..1b6624a07d 100644 --- a/src/lud-hip/Makefile.hipcl +++ b/src/lud-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = lud +program = main source = lud.cu ./common/common.cu diff --git a/src/lulesh-cuda/Makefile b/src/lulesh-cuda/Makefile index e27928a3e9..0a5f3964c9 100644 --- a/src/lulesh-cuda/Makefile +++ b/src/lulesh-cuda/Makefile @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = lulesh +program = main source = lulesh.cu \ lulesh-viz.cu \ diff --git a/src/lulesh-hip/Makefile b/src/lulesh-hip/Makefile index e57c63b04d..404a834772 100644 --- a/src/lulesh-hip/Makefile +++ b/src/lulesh-hip/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = lulesh +program = main source = lulesh.cu \ lulesh-viz.cu \ diff --git a/src/lulesh-hip/Makefile.hipcl b/src/lulesh-hip/Makefile.hipcl index 7c60134416..df5458d3f2 100644 --- a/src/lulesh-hip/Makefile.hipcl +++ b/src/lulesh-hip/Makefile.hipcl @@ -12,7 +12,7 @@ VERIFY = no # Program name & source code list #=============================================================================== -program = lulesh +program = main source = lulesh.cu \ lulesh-viz.cu \ diff --git a/src/lulesh-omp/Makefile b/src/lulesh-omp/Makefile index 3c42ab258c..2fd15ebb51 100644 --- a/src/lulesh-omp/Makefile +++ b/src/lulesh-omp/Makefile @@ -15,7 +15,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = lulesh +program = main source = lulesh.cc \ lulesh-viz.cc \ diff --git a/src/lulesh-omp/Makefile.aomp b/src/lulesh-omp/Makefile.aomp index 1db739601b..a2721db6ea 100644 --- a/src/lulesh-omp/Makefile.aomp +++ b/src/lulesh-omp/Makefile.aomp @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = lulesh +program = main source = lulesh.cc \ lulesh-viz.cc \ diff --git a/src/lulesh-omp/Makefile.nvc b/src/lulesh-omp/Makefile.nvc index 2475749751..094b03db11 100644 --- a/src/lulesh-omp/Makefile.nvc +++ b/src/lulesh-omp/Makefile.nvc @@ -16,7 +16,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = lulesh +program = main source = lulesh.cc \ lulesh-viz.cc \ diff --git a/src/lulesh-sycl/Makefile b/src/lulesh-sycl/Makefile index 20f4d189d3..d67718c4b5 100644 --- a/src/lulesh-sycl/Makefile +++ b/src/lulesh-sycl/Makefile @@ -20,7 +20,7 @@ HIP_ARCH = gfx908 # Program name & source code list #=============================================================================== -program = lulesh +program = main source = lulesh.cc \ lulesh-viz.cc \ diff --git a/src/mandelbrot-hip/Makefile.hipcl b/src/mandelbrot-hip/Makefile.hipcl index 9a5200730d..13c75ceee7 100644 --- a/src/mandelbrot-hip/Makefile.hipcl +++ b/src/mandelbrot-hip/Makefile.hipcl @@ -10,7 +10,7 @@ DEBUG = no #=============================================================================== # Program name & source code list #=============================================================================== -program = mandelbrot +program = main source = main.cu diff --git a/src/marchingCubes-cuda/main.cu b/src/marchingCubes-cuda/main.cu index 07ada3d195..7aeff14651 100644 --- a/src/marchingCubes-cuda/main.cu +++ b/src/marchingCubes-cuda/main.cu @@ -7,6 +7,7 @@ #include #include #include "tables.h" +#include // problem size constexpr unsigned int N(1024); @@ -570,5 +571,6 @@ int main(int argc, char* argv[]) cudaFree(coordYDevice); cudaFree(coordZDevice); cudaFree(coordZPDevice); + if (!ok) return 1; return 0; } diff --git a/src/marchingCubes-hip/main.cu b/src/marchingCubes-hip/main.cu index f9ff501dc8..dcf083e4c7 100644 --- a/src/marchingCubes-hip/main.cu +++ b/src/marchingCubes-hip/main.cu @@ -7,6 +7,7 @@ #include #include #include "tables.h" +#include // problem size constexpr unsigned int N(1024); @@ -570,5 +571,6 @@ int main(int argc, char* argv[]) hipFree(coordYDevice); hipFree(coordZDevice); hipFree(coordZPDevice); + if (!ok) return 1; return 0; } diff --git a/src/marchingCubes-sycl/main.cpp b/src/marchingCubes-sycl/main.cpp index 79163f318a..b40dd78b46 100644 --- a/src/marchingCubes-sycl/main.cpp +++ b/src/marchingCubes-sycl/main.cpp @@ -9,6 +9,7 @@ using uchar4 = sycl::uchar4; #include "tables.h" +#include // problem size constexpr unsigned int N(1024); @@ -620,5 +621,6 @@ int main(int argc, char* argv[]) sycl::free(coordYDevice, q); sycl::free(coordZDevice, q); sycl::free(coordZPDevice, q); + if (!ok) return 1; return 0; } diff --git a/src/mask-cuda/main.cu b/src/mask-cuda/main.cu index c44bcf0e9e..a9469ebbd5 100644 --- a/src/mask-cuda/main.cu +++ b/src/mask-cuda/main.cu @@ -347,5 +347,6 @@ int main(int argc, char* argv[]) eval_mask(M, N, B, repeat); + if ((error) return 1; return 0; } diff --git a/src/mask-hip/main.cu b/src/mask-hip/main.cu index a9784769cc..07aad4ce9b 100644 --- a/src/mask-hip/main.cu +++ b/src/mask-hip/main.cu @@ -347,5 +347,6 @@ int main(int argc, char* argv[]) eval_mask(M, N, B, repeat); + if ((error) return 1; return 0; } diff --git a/src/mask-omp/main.cpp b/src/mask-omp/main.cpp index 68cc391023..5f302b5c12 100644 --- a/src/mask-omp/main.cpp +++ b/src/mask-omp/main.cpp @@ -348,5 +348,6 @@ int main(int argc, char* argv[]) eval_mask(M, N, B, repeat); + if ((error) return 1; return 0; } diff --git a/src/mask-sycl/main.cpp b/src/mask-sycl/main.cpp index c274831567..ef9a75562d 100644 --- a/src/mask-sycl/main.cpp +++ b/src/mask-sycl/main.cpp @@ -383,5 +383,6 @@ int main(int argc, char* argv[]) eval_mask(M, N, B, repeat); + if ((error) return 1; return 0; } diff --git a/src/matern-cuda/main.cu b/src/matern-cuda/main.cu index 01eb05fab4..5ff1569e44 100644 --- a/src/matern-cuda/main.cu +++ b/src/matern-cuda/main.cu @@ -184,5 +184,6 @@ int main(int argc, char* argv[]) free(targets); free(result); free(result_ref); + if (!ok) return 1; return 0; } diff --git a/src/matern-hip/main.cu b/src/matern-hip/main.cu index 92c36c5610..e3a22fc2e2 100644 --- a/src/matern-hip/main.cu +++ b/src/matern-hip/main.cu @@ -185,5 +185,6 @@ int main(int argc, char* argv[]) free(targets); free(result); free(result_ref); + if (!ok) return 1; return 0; } diff --git a/src/matern-omp/main.cpp b/src/matern-omp/main.cpp index 2f1a28475a..c1ea417c4e 100644 --- a/src/matern-omp/main.cpp +++ b/src/matern-omp/main.cpp @@ -206,5 +206,6 @@ int main(int argc, char* argv[]) free(targets); free(result); free(result_ref); + if (!ok) return 1; return 0; } diff --git a/src/matern-sycl/main.cpp b/src/matern-sycl/main.cpp index 04a6834d03..cce3f8308b 100644 --- a/src/matern-sycl/main.cpp +++ b/src/matern-sycl/main.cpp @@ -228,5 +228,6 @@ int main(int argc, char* argv[]) free(targets); free(result); free(result_ref); + if (!ok) return 1; return 0; } diff --git a/src/matrix-rotate-cuda/main.cu b/src/matrix-rotate-cuda/main.cu index 8edcba8acc..52cc3492d8 100644 --- a/src/matrix-rotate-cuda/main.cu +++ b/src/matrix-rotate-cuda/main.cu @@ -103,5 +103,6 @@ int main(int argc, char** argv) { free(serial_res); free(parallel_res); cudaFree(d_parallel_res); + if (!ok) return 1; return 0; } diff --git a/src/matrix-rotate-hip/main.cu b/src/matrix-rotate-hip/main.cu index c9f0e44bef..fdeddf8d04 100644 --- a/src/matrix-rotate-hip/main.cu +++ b/src/matrix-rotate-hip/main.cu @@ -103,5 +103,6 @@ int main(int argc, char** argv) { free(serial_res); free(parallel_res); hipFree(d_parallel_res); + if (!ok) return 1; return 0; } diff --git a/src/matrix-rotate-omp/main.cpp b/src/matrix-rotate-omp/main.cpp index a67ddc5afe..5749f92a4e 100644 --- a/src/matrix-rotate-omp/main.cpp +++ b/src/matrix-rotate-omp/main.cpp @@ -96,5 +96,6 @@ int main(int argc, char** argv) { free(serial_res); free(parallel_res); + if (!ok) return 1; return 0; } diff --git a/src/matrix-rotate-sycl/main.cpp b/src/matrix-rotate-sycl/main.cpp index 1eb9262338..613570e983 100644 --- a/src/matrix-rotate-sycl/main.cpp +++ b/src/matrix-rotate-sycl/main.cpp @@ -109,5 +109,6 @@ int main(int argc, char** argv) { free(serial_res); free(matrix); sycl::free(d_matrix, q); + if (!ok) return 1; return 0; } diff --git a/src/matrixT-cuda/main.cu b/src/matrixT-cuda/main.cu index dec9a48511..986931cec9 100644 --- a/src/matrixT-cuda/main.cu +++ b/src/matrixT-cuda/main.cu @@ -511,5 +511,6 @@ int main(int argc, char **argv) cudaFree(d_idata); cudaFree(d_odata); + if (!success) return 1; return 0; } diff --git a/src/matrixT-hip/main.cu b/src/matrixT-hip/main.cu index 19afb06a8a..c647bdda57 100644 --- a/src/matrixT-hip/main.cu +++ b/src/matrixT-hip/main.cu @@ -511,5 +511,6 @@ int main(int argc, char **argv) hipFree(d_idata); hipFree(d_odata); + if (!success) return 1; return 0; } diff --git a/src/matrixT-sycl/main.cpp b/src/matrixT-sycl/main.cpp index 5f39515ae2..09c1ab3e9a 100644 --- a/src/matrixT-sycl/main.cpp +++ b/src/matrixT-sycl/main.cpp @@ -665,5 +665,6 @@ int main(int argc, char **argv) sycl::free(d_idata, q); sycl::free(d_odata, q); + if (!success) return 1; return 0; } diff --git a/src/maxpool3d-cuda/main.cu b/src/maxpool3d-cuda/main.cu index ed4638491e..ea76f8608b 100644 --- a/src/maxpool3d-cuda/main.cu +++ b/src/maxpool3d-cuda/main.cu @@ -135,6 +135,7 @@ int main(int argc, char** argv) int status = memcmp(h_output, d_output, sizeof(DTYPE)*i_img_count*o_img_width*o_img_height); printf("%s\n", (status == 0) ? "PASS" : "FAIL"); + if (!(status == 0)) exit(1); free(h_image); free(h_output); diff --git a/src/maxpool3d-hip/main.cu b/src/maxpool3d-hip/main.cu index d74faca48a..17467c723f 100644 --- a/src/maxpool3d-hip/main.cu +++ b/src/maxpool3d-hip/main.cu @@ -135,6 +135,7 @@ int main(int argc, char** argv) int status = memcmp(h_output, d_output, sizeof(DTYPE)*i_img_count*o_img_width*o_img_height); printf("%s\n", (status == 0) ? "PASS" : "FAIL"); + if (!(status == 0)) exit(1); free(h_image); free(h_output); diff --git a/src/maxpool3d-omp/main.cpp b/src/maxpool3d-omp/main.cpp index 3fd2da3719..ff062a9085 100644 --- a/src/maxpool3d-omp/main.cpp +++ b/src/maxpool3d-omp/main.cpp @@ -106,6 +106,7 @@ int main(int argc, char** argv) int status = memcmp(h_output, d_output, sizeof(DTYPE)*i_img_count*o_img_height*o_img_width); printf("%s\n", (status == 0) ? "PASS" : "FAIL"); + if (!(status == 0)) exit(1); free(h_image); free(h_output); diff --git a/src/maxpool3d-sycl/main.cpp b/src/maxpool3d-sycl/main.cpp index 90f601e4d3..a2bfe3941f 100644 --- a/src/maxpool3d-sycl/main.cpp +++ b/src/maxpool3d-sycl/main.cpp @@ -147,6 +147,7 @@ int main(int argc, char** argv) int status = memcmp(h_output, d_output, sizeof(DTYPE)*i_img_count*o_img_width*o_img_height); printf("%s\n", (status == 0) ? "PASS" : "FAIL"); + if (!(status == 0)) exit(1); free(h_image); free(h_output); diff --git a/src/mcpr-cuda/reference.h b/src/mcpr-cuda/reference.h index 0a1e45f585..18af8a8ffc 100644 --- a/src/mcpr-cuda/reference.h +++ b/src/mcpr-cuda/reference.h @@ -7,6 +7,7 @@ void verify(const double *probs, const double *probs_ref, int alphas_size) { } } printf("%s\n", error ? "FAIL" : "PASS"); + if (error) exit(1); } void reference( diff --git a/src/md5hash-cuda/MD5Hash.cu b/src/md5hash-cuda/MD5Hash.cu index febae10b42..994838bc59 100644 --- a/src/md5hash-cuda/MD5Hash.cu +++ b/src/md5hash-cuda/MD5Hash.cu @@ -5,6 +5,7 @@ #include #include #include +#include using namespace std; @@ -613,6 +614,7 @@ int main(int argc, char** argv) cout << endl; } cout << ((rate == FLT_MAX) ? "FAIL" : "PASS") << endl; + if (rate == FLT_MAX) exit(1); } } diff --git a/src/md5hash-cuda/Makefile b/src/md5hash-cuda/Makefile index 61ef674e1e..18534306d8 100644 --- a/src/md5hash-cuda/Makefile +++ b/src/md5hash-cuda/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = MD5Hash +program = main source = MD5Hash.cu diff --git a/src/md5hash-hip/MD5Hash.cu b/src/md5hash-hip/MD5Hash.cu index 29db1d8d52..83deb2c755 100644 --- a/src/md5hash-hip/MD5Hash.cu +++ b/src/md5hash-hip/MD5Hash.cu @@ -5,6 +5,7 @@ #include #include #include +#include using namespace std; @@ -613,6 +614,7 @@ int main(int argc, char** argv) cout << endl; } cout << ((rate == FLT_MAX) ? "FAIL" : "PASS") << endl; + if (rate == FLT_MAX) exit(1); } } diff --git a/src/md5hash-hip/Makefile b/src/md5hash-hip/Makefile index c34df97d05..06e862aea5 100644 --- a/src/md5hash-hip/Makefile +++ b/src/md5hash-hip/Makefile @@ -12,7 +12,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = MD5Hash +program = main source = MD5Hash.cu diff --git a/src/md5hash-hip/Makefile.hipcl b/src/md5hash-hip/Makefile.hipcl index 52d0f36106..5bbdf7cb46 100644 --- a/src/md5hash-hip/Makefile.hipcl +++ b/src/md5hash-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = MD5Hash +program = main source = MD5Hash.cu diff --git a/src/md5hash-omp/MD5Hash.cpp b/src/md5hash-omp/MD5Hash.cpp index e93ca14811..a66a688ef5 100644 --- a/src/md5hash-omp/MD5Hash.cpp +++ b/src/md5hash-omp/MD5Hash.cpp @@ -575,6 +575,7 @@ int main(int argc, char** argv) std::cout << std::endl; } std::cout << ((rate == FLT_MAX) ? "FAIL" : "PASS") << std::endl; + if (rate == FLT_MAX) exit(1); } } diff --git a/src/md5hash-omp/Makefile b/src/md5hash-omp/Makefile index d0a663cb9a..8e66b37c10 100644 --- a/src/md5hash-omp/Makefile +++ b/src/md5hash-omp/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = MD5Hash +program = main source = MD5Hash.cpp diff --git a/src/md5hash-omp/Makefile.aomp b/src/md5hash-omp/Makefile.aomp index 6f61439fee..e7d14e4528 100644 --- a/src/md5hash-omp/Makefile.aomp +++ b/src/md5hash-omp/Makefile.aomp @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = MD5Hash +program = main source = MD5Hash.cpp diff --git a/src/md5hash-omp/Makefile.nvc b/src/md5hash-omp/Makefile.nvc index bf5ff3dbb3..bfd2090cfb 100644 --- a/src/md5hash-omp/Makefile.nvc +++ b/src/md5hash-omp/Makefile.nvc @@ -15,7 +15,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = MD5Hash +program = main source = MD5Hash.cpp diff --git a/src/md5hash-sycl/MD5Hash.cpp b/src/md5hash-sycl/MD5Hash.cpp index 4a781f390a..3e35432e9f 100644 --- a/src/md5hash-sycl/MD5Hash.cpp +++ b/src/md5hash-sycl/MD5Hash.cpp @@ -593,6 +593,7 @@ int main(int argc, char** argv) std::cout << std::endl; } std::cout << ((rate == FLT_MAX) ? "FAIL" : "PASS") << std::endl; + if (rate == FLT_MAX) exit(1); } } diff --git a/src/md5hash-sycl/Makefile b/src/md5hash-sycl/Makefile index 0fb21f268a..1598ca1103 100644 --- a/src/md5hash-sycl/Makefile +++ b/src/md5hash-sycl/Makefile @@ -19,7 +19,7 @@ HIP_ARCH = gfx908 # Program name & source code list #=============================================================================== -program = MD5Hash +program = main source = MD5Hash.cpp diff --git a/src/mdh-cuda/main.cu b/src/mdh-cuda/main.cu index 504530b9b8..6258843881 100644 --- a/src/mdh-cuda/main.cu +++ b/src/mdh-cuda/main.cu @@ -475,5 +475,6 @@ int main(int argc, const char **argv) { wkf_timer_destroy(timer); + if (!ok) return 1; return 0; } diff --git a/src/mdh-hip/main.cu b/src/mdh-hip/main.cu index 551e66521f..c47ff5d8ab 100644 --- a/src/mdh-hip/main.cu +++ b/src/mdh-hip/main.cu @@ -494,5 +494,6 @@ int main(int argc, const char **argv) { wkf_timer_destroy(timer); + if (!ok) return 1; return 0; } diff --git a/src/mdh-omp/main.cpp b/src/mdh-omp/main.cpp index 25d2001045..46fc1c6df2 100644 --- a/src/mdh-omp/main.cpp +++ b/src/mdh-omp/main.cpp @@ -255,5 +255,6 @@ int main(int argc, const char **argv) { wkf_timer_destroy(timer); + if (!ok) return 1; return 0; } diff --git a/src/mdh-sycl/main.cpp b/src/mdh-sycl/main.cpp index 31470697bb..f530f5d648 100644 --- a/src/mdh-sycl/main.cpp +++ b/src/mdh-sycl/main.cpp @@ -397,5 +397,6 @@ int main(int argc, const char **argv) { wkf_timer_destroy(timer); + if (!ok) return 1; return 0; } diff --git a/src/meanshift-cuda/main.cu b/src/meanshift-cuda/main.cu index a863e8cf45..2288456651 100644 --- a/src/meanshift-cuda/main.cu +++ b/src/meanshift-cuda/main.cu @@ -4,6 +4,7 @@ #include #include "utils.h" #include "constants.h" +#include namespace mean_shift::gpu { __global__ void mean_shift(const float *data, float *data_next) { @@ -169,5 +170,7 @@ int main(int argc, char* argv[]) { cudaFree(d_data); cudaFree(d_data_next); + if (centroids.size() != M && are_close) return 1; + if (centroids.size() != M && are_close) return 1; return 0; } diff --git a/src/meanshift-hip/main.cu b/src/meanshift-hip/main.cu index 9dc46001e6..30ed44dcd7 100644 --- a/src/meanshift-hip/main.cu +++ b/src/meanshift-hip/main.cu @@ -4,6 +4,7 @@ #include #include "utils.h" #include "constants.h" +#include namespace mean_shift::gpu { __global__ void mean_shift(const float *data, float *data_next) { @@ -168,5 +169,7 @@ int main(int argc, char* argv[]) { hipFree(d_data); hipFree(d_data_next); + if (centroids.size() != M && are_close) return 1; + if (centroids.size() != M && are_close) return 1; return 0; } diff --git a/src/meanshift-omp/main.cpp b/src/meanshift-omp/main.cpp index 26417bff78..528bb5259c 100644 --- a/src/meanshift-omp/main.cpp +++ b/src/meanshift-omp/main.cpp @@ -5,6 +5,7 @@ #include #include "utils.h" #include "constants.h" +#include namespace mean_shift::gpu { void mean_shift(const float *data, float *data_next, @@ -172,5 +173,7 @@ int main(int argc, char* argv[]) { } free(d_data_next); + if (centroids.size() != M && are_close) return 1; + if (centroids.size() != M && are_close) return 1; return 0; } diff --git a/src/meanshift-sycl/main.cpp b/src/meanshift-sycl/main.cpp index fe3b1572a1..ddc0c7e6f1 100644 --- a/src/meanshift-sycl/main.cpp +++ b/src/meanshift-sycl/main.cpp @@ -4,6 +4,7 @@ #include #include "utils.h" #include "constants.h" +#include namespace mean_shift::gpu { void mean_shift(sycl::nd_item<1> &item, const float *data, float *data_next) { @@ -188,5 +189,7 @@ int main(int argc, char* argv[]) { sycl::free(d_data, q); sycl::free(d_data_next, q); + if (centroids.size() != M && are_close) return 1; + if (centroids.size() != M && are_close) return 1; return 0; } diff --git a/src/medianfilter-cuda/main.cu b/src/medianfilter-cuda/main.cu index 651007e4c1..b020300693 100644 --- a/src/medianfilter-cuda/main.cu +++ b/src/medianfilter-cuda/main.cu @@ -9,6 +9,7 @@ #include #include "shrUtils.h" #include "MedianFilter.cu" +#include #ifndef min #define min(a,b) (a < b ? a : b) @@ -113,6 +114,7 @@ int main(int argc, char** argv) printf("PASS\n"); else printf("FAIL\n"); + if (bMatch != shrTRUE) exit(1); return EXIT_SUCCESS; } diff --git a/src/medianfilter-hip/main.cu b/src/medianfilter-hip/main.cu index 2507798495..bd1ee323b2 100644 --- a/src/medianfilter-hip/main.cu +++ b/src/medianfilter-hip/main.cu @@ -9,6 +9,7 @@ #include #include "shrUtils.h" #include "MedianFilter.cu" +#include #ifndef min #define min(a,b) (a < b ? a : b) @@ -113,6 +114,7 @@ int main(int argc, char** argv) printf("PASS\n"); else printf("FAIL\n"); + if (bMatch != shrTRUE) exit(1); return EXIT_SUCCESS; } diff --git a/src/medianfilter-omp/main.cpp b/src/medianfilter-omp/main.cpp index eedf9383fb..6018308c5e 100644 --- a/src/medianfilter-omp/main.cpp +++ b/src/medianfilter-omp/main.cpp @@ -12,6 +12,7 @@ #include #include #include "shrUtils.h" +#include typedef struct __attribute__((__aligned__(4))) { @@ -118,6 +119,7 @@ int main(int argc, char** argv) printf("PASS\n"); else printf("FAIL\n"); + if (bMatch != shrTRUE) exit(1); return EXIT_SUCCESS; } diff --git a/src/medianfilter-sycl/main.cpp b/src/medianfilter-sycl/main.cpp index fd8c4a173c..29fb67de55 100644 --- a/src/medianfilter-sycl/main.cpp +++ b/src/medianfilter-sycl/main.cpp @@ -13,6 +13,7 @@ #include #include "shrUtils.h" #include "MedianFilter.cpp" +#include #ifndef min #define min(a,b) (a < b ? a : b) @@ -121,6 +122,7 @@ int main(int argc, char** argv) printf("PASS\n"); else printf("FAIL\n"); + if (bMatch != shrTRUE) exit(1); return EXIT_SUCCESS; } diff --git a/src/merge-cuda/main.cu b/src/merge-cuda/main.cu index a8825eefe0..eb63b90546 100644 --- a/src/merge-cuda/main.cu +++ b/src/merge-cuda/main.cu @@ -110,6 +110,7 @@ void mergeType(const uint64_t size, const uint32_t runs) { PV(errors); // Print error info printf("%s. ", errors ? "FAIL" : "PASS"); + if (errors) exit(1); if (timing) printf("Average kernel execution time: %f (us).\n", (total_time * 1e-3f) / runs); diff --git a/src/merge-hip/main.cu b/src/merge-hip/main.cu index a11967c74e..eea5d4c7ad 100644 --- a/src/merge-hip/main.cu +++ b/src/merge-hip/main.cu @@ -109,6 +109,7 @@ void mergeType(const uint64_t size, const uint32_t runs) { PV(errors); // Print error info printf("%s. ", errors ? "FAIL" : "PASS"); + if (errors) exit(1); if (timing) printf("Average kernel execution time: %f (us).\n", (total_time * 1e-3f) / runs); diff --git a/src/merge-omp/main.cpp b/src/merge-omp/main.cpp index 1879aeb47e..1d113718f1 100644 --- a/src/merge-omp/main.cpp +++ b/src/merge-omp/main.cpp @@ -103,6 +103,7 @@ void mergeType(const uint64_t size, const uint32_t runs) { PV(errors); // Print error info printf("%s. ", errors ? "FAIL" : "PASS"); + if (errors) exit(1); if (timing) printf("Average kernel execution time: %f (us).\n", (total_time * 1e-3f) / runs); diff --git a/src/merge-sycl/main.cpp b/src/merge-sycl/main.cpp index f244a8b1ec..9c509357fb 100644 --- a/src/merge-sycl/main.cpp +++ b/src/merge-sycl/main.cpp @@ -144,6 +144,7 @@ void mergeType(sycl::queue &q, const uint64_t size, const uint32_t runs) { PV(errors); // Print error info printf("%s. ", errors ? "FAIL" : "PASS"); + if (errors) exit(1); if (timing) printf("Average kernel execution time: %f (us).\n", (total_time * 1e-3f) / runs); diff --git a/src/miniDGS-cuda/Makefile b/src/miniDGS-cuda/Makefile index 3d97a98938..c5c1db0b21 100644 --- a/src/miniDGS-cuda/Makefile +++ b/src/miniDGS-cuda/Makefile @@ -51,16 +51,16 @@ OBJS = \ src/MaxwellsKernel3d.o\ src/MaxwellsDriver3d.o -MaxwellsGPU3d:$(OBJS) - $(LD) $(LDFLAGS) -o MaxwellsGPU3d $(OBJS) $(LIBS) +main:$(OBJS) + $(LD) $(LDFLAGS) -o main $(OBJS) $(LIBS) # what to do if user types "make clean" clean : - rm -rf $(OBJS) MaxwellsGPU3d + rm -rf $(OBJS) main veryclean : make clean cd 3rdParty/ParMetis-3.1 && make clean run : - mpiexec -n $(NP) ./MaxwellsGPU3d Meshes/FS_K01022.neu + mpiexec -n $(NP) ./main Meshes/FS_K01022.neu diff --git a/src/miniDGS-cuda/README b/src/miniDGS-cuda/README index ae8094ab85..c698629fb9 100644 --- a/src/miniDGS-cuda/README +++ b/src/miniDGS-cuda/README @@ -18,7 +18,7 @@ make # When the number of processes is one, cuda-memcheck reports CUDA API errors # # Run the various configurations (in parallel using MPI) with sample meshes: -mpirun -np 2 ./MaxwellsGPU3d Meshes/FS_K01022.neu +mpirun -np 2 ./main Meshes/FS_K01022.neu # Only one GPU device is used in the driver (src/MaxwellsDriver3d.c). # diff --git a/src/miniFE-cuda/src/make_targets b/src/miniFE-cuda/src/make_targets index 6acaa484f3..f60fc742fe 100644 --- a/src/miniFE-cuda/src/make_targets +++ b/src/miniFE-cuda/src/make_targets @@ -17,10 +17,10 @@ MINIFE_KERNELS = 0 vpath %.cpp ../utils -all:common_files generate_info miniFE.x +all:common_files generate_info main -miniFE.x:common_files generate_info $(MAIN_OBJ) $(OBJS) $(UTIL_OBJS) $(OPTIONAL_OBJS) *.hpp - $(INSTRUMENT) $(CXX) $(MAIN_OBJ) $(OBJS) $(UTIL_OBJS) $(OPTIONAL_OBJS) -o miniFE.x $(LDFLAGS) $(OPTIONAL_LIBS) $(LIBS) +main:common_files generate_info $(MAIN_OBJ) $(OBJS) $(UTIL_OBJS) $(OPTIONAL_OBJS) *.hpp + $(INSTRUMENT) $(CXX) $(MAIN_OBJ) $(OBJS) $(UTIL_OBJS) $(OPTIONAL_OBJS) -o main $(LDFLAGS) $(OPTIONAL_LIBS) $(LIBS) common_files: ./get_common_files @@ -37,11 +37,11 @@ verify:all %.o:%.c *.h $(CC) $(CFLAGS) -c $< -run: miniFE.x - ./miniFE.x -nx 128 -ny 128 -nz 128 +run: main + $(LAUNCHER) ./main -nx 128 -ny 128 -nz 128 clean: - rm -f *.o *.a *.x *.linkinfo miniFE_info.hpp + rm -f *.o *.a main *.linkinfo miniFE_info.hpp realclean: clean rm -f gmon.out gprof.* *~ *.yaml *.TVD.* *.mtx* *.vec* minife_debug* diff --git a/src/miniFE-hip/src/make_targets b/src/miniFE-hip/src/make_targets index 6acaa484f3..f60fc742fe 100644 --- a/src/miniFE-hip/src/make_targets +++ b/src/miniFE-hip/src/make_targets @@ -17,10 +17,10 @@ MINIFE_KERNELS = 0 vpath %.cpp ../utils -all:common_files generate_info miniFE.x +all:common_files generate_info main -miniFE.x:common_files generate_info $(MAIN_OBJ) $(OBJS) $(UTIL_OBJS) $(OPTIONAL_OBJS) *.hpp - $(INSTRUMENT) $(CXX) $(MAIN_OBJ) $(OBJS) $(UTIL_OBJS) $(OPTIONAL_OBJS) -o miniFE.x $(LDFLAGS) $(OPTIONAL_LIBS) $(LIBS) +main:common_files generate_info $(MAIN_OBJ) $(OBJS) $(UTIL_OBJS) $(OPTIONAL_OBJS) *.hpp + $(INSTRUMENT) $(CXX) $(MAIN_OBJ) $(OBJS) $(UTIL_OBJS) $(OPTIONAL_OBJS) -o main $(LDFLAGS) $(OPTIONAL_LIBS) $(LIBS) common_files: ./get_common_files @@ -37,11 +37,11 @@ verify:all %.o:%.c *.h $(CC) $(CFLAGS) -c $< -run: miniFE.x - ./miniFE.x -nx 128 -ny 128 -nz 128 +run: main + $(LAUNCHER) ./main -nx 128 -ny 128 -nz 128 clean: - rm -f *.o *.a *.x *.linkinfo miniFE_info.hpp + rm -f *.o *.a main *.linkinfo miniFE_info.hpp realclean: clean rm -f gmon.out gprof.* *~ *.yaml *.TVD.* *.mtx* *.vec* minife_debug* diff --git a/src/miniFE-omp/src/make_targets b/src/miniFE-omp/src/make_targets index a13208a3b1..4eaa6cf999 100644 --- a/src/miniFE-omp/src/make_targets +++ b/src/miniFE-omp/src/make_targets @@ -17,10 +17,10 @@ MINIFE_KERNELS = 0 vpath %.cpp ../utils -all:common_files generate_info miniFE.x +all:common_files generate_info main -miniFE.x:common_files generate_info $(MAIN_OBJ) $(OBJS) $(UTIL_OBJS) $(OPTIONAL_OBJS) *.hpp - $(INSTRUMENT) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(MAIN_OBJ) $(OBJS) $(UTIL_OBJS) $(OPTIONAL_OBJS) -o miniFE.x $(LDFLAGS) $(OPTIONAL_LIBS) $(LIBS) +main:common_files generate_info $(MAIN_OBJ) $(OBJS) $(UTIL_OBJS) $(OPTIONAL_OBJS) *.hpp + $(INSTRUMENT) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(MAIN_OBJ) $(OBJS) $(UTIL_OBJS) $(OPTIONAL_OBJS) -o main $(LDFLAGS) $(OPTIONAL_LIBS) $(LIBS) common_files: ./get_common_files @@ -37,11 +37,11 @@ verify:all %.o:%.c *.h $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -run: miniFE.x - ./miniFE.x -nx 128 -ny 128 -nz 128 +run: main + $(LAUNCHER) ./main -nx 128 -ny 128 -nz 128 clean: - rm -f *.o *.a *.x *.linkinfo miniFE_info.hpp + rm -f *.o *.a main *.linkinfo miniFE_info.hpp realclean: clean rm -f gmon.out gprof.* *~ *.yaml *.TVD.* *.mtx* *.vec* minife_debug* diff --git a/src/miniFE-sycl/src/make_targets b/src/miniFE-sycl/src/make_targets index a13208a3b1..4eaa6cf999 100644 --- a/src/miniFE-sycl/src/make_targets +++ b/src/miniFE-sycl/src/make_targets @@ -17,10 +17,10 @@ MINIFE_KERNELS = 0 vpath %.cpp ../utils -all:common_files generate_info miniFE.x +all:common_files generate_info main -miniFE.x:common_files generate_info $(MAIN_OBJ) $(OBJS) $(UTIL_OBJS) $(OPTIONAL_OBJS) *.hpp - $(INSTRUMENT) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(MAIN_OBJ) $(OBJS) $(UTIL_OBJS) $(OPTIONAL_OBJS) -o miniFE.x $(LDFLAGS) $(OPTIONAL_LIBS) $(LIBS) +main:common_files generate_info $(MAIN_OBJ) $(OBJS) $(UTIL_OBJS) $(OPTIONAL_OBJS) *.hpp + $(INSTRUMENT) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(MAIN_OBJ) $(OBJS) $(UTIL_OBJS) $(OPTIONAL_OBJS) -o main $(LDFLAGS) $(OPTIONAL_LIBS) $(LIBS) common_files: ./get_common_files @@ -37,11 +37,11 @@ verify:all %.o:%.c *.h $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -run: miniFE.x - ./miniFE.x -nx 128 -ny 128 -nz 128 +run: main + $(LAUNCHER) ./main -nx 128 -ny 128 -nz 128 clean: - rm -f *.o *.a *.x *.linkinfo miniFE_info.hpp + rm -f *.o *.a main *.linkinfo miniFE_info.hpp realclean: clean rm -f gmon.out gprof.* *~ *.yaml *.TVD.* *.mtx* *.vec* minife_debug* diff --git a/src/miniWeather-cuda/main.cu b/src/miniWeather-cuda/main.cu index 08ea671a03..2f77aa6e30 100644 --- a/src/miniWeather-cuda/main.cu +++ b/src/miniWeather-cuda/main.cu @@ -791,5 +791,6 @@ int main(int argc, char **argv) { cudaFree(d_recvbuf_l); cudaFree(d_recvbuf_r); + if (!ok) return 1; return 0; } diff --git a/src/miniWeather-hip/main.cu b/src/miniWeather-hip/main.cu index c465fac609..1f8421d34d 100644 --- a/src/miniWeather-hip/main.cu +++ b/src/miniWeather-hip/main.cu @@ -791,5 +791,6 @@ int main(int argc, char **argv) { hipFree(d_recvbuf_l); hipFree(d_recvbuf_r); + if (!ok) return 1; return 0; } diff --git a/src/miniWeather-omp/main.cpp b/src/miniWeather-omp/main.cpp index 100d4a4a23..ba6f1fbee8 100644 --- a/src/miniWeather-omp/main.cpp +++ b/src/miniWeather-omp/main.cpp @@ -177,6 +177,7 @@ int main(int argc, char **argv) { printf("d_te: %le\n" , d_te); bool ok = check_output(d_mass, d_te); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); finalize(); } diff --git a/src/miniWeather-sycl/main.cpp b/src/miniWeather-sycl/main.cpp index 5e241b74db..60e8b065c9 100644 --- a/src/miniWeather-sycl/main.cpp +++ b/src/miniWeather-sycl/main.cpp @@ -1024,5 +1024,6 @@ int main(int argc, char **argv) { sycl::free(d_recvbuf_l, q); sycl::free(d_recvbuf_r, q); + if (!ok) return 1; return 0; } diff --git a/src/minimap2-cuda/Makefile b/src/minimap2-cuda/Makefile index b4b98cd96c..c798a66f26 100644 --- a/src/minimap2-cuda/Makefile +++ b/src/minimap2-cuda/Makefile @@ -10,7 +10,7 @@ BUILD_CUDA_PATH = build/cuda BIN_PATH = $(BUILD_PATH)/bin # executable # -BIN_NAME = kernel-2d +BIN_NAME = main # extensions # SRC_EXT = cpp diff --git a/src/minimap2-hip/Makefile b/src/minimap2-hip/Makefile index 93c7d689c8..60710f9f4a 100644 --- a/src/minimap2-hip/Makefile +++ b/src/minimap2-hip/Makefile @@ -9,7 +9,7 @@ BUILD_HIP_PATH = build/hip BIN_PATH = $(BUILD_PATH)/bin # executable # -BIN_NAME = kernel +BIN_NAME = main # extensions # SRC_EXT = cpp @@ -29,7 +29,7 @@ DEPS = $(OBJECTS:.o=.d) # flags # COMPILE_FLAGS = -std=c++17 -Wall -Wextra -g -HIPCC_COMPILE_FLAGS = -std=c++17 -g -O3 +HIPCC_COMPILE_FLAGS = -std=c++17 -g -O3 INCLUDES = -I include/ -I /usr/local/include # Space-separated pkg-config libraries used by this project LIBS = diff --git a/src/minimap2-hip/Makefile.hipcl b/src/minimap2-hip/Makefile.hipcl index d37773af4e..c310b7ae55 100644 --- a/src/minimap2-hip/Makefile.hipcl +++ b/src/minimap2-hip/Makefile.hipcl @@ -9,7 +9,7 @@ BUILD_DEVICE_PATH = build/cuda BIN_PATH = $(BUILD_PATH)/bin # executable # -BIN_NAME = kernel +BIN_NAME = main # extensions # SRC_EXT = cpp diff --git a/src/minisweep-cuda/main.cu b/src/minisweep-cuda/main.cu index 5d562ecd32..b881b560d1 100644 --- a/src/minisweep-cuda/main.cu +++ b/src/minisweep-cuda/main.cu @@ -423,5 +423,6 @@ int main( int argc, char** argv ) free(faceyz); free(vslocal); + if (normsqdiff != (P)0) return 1; return 0; } /*---main---*/ diff --git a/src/minisweep-hip/main.cu b/src/minisweep-hip/main.cu index 2ed8f3565f..677bac6f13 100644 --- a/src/minisweep-hip/main.cu +++ b/src/minisweep-hip/main.cu @@ -423,5 +423,6 @@ int main( int argc, char** argv ) free(faceyz); free(vslocal); + if (normsqdiff != (P)0) return 1; return 0; } /*---main---*/ diff --git a/src/minisweep-omp/main.cpp b/src/minisweep-omp/main.cpp index 8a2281972e..e877a2d6c1 100644 --- a/src/minisweep-omp/main.cpp +++ b/src/minisweep-omp/main.cpp @@ -481,5 +481,6 @@ int main( int argc, char** argv ) free(faceyz); free(vslocal); + if (normsqdiff != (P)0) return 1; return 0; } /*---main---*/ diff --git a/src/minisweep-sycl/main.cpp b/src/minisweep-sycl/main.cpp index dc8d41dd47..a728ff2cea 100644 --- a/src/minisweep-sycl/main.cpp +++ b/src/minisweep-sycl/main.cpp @@ -433,6 +433,7 @@ int main( int argc, char** argv ) free(faceyz); free(vslocal); + if (normsqdiff != (P)0) return 1; return 0; } /*---main---*/ diff --git a/src/minkowski-cuda/verify.cpp b/src/minkowski-cuda/verify.cpp index ba90a80dc7..cdef530a81 100644 --- a/src/minkowski-cuda/verify.cpp +++ b/src/minkowski-cuda/verify.cpp @@ -55,6 +55,7 @@ void VerifyResult(float (*a_host)[N], float (*b_host)[K], cout << "PASS\n"; } else { cout << "FAIL\n"; + exit(1); } } #endif diff --git a/src/minmax-cuda/main.cu b/src/minmax-cuda/main.cu index d80ef629af..b54bf80fa6 100644 --- a/src/minmax-cuda/main.cu +++ b/src/minmax-cuda/main.cu @@ -22,6 +22,7 @@ #include #include "vec_2d.hpp" #include "utils.hpp" +#include template struct compare @@ -88,6 +89,7 @@ void eval (const T bounding_box_size, const int repeat) { bool ok = (min_point[0] == r_min_point) && (max_point[0] == r_max_point); ok &= (min_point[1] == r_min_point) && (max_point[1] == r_max_point); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } int main(int argc, char* argv[]) diff --git a/src/minmax-sycl/main.cpp b/src/minmax-sycl/main.cpp index 34d98fce28..7a168d0e10 100644 --- a/src/minmax-sycl/main.cpp +++ b/src/minmax-sycl/main.cpp @@ -22,6 +22,7 @@ #include #include "vec_2d.hpp" #include "utils.hpp" +#include template struct compare @@ -97,6 +98,7 @@ template void eval(const T bounding_box_size, const int repeat) { bool ok = (min_point[0] == r_min_point) && (max_point[0] == r_max_point); ok &= (min_point[1] == r_min_point) && (max_point[1] == r_max_point); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } int main(int argc, char* argv[]) diff --git a/src/mixbench-cuda/main.cu b/src/mixbench-cuda/main.cu index ac831af62b..211eaf08b4 100644 --- a/src/mixbench-cuda/main.cu +++ b/src/mixbench-cuda/main.cu @@ -111,5 +111,6 @@ int main(int argc, char* argv[]) { mixbenchGPU(VECTOR_SIZE, compute_iterations, repeat); + if (!ok) return 1; return 0; } diff --git a/src/mixbench-hip/main.cu b/src/mixbench-hip/main.cu index 994624d480..24334202e6 100644 --- a/src/mixbench-hip/main.cu +++ b/src/mixbench-hip/main.cu @@ -111,5 +111,6 @@ int main(int argc, char* argv[]) { mixbenchGPU(VECTOR_SIZE, compute_iterations, repeat); + if (!ok) return 1; return 0; } diff --git a/src/mixbench-omp/main.cpp b/src/mixbench-omp/main.cpp index 1dbff51f2e..05829e40ea 100644 --- a/src/mixbench-omp/main.cpp +++ b/src/mixbench-omp/main.cpp @@ -109,5 +109,6 @@ int main(int argc, char* argv[]) { mixbenchGPU(VECTOR_SIZE, compute_iterations, repeat); + if (!ok) return 1; return 0; } diff --git a/src/mixbench-sycl/main.cpp b/src/mixbench-sycl/main.cpp index 3946a39bf9..3b20355567 100644 --- a/src/mixbench-sycl/main.cpp +++ b/src/mixbench-sycl/main.cpp @@ -106,6 +106,7 @@ void mixbenchGPU(long size, int compute_iterations, int repeat) { free(cd); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } diff --git a/src/moe-align-cuda/main.cu b/src/moe-align-cuda/main.cu index ba8388ad89..7e4938287d 100644 --- a/src/moe-align-cuda/main.cu +++ b/src/moe-align-cuda/main.cu @@ -662,5 +662,6 @@ int main(int argc, char* argv[]) } } } + if (!ok) return 1; return 0; } diff --git a/src/moe-align-hip/main.cu b/src/moe-align-hip/main.cu index 4a9f8890a2..c1a974f96a 100644 --- a/src/moe-align-hip/main.cu +++ b/src/moe-align-hip/main.cu @@ -666,5 +666,6 @@ int main(int argc, char* argv[]) } } } + if (!ok) return 1; return 0; } diff --git a/src/moe-align-sycl/main.cpp b/src/moe-align-sycl/main.cpp index 4fb8b2b45a..0a5de3b6ae 100644 --- a/src/moe-align-sycl/main.cpp +++ b/src/moe-align-sycl/main.cpp @@ -675,5 +675,6 @@ int main(int argc, char* argv[]) } } } + if (!ok) return 1; return 0; } diff --git a/src/moe-cuda/main.cu b/src/moe-cuda/main.cu index fa2a649f0a..c8c5cd4b75 100644 --- a/src/moe-cuda/main.cu +++ b/src/moe-cuda/main.cu @@ -164,5 +164,6 @@ int main(int argc, char* argv[]) const int topk = atoi(argv[3]); const int repeat = atoi(argv[4]); topk_softmax(num_tokens, num_experts, topk, repeat); + if (error) return 1; return 0; } diff --git a/src/moe-hip/main.cu b/src/moe-hip/main.cu index 13e14e94a7..0997e61c4f 100644 --- a/src/moe-hip/main.cu +++ b/src/moe-hip/main.cu @@ -165,5 +165,6 @@ int main(int argc, char* argv[]) const int topk = atoi(argv[3]); const int repeat = atoi(argv[4]); topk_softmax(num_tokens, num_experts, topk, repeat); + if (error) return 1; return 0; } diff --git a/src/moe-sum-cuda/main.cu b/src/moe-sum-cuda/main.cu index c86d0e295d..24538500f3 100644 --- a/src/moe-sum-cuda/main.cu +++ b/src/moe-sum-cuda/main.cu @@ -183,5 +183,6 @@ int main(int argc, char* argv[]) GPU_CHECK(cudaFree(d_output)); free(output); free(output_vec4); + if (rc) return 1; return 0; } diff --git a/src/moe-sum-hip/main.cu b/src/moe-sum-hip/main.cu index 8678b0f8d7..43ea166e9d 100644 --- a/src/moe-sum-hip/main.cu +++ b/src/moe-sum-hip/main.cu @@ -183,5 +183,6 @@ int main(int argc, char* argv[]) GPU_CHECK(hipFree(d_output)); free(output); free(output_vec4); + if (rc) return 1; return 0; } diff --git a/src/moe-sum-sycl/main.cpp b/src/moe-sum-sycl/main.cpp index be78489230..ab393da83f 100644 --- a/src/moe-sum-sycl/main.cpp +++ b/src/moe-sum-sycl/main.cpp @@ -191,5 +191,6 @@ int main(int argc, char* argv[]) sycl::free(d_output, q); free(output); free(output_vec4); + if (rc) return 1; return 0; } diff --git a/src/moe-sycl/main.cpp b/src/moe-sycl/main.cpp index 970942eff3..4310e6148d 100644 --- a/src/moe-sycl/main.cpp +++ b/src/moe-sycl/main.cpp @@ -156,5 +156,6 @@ int main(int argc, char* argv[]) const int topk = atoi(argv[3]); const int repeat = atoi(argv[4]); topk_softmax(num_tokens, num_experts, topk, repeat); + if (error) return 1; return 0; } diff --git a/src/morphology-cuda/main.cu b/src/morphology-cuda/main.cu index f6f0e8829f..9c6ee8fa53 100644 --- a/src/morphology-cuda/main.cu +++ b/src/morphology-cuda/main.cu @@ -1,4 +1,5 @@ #include "morphology.h" +#include void display(unsigned char *img, const int height, const int width) { @@ -59,5 +60,6 @@ int main(int argc, char* argv[]) cudaFree(img_d); cudaFree(tmp_d); free(srcImg); + if (s != WHITE) return 1; return 0; } diff --git a/src/morphology-hip/main.cu b/src/morphology-hip/main.cu index bea947938a..07e6548291 100644 --- a/src/morphology-hip/main.cu +++ b/src/morphology-hip/main.cu @@ -1,4 +1,5 @@ #include "morphology.h" +#include void display(unsigned char *img, const int height, const int width) { @@ -59,5 +60,6 @@ int main(int argc, char* argv[]) hipFree(img_d); hipFree(tmp_d); free(srcImg); + if (s != WHITE) return 1; return 0; } diff --git a/src/morphology-omp/main.cpp b/src/morphology-omp/main.cpp index 8203b6bb99..1e5aded9ae 100644 --- a/src/morphology-omp/main.cpp +++ b/src/morphology-omp/main.cpp @@ -1,4 +1,5 @@ #include "morphology.h" +#include void display(unsigned char *img, const int height, const int width) { @@ -54,5 +55,6 @@ int main(int argc, char* argv[]) free(srcImg); free(tmpImg); + if (s != WHITE) return 1; return 0; } diff --git a/src/morphology-sycl/main.cpp b/src/morphology-sycl/main.cpp index ed031d7d2f..0510c37ff3 100644 --- a/src/morphology-sycl/main.cpp +++ b/src/morphology-sycl/main.cpp @@ -1,4 +1,5 @@ #include "morphology.h" +#include void display(unsigned char *img, const int height, const int width) { @@ -62,5 +63,6 @@ int main(int argc, char* argv[]) sycl::free(img_d, q); sycl::free(tmp_d, q); free(srcImg); + if (s != WHITE) return 1; return 0; } diff --git a/src/mr-cuda/main.cu b/src/mr-cuda/main.cu index 0809b4f2c5..4afd84daeb 100644 --- a/src/mr-cuda/main.cu +++ b/src/mr-cuda/main.cu @@ -130,5 +130,6 @@ int main(int argc, char *argv[]) set_nintegers(); run_benchmark(repeat); + if (!ok) return 1; return 0; } diff --git a/src/mr-hip/main.cu b/src/mr-hip/main.cu index 865007aae3..07b60515cd 100644 --- a/src/mr-hip/main.cu +++ b/src/mr-hip/main.cu @@ -130,5 +130,6 @@ int main(int argc, char *argv[]) set_nintegers(); run_benchmark(repeat); + if (!ok) return 1; return 0; } diff --git a/src/mr-omp/main.cpp b/src/mr-omp/main.cpp index 9d0191ee72..ef459f20b5 100644 --- a/src/mr-omp/main.cpp +++ b/src/mr-omp/main.cpp @@ -133,5 +133,6 @@ int main(int argc, char *argv[]) set_nintegers(); run_benchmark(repeat); + if (!ok) return 1; return 0; } diff --git a/src/mr-sycl/main.cpp b/src/mr-sycl/main.cpp index 97eaba824b..a03d899837 100644 --- a/src/mr-sycl/main.cpp +++ b/src/mr-sycl/main.cpp @@ -144,5 +144,6 @@ int main(int argc, char *argv[]) set_nintegers(); run_benchmark(q, repeat); + if (!ok) return 1; return 0; } diff --git a/src/mrc-cuda/main.cu b/src/mrc-cuda/main.cu index 111c27d62e..d726e4a1bc 100644 --- a/src/mrc-cuda/main.cu +++ b/src/mrc-cuda/main.cu @@ -205,5 +205,6 @@ int main(int argc, char* argv[]) free(h_dX1); free(h_dX2); + if (!ok) return 1; return 0; } diff --git a/src/mrc-hip/main.cu b/src/mrc-hip/main.cu index 5326d7b4dc..c0fb081f0b 100644 --- a/src/mrc-hip/main.cu +++ b/src/mrc-hip/main.cu @@ -205,5 +205,6 @@ int main(int argc, char* argv[]) free(h_dX1); free(h_dX2); + if (!ok) return 1; return 0; } diff --git a/src/mrc-omp/main.cpp b/src/mrc-omp/main.cpp index f264430da8..6d034b10ba 100644 --- a/src/mrc-omp/main.cpp +++ b/src/mrc-omp/main.cpp @@ -115,5 +115,6 @@ int main(int argc, char* argv[]) free(h_dX1); free(h_dX2); + if (!ok) return 1; return 0; } diff --git a/src/mrc-sycl/main.cpp b/src/mrc-sycl/main.cpp index c6af3d27b1..427310bcd1 100644 --- a/src/mrc-sycl/main.cpp +++ b/src/mrc-sycl/main.cpp @@ -228,5 +228,6 @@ int main(int argc, char* argv[]) free(h_dX1); free(h_dX2); + if (!ok) return 1; return 0; } diff --git a/src/mrg32k3a-cuda/main.cu b/src/mrg32k3a-cuda/main.cu index 8b6df637eb..3822af66f5 100644 --- a/src/mrg32k3a-cuda/main.cu +++ b/src/mrg32k3a-cuda/main.cu @@ -33,6 +33,7 @@ #include #include #include +#include // CUDA API error checking #define CUDA_CHECK(err) \ @@ -183,6 +184,7 @@ int main(int argc, char *argv[]) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return EXIT_SUCCESS; } diff --git a/src/mrg32k3a-hip/main.cu b/src/mrg32k3a-hip/main.cu index 5b47264f5f..cd14e5b54f 100644 --- a/src/mrg32k3a-hip/main.cu +++ b/src/mrg32k3a-hip/main.cu @@ -33,6 +33,7 @@ #include #include #include +#include // HIP API error checking #define HIP_CHECK(err) \ @@ -183,6 +184,7 @@ int main(int argc, char *argv[]) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return EXIT_SUCCESS; } diff --git a/src/mrg32k3a-sycl/main.cpp b/src/mrg32k3a-sycl/main.cpp index 7b9af7758b..3de4698bad 100644 --- a/src/mrg32k3a-sycl/main.cpp +++ b/src/mrg32k3a-sycl/main.cpp @@ -33,6 +33,7 @@ #include #include #include "oneapi/mkl.hpp" +#include using namespace oneapi::mkl::rng; @@ -174,6 +175,7 @@ int main(int argc, char *argv[]) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return EXIT_SUCCESS; } diff --git a/src/mt-cuda/MT.cu b/src/mt-cuda/MT.cu index 64bca5df37..01212736ab 100644 --- a/src/mt-cuda/MT.cu +++ b/src/mt-cuda/MT.cu @@ -30,6 +30,7 @@ extern "C" void BoxMullerRef(float *h_Rand, int nPerRng); #endif #include +#include using namespace std::chrono; /////////////////////////////////////////////////////////////////////////////// @@ -216,6 +217,7 @@ int main(int argc, const char **argv) // finish printf("%s\n", (L1norm < 1e-6) ? "PASS" : "FAIL"); + if (!(L1norm < 1e-6)) exit(1); return 0; } diff --git a/src/mt-hip/MT.cu b/src/mt-hip/MT.cu index f513e02915..77fb0b705e 100644 --- a/src/mt-hip/MT.cu +++ b/src/mt-hip/MT.cu @@ -30,6 +30,7 @@ extern "C" void BoxMullerRef(float *h_Rand, int nPerRng); #endif #include +#include using namespace std::chrono; /////////////////////////////////////////////////////////////////////////////// @@ -216,6 +217,7 @@ int main(int argc, const char **argv) // finish printf("%s\n", (L1norm < 1e-6) ? "PASS" : "FAIL"); + if (!(L1norm < 1e-6)) exit(1); return 0; } diff --git a/src/mt-omp/MT.cpp b/src/mt-omp/MT.cpp index c7e1481198..6592db5b06 100644 --- a/src/mt-omp/MT.cpp +++ b/src/mt-omp/MT.cpp @@ -30,6 +30,7 @@ extern "C" void BoxMullerRef(float *h_Rand, int nPerRng); #endif #include +#include using namespace std::chrono; /////////////////////////////////////////////////////////////////////////////// @@ -198,6 +199,7 @@ int main(int argc, const char **argv) // finish printf("%s\n", (L1norm < 1e-6) ? "PASS" : "FAIL"); + if (!(L1norm < 1e-6)) exit(1); return 0; } diff --git a/src/mt-sycl/MT.cpp b/src/mt-sycl/MT.cpp index ea6ca44aa2..694400d2fe 100644 --- a/src/mt-sycl/MT.cpp +++ b/src/mt-sycl/MT.cpp @@ -31,6 +31,7 @@ extern "C" void BoxMullerRef(float *h_Rand, int nPerRng); #endif #include +#include using namespace std::chrono; /////////////////////////////////////////////////////////////////////////////// @@ -219,6 +220,7 @@ int main(int argc, const char **argv) // finish printf("%s\n", (L1norm < 1e-6) ? "PASS" : "FAIL"); + if (!(L1norm < 1e-6)) exit(1); return 0; } diff --git a/src/mtf-sycl/main.cpp b/src/mtf-sycl/main.cpp index 0d82f3ecb9..ce8b05951d 100644 --- a/src/mtf-sycl/main.cpp +++ b/src/mtf-sycl/main.cpp @@ -97,6 +97,7 @@ int main(int argc, char *argv[]) else { printf("FAIL\n"); + exit(1); // output MTF result if (len < 16) { printf("host: "); diff --git a/src/multimaterial-cuda/Makefile b/src/multimaterial-cuda/Makefile index 1c842201dd..c236721faf 100644 --- a/src/multimaterial-cuda/Makefile +++ b/src/multimaterial-cuda/Makefile @@ -33,7 +33,7 @@ endif #=============================================================================== # Program name & source code list #=============================================================================== -program = multimat multimat_FL multimat_F +program = main multimat multimat_F all: $(program) @@ -43,16 +43,16 @@ multimat: $(source) $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) multimat_F: $(source) $(CC) $(CFLAGS) -DFUSED $^ -o $@ $(LDFLAGS) -multimat_FL: $(source) +main: $(source) $(CC) $(CFLAGS) -DFUSED -DLINKED $^ -o $@ $(LDFLAGS) clean: rm -rf $(program) run: $(program) - $(LAUNCHER) ./multimat_FL 2000 2000 + $(LAUNCHER) ./main 2000 2000 $(LAUNCHER) ./multimat_F 2000 2000 $(LAUNCHER) ./multimat 2000 2000 - $(LAUNCHER) ./multimat_FL 2000 2000 0.3 0.05 0.05 + $(LAUNCHER) ./main 2000 2000 0.3 0.05 0.05 $(LAUNCHER) ./multimat_F 2000 2000 0.3 0.05 0.05 $(LAUNCHER) ./multimat 2000 2000 0.3 0.05 0.05 diff --git a/src/multimaterial-hip/Makefile b/src/multimaterial-hip/Makefile index fac6df3526..bfa9f44895 100644 --- a/src/multimaterial-hip/Makefile +++ b/src/multimaterial-hip/Makefile @@ -33,7 +33,7 @@ endif #=============================================================================== # Program name & source code list #=============================================================================== -program = multimat multimat_FL multimat_F +program = main multimat multimat_F all: $(program) @@ -43,16 +43,16 @@ multimat: $(source) $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) multimat_F: $(source) $(CC) $(CFLAGS) -DFUSED $^ -o $@ $(LDFLAGS) -multimat_FL: $(source) +main: $(source) $(CC) $(CFLAGS) -DFUSED -DLINKED $^ -o $@ $(LDFLAGS) -clean: +clean: rm -rf $(program) run: $(program) - $(LAUNCHER) ./multimat_FL 2000 2000 + $(LAUNCHER) ./main 2000 2000 $(LAUNCHER) ./multimat_F 2000 2000 $(LAUNCHER) ./multimat 2000 2000 - $(LAUNCHER) ./multimat_FL 2000 2000 0.3 0.05 0.05 + $(LAUNCHER) ./main 2000 2000 0.3 0.05 0.05 $(LAUNCHER) ./multimat_F 2000 2000 0.3 0.05 0.05 $(LAUNCHER) ./multimat 2000 2000 0.3 0.05 0.05 diff --git a/src/multimaterial-hip/Makefile.hipcl b/src/multimaterial-hip/Makefile.hipcl index cb456a0bc5..9dc7cf9a49 100644 --- a/src/multimaterial-hip/Makefile.hipcl +++ b/src/multimaterial-hip/Makefile.hipcl @@ -32,7 +32,7 @@ endif #=============================================================================== # Program name & source code list #=============================================================================== -program = multimat multimat_FL multimat_F +program = main multimat multimat_F all: $(program) @@ -42,17 +42,17 @@ multimat: $(source) $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) multimat_F: $(source) $(CC) $(CFLAGS) -DFUSED $^ -o $@ $(LDFLAGS) -multimat_FL: $(source) +main: $(source) $(CC) $(CFLAGS) -DFUSED -DLINKED $^ -o $@ $(LDFLAGS) -clean: +clean: rm -rf $(program) run: $(program) - ./multimat_FL 2000 2000 + ./main 2000 2000 ./multimat_F 2000 2000 ./multimat 2000 2000 - ./multimat_FL 2000 2000 0.3 0.05 0.05 + ./main 2000 2000 0.3 0.05 0.05 ./multimat_F 2000 2000 0.3 0.05 0.05 ./multimat 2000 2000 0.3 0.05 0.05 diff --git a/src/multimaterial-omp/Makefile b/src/multimaterial-omp/Makefile index 79819b53d4..3be6356a3f 100644 --- a/src/multimaterial-omp/Makefile +++ b/src/multimaterial-omp/Makefile @@ -12,7 +12,7 @@ LAUNCHER = #=============================================================================== # Program name & source code list #=============================================================================== -program= multimat multimat_FL multimat_F +program= main multimat multimat_F source=compact.cpp full_matrix.cpp multimat.cpp @@ -54,16 +54,16 @@ multimat: $(source) multimat_F: $(source) $(CC) $(CFLAGS) -DFUSED $^ -o $@ $(LDFLAGS) -multimat_FL: $(source) +main: $(source) $(CC) $(CFLAGS) -DFUSED -DLINKED $^ -o $@ $(LDFLAGS) clean: rm -rf $(program) $(obj) run: $(program) - $(LAUNCHER) ./multimat_FL 2000 2000 + $(LAUNCHER) ./main 2000 2000 $(LAUNCHER) ./multimat_F 2000 2000 $(LAUNCHER) ./multimat 2000 2000 - $(LAUNCHER) ./multimat_FL 2000 2000 0.3 0.05 0.05 + $(LAUNCHER) ./main 2000 2000 0.3 0.05 0.05 $(LAUNCHER) ./multimat_F 2000 2000 0.3 0.05 0.05 $(LAUNCHER) ./multimat 2000 2000 0.3 0.05 0.05 diff --git a/src/multimaterial-omp/Makefile.aomp b/src/multimaterial-omp/Makefile.aomp index 62731ea705..c9a8a4a810 100644 --- a/src/multimaterial-omp/Makefile.aomp +++ b/src/multimaterial-omp/Makefile.aomp @@ -13,7 +13,7 @@ LAUNCHER = #=============================================================================== # Program name & source code list #=============================================================================== -program= multimat multimat_FL multimat_F +program = main multimat multimat_F source=compact.cpp full_matrix.cpp multimat.cpp @@ -58,16 +58,16 @@ multimat: $(source) multimat_F: $(source) $(CC) $(CFLAGS) -DFUSED $^ -o $@ $(LDFLAGS) -multimat_FL: $(source) +main: $(source) $(CC) $(CFLAGS) -DFUSED -DLINKED $^ -o $@ $(LDFLAGS) clean: rm -rf $(program) $(obj) run: $(program) - $(LAUNCHER) ./multimat_FL 2000 2000 + $(LAUNCHER) ./main 2000 2000 $(LAUNCHER) ./multimat_F 2000 2000 $(LAUNCHER) ./multimat 2000 2000 - $(LAUNCHER) ./multimat_FL 2000 2000 0.3 0.05 0.05 + $(LAUNCHER) ./main 2000 2000 0.3 0.05 0.05 $(LAUNCHER) ./multimat_F 2000 2000 0.3 0.05 0.05 $(LAUNCHER) ./multimat 2000 2000 0.3 0.05 0.05 diff --git a/src/multimaterial-omp/Makefile.nvc b/src/multimaterial-omp/Makefile.nvc index dad72c1c0f..3dedaaddc3 100644 --- a/src/multimaterial-omp/Makefile.nvc +++ b/src/multimaterial-omp/Makefile.nvc @@ -13,7 +13,7 @@ LAUNCHER = #=============================================================================== # Program name & source code list #=============================================================================== -program= multimat multimat_FL multimat_F +program = main multimat multimat_F source=compact.cpp full_matrix.cpp multimat.cpp @@ -55,16 +55,16 @@ multimat: $(source) multimat_F: $(source) $(CC) $(CFLAGS) -DFUSED $^ -o $@ $(LDFLAGS) -multimat_FL: $(source) +main: $(source) $(CC) $(CFLAGS) -DFUSED -DLINKED $^ -o $@ $(LDFLAGS) clean: rm -rf $(program) $(obj) run: $(program) - $(LAUNCHER) ./multimat_FL 2000 2000 + $(LAUNCHER) ./main 2000 2000 $(LAUNCHER) ./multimat_F 2000 2000 $(LAUNCHER) ./multimat 2000 2000 - $(LAUNCHER) ./multimat_FL 2000 2000 0.3 0.05 0.05 + $(LAUNCHER) ./main 2000 2000 0.3 0.05 0.05 $(LAUNCHER) ./multimat_F 2000 2000 0.3 0.05 0.05 $(LAUNCHER) ./multimat 2000 2000 0.3 0.05 0.05 diff --git a/src/multimaterial-sycl/Makefile b/src/multimaterial-sycl/Makefile index 63b71578ee..5c7d2b0724 100644 --- a/src/multimaterial-sycl/Makefile +++ b/src/multimaterial-sycl/Makefile @@ -19,7 +19,7 @@ HIP_ARCH = gfx908 # Program name & source code list #=============================================================================== -program = multimat multimat_FL multimat_F +program = main multimat multimat_F source=compact.cpp full_matrix.cpp multimat.cpp @@ -66,22 +66,24 @@ endif # Targets to Build #=============================================================================== +all: $(program) + multimat: $(source) $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) multimat_F: $(source) $(CC) $(CFLAGS) -DFUSED $^ -o $@ $(LDFLAGS) -multimat_FL: $(source) +main: $(source) $(CC) $(CFLAGS) -DFUSED -DLINKED $^ -o $@ $(LDFLAGS) clean: rm -rf $(program) run: $(program) - $(LAUNCHER) ./multimat_FL 2000 2000 + $(LAUNCHER) ./main 2000 2000 $(LAUNCHER) ./multimat_F 2000 2000 $(LAUNCHER) ./multimat 2000 2000 - $(LAUNCHER) ./multimat_FL 2000 2000 0.3 0.05 0.05 + $(LAUNCHER) ./main 2000 2000 0.3 0.05 0.05 $(LAUNCHER) ./multimat_F 2000 2000 0.3 0.05 0.05 $(LAUNCHER) ./multimat 2000 2000 0.3 0.05 0.05 diff --git a/src/multinomial-cuda/main.cu b/src/multinomial-cuda/main.cu index 848367ae2c..fbf88f1714 100644 --- a/src/multinomial-cuda/main.cu +++ b/src/multinomial-cuda/main.cu @@ -229,5 +229,6 @@ int main(int argc, char* argv[]) free(sample); free(distr); + if (error) return 1; return 0; } diff --git a/src/multinomial-hip/main.cu b/src/multinomial-hip/main.cu index 3234203746..9016a7088f 100644 --- a/src/multinomial-hip/main.cu +++ b/src/multinomial-hip/main.cu @@ -229,5 +229,6 @@ int main(int argc, char* argv[]) free(sample); free(distr); + if (error) return 1; return 0; } diff --git a/src/multinomial-sycl/main.cpp b/src/multinomial-sycl/main.cpp index e628fdd306..91ec772101 100644 --- a/src/multinomial-sycl/main.cpp +++ b/src/multinomial-sycl/main.cpp @@ -248,5 +248,6 @@ int main(int argc, char* argv[]) free(sample); free(distr); + if (error) return 1; return 0; } diff --git a/src/murmurhash3-cuda/murmurhash3.cu b/src/murmurhash3-cuda/murmurhash3.cu index d7610214ea..7f2ec979ca 100644 --- a/src/murmurhash3-cuda/murmurhash3.cu +++ b/src/murmurhash3-cuda/murmurhash3.cu @@ -241,5 +241,6 @@ int main(int argc, char** argv) cudaFree(dev_out); cudaFree(dev_length); cudaFree(key_length); + if (error) return 1; return 0; } diff --git a/src/murmurhash3-hip/murmurhash3.cu b/src/murmurhash3-hip/murmurhash3.cu index 86020910b5..cb8655a62d 100644 --- a/src/murmurhash3-hip/murmurhash3.cu +++ b/src/murmurhash3-hip/murmurhash3.cu @@ -241,5 +241,6 @@ int main(int argc, char** argv) hipFree(dev_out); hipFree(dev_length); hipFree(key_length); + if (error) return 1; return 0; } diff --git a/src/murmurhash3-omp/murmurhash3.cpp b/src/murmurhash3-omp/murmurhash3.cpp index 6f7c0d0e4b..951f57c5a1 100644 --- a/src/murmurhash3-omp/murmurhash3.cpp +++ b/src/murmurhash3-omp/murmurhash3.cpp @@ -214,5 +214,6 @@ int main(int argc, char** argv) free(d_keys); free(d_out); free(d_length); + if (error) return 1; return 0; } diff --git a/src/murmurhash3-sycl/murmurhash3.cpp b/src/murmurhash3-sycl/murmurhash3.cpp index 8a79be4a19..20d9658d2d 100644 --- a/src/murmurhash3-sycl/murmurhash3.cpp +++ b/src/murmurhash3-sycl/murmurhash3.cpp @@ -234,5 +234,6 @@ int main(int argc, char** argv) sycl::free(dev_out, q); sycl::free(dev_length, q); sycl::free(key_length, q); + if (error) return 1; return 0; } diff --git a/src/mxfp4-cuda/verify.h b/src/mxfp4-cuda/verify.h index 04360d97e2..48b7ff6d17 100644 --- a/src/mxfp4-cuda/verify.h +++ b/src/mxfp4-cuda/verify.h @@ -85,4 +85,5 @@ void verify(T *src, T *dst, int numel) { if (!ok) break; } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } diff --git a/src/myocyte-omp/Makefile b/src/myocyte-omp/Makefile index 6cb3016a12..94735bb02b 100644 --- a/src/myocyte-omp/Makefile +++ b/src/myocyte-omp/Makefile @@ -30,7 +30,7 @@ endif # EXECUTABLES (LINK OBJECTS TOGETHER INTO BINARY) -./myocyte.out: ./main.o \ +./main: ./main.o \ ./kernel/kernel_wrapper.o \ ./util/file/file.o \ ./util/num/num.o @@ -39,7 +39,7 @@ endif ./util/file/file.o \ ./util/num/num.o \ $(LDFLAGS) \ - -o myocyte.out + -o main # MAIN FUNCTION @@ -81,11 +81,11 @@ endif -o ./util/num/num.o \ -O3 -run: myocyte.out - $(LAUNCHER) ./myocyte.out -time 100 +run: main + $(LAUNCHER) ./main -time 100 clean: - rm -rf *.o *.out \ + rm -rf *.o main \ ./kernel/*.o \ ./util/file/*.o \ ./util/num/*.o \ diff --git a/src/myocyte-omp/Makefile.aomp b/src/myocyte-omp/Makefile.aomp index 522a2e7ceb..6ded78cfe7 100644 --- a/src/myocyte-omp/Makefile.aomp +++ b/src/myocyte-omp/Makefile.aomp @@ -32,7 +32,7 @@ ifeq ($(OPTIMIZE),yes) endif -./myocyte.out: ./main.o \ +./main: ./main.o \ ./kernel/kernel_wrapper.o \ ./util/file/file.o \ ./util/num/num.o @@ -41,7 +41,7 @@ endif ./util/file/file.o \ ./util/num/num.o \ $(LDFLAGS) \ - -o myocyte.out + -o main ./main.o: ./common.h ./main.c @@ -78,11 +78,11 @@ endif -o ./util/num/num.o \ -O3 -run: myocyte.out - $(LAUNCHER) ./myocyte.out -time 100 +run: main + $(LAUNCHER) ./main -time 100 clean: - rm -rf *.o *.out \ + rm -rf *.o main \ ./kernel/*.o \ ./util/file/*.o \ ./util/num/*.o \ diff --git a/src/myocyte-omp/Makefile.nvc b/src/myocyte-omp/Makefile.nvc index 942a6526a8..5a1a5386b2 100644 --- a/src/myocyte-omp/Makefile.nvc +++ b/src/myocyte-omp/Makefile.nvc @@ -30,16 +30,16 @@ ifeq ($(OPTIMIZE),yes) endif -./myocyte.out: ./main.o \ +./main: ./main.o \ ./kernel/kernel_wrapper.o \ ./util/file/file.o \ - ./util/num/num.o \ + ./util/num/num.o $(CC) $(CFLAGS) ./main.o \ ./kernel/kernel_wrapper.o \ ./util/file/file.o \ - ./util/num/num.o + ./util/num/num.o \ $(LDFLAGS) \ - -o myocyte.out + -o main ./main.o: ./common.h ./main.c $(CC) $(CFLAGS) ./main.c \ @@ -75,11 +75,11 @@ endif -o ./util/num/num.o \ -O3 -run: myocyte.out - $(LAUNCHER) ./myocyte.out -time 100 +run: main + $(LAUNCHER) ./main -time 100 clean: - rm -rf *.o *.out \ + rm -rf *.o main \ ./kernel/*.o \ ./util/file/*.o \ ./util/num/*.o \ diff --git a/src/nlll-cuda/main.cu b/src/nlll-cuda/main.cu index 51e8068b4b..cc3ddb5644 100644 --- a/src/nlll-cuda/main.cu +++ b/src/nlll-cuda/main.cu @@ -226,5 +226,6 @@ int main(int argc, char* argv[]) printf("=========== Data type is FP16 ==========\n"); driver(argv); + if (!ok) return 1; return 0; } diff --git a/src/nlll-hip/main.cu b/src/nlll-hip/main.cu index 2ca6a89093..7986e46cd5 100644 --- a/src/nlll-hip/main.cu +++ b/src/nlll-hip/main.cu @@ -226,5 +226,6 @@ int main(int argc, char* argv[]) printf("=========== Data type is FP16 ==========\n"); driver(argv); + if (!ok) return 1; return 0; } diff --git a/src/nlll-omp/main.cpp b/src/nlll-omp/main.cpp index 31bc35bc68..8697820f38 100644 --- a/src/nlll-omp/main.cpp +++ b/src/nlll-omp/main.cpp @@ -194,5 +194,6 @@ int main(int argc, char* argv[]) printf("=========== Data type is FP32 ==========\n"); driver(argv); + if (!ok) return 1; return 0; } diff --git a/src/nlll-sycl/main.cpp b/src/nlll-sycl/main.cpp index 9660782730..f81ca98936 100644 --- a/src/nlll-sycl/main.cpp +++ b/src/nlll-sycl/main.cpp @@ -239,5 +239,6 @@ int main(int argc, char* argv[]) printf("=========== Data type is FP16 ==========\n"); driver(argv); + if (!ok) return 1; return 0; } diff --git a/src/nn-hip/Makefile.hipcl b/src/nn-hip/Makefile.hipcl index b3eb4f1702..f6a922da00 100644 --- a/src/nn-hip/Makefile.hipcl +++ b/src/nn-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = nn +program = main source = nearestNeighbor.cu utils.cu diff --git a/src/nonzero-cuda/main.cu b/src/nonzero-cuda/main.cu index 3666f51e79..dcb50c3b4d 100644 --- a/src/nonzero-cuda/main.cu +++ b/src/nonzero-cuda/main.cu @@ -207,6 +207,7 @@ void nonzero (int nrows, int ncols, int repeat) { idx_time * 1e-3 / repeat); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } int main(int argc, char* argv[]) diff --git a/src/nonzero-hip/main.cu b/src/nonzero-hip/main.cu index 3b724b2f3d..cd5acca467 100644 --- a/src/nonzero-hip/main.cu +++ b/src/nonzero-hip/main.cu @@ -197,6 +197,7 @@ void nonzero (int nrows, int ncols, int repeat) { idx_time * 1e-3 / repeat); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } int main(int argc, char* argv[]) diff --git a/src/nonzero-sycl/main.cpp b/src/nonzero-sycl/main.cpp index e332b3d11c..2e60b4b066 100644 --- a/src/nonzero-sycl/main.cpp +++ b/src/nonzero-sycl/main.cpp @@ -213,6 +213,7 @@ template void nonzero(int nrows, int ncols, int repeat) { idx_time * 1e-3 / repeat); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } int main(int argc, char* argv[]) diff --git a/src/norm2-cuda/main.cu b/src/norm2-cuda/main.cu index 871c616463..9d301fc077 100644 --- a/src/norm2-cuda/main.cu +++ b/src/norm2-cuda/main.cu @@ -113,5 +113,6 @@ int main (int argc, char* argv[]){ } if (ok) printf("PASS\n"); + if (!ok) exit(1); return 0; } diff --git a/src/norm2-hip/main.cu b/src/norm2-hip/main.cu index 7e94b6fa1a..a2914558a4 100644 --- a/src/norm2-hip/main.cu +++ b/src/norm2-hip/main.cu @@ -113,5 +113,6 @@ int main (int argc, char* argv[]){ } if (ok) printf("PASS\n"); + if (!ok) exit(1); return 0; } diff --git a/src/norm2-omp/main.cpp b/src/norm2-omp/main.cpp index ca4da41864..8f6bc61399 100644 --- a/src/norm2-omp/main.cpp +++ b/src/norm2-omp/main.cpp @@ -78,5 +78,6 @@ int main(int argc, char *argv[]) { free(h_result); if (ok) printf("PASS\n"); + if (!ok) exit(1); return 0; } diff --git a/src/norm2-sycl/main.cpp b/src/norm2-sycl/main.cpp index e049aa7996..83b654dd19 100644 --- a/src/norm2-sycl/main.cpp +++ b/src/norm2-sycl/main.cpp @@ -106,5 +106,6 @@ int main(int argc, char *argv[]) { sycl::free(d_result, q); if (ok) printf("PASS\n"); + if (!ok) exit(1); return 0; } diff --git a/src/nosync-cuda/main.cu b/src/nosync-cuda/main.cu index e581e48802..5f39d014ee 100644 --- a/src/nosync-cuda/main.cu +++ b/src/nosync-cuda/main.cu @@ -6,6 +6,7 @@ #include #include #include +#include // This example shows how to execute a Thrust device algorithm on an explicit // CUDA stream. The simple program below fills a vector with the numbers @@ -115,6 +116,7 @@ int main(int argc, char* argv[]) // Print the sum: std::cout << ((sum == 0) ? "PASS" : "FAIL") << "\n"; + if (sum != 0) exit(1); return 0; } diff --git a/src/nosync-hip/main.cu b/src/nosync-hip/main.cu index 0ffd2cb754..8081d79242 100644 --- a/src/nosync-hip/main.cu +++ b/src/nosync-hip/main.cu @@ -6,6 +6,7 @@ #include #include #include +#include // This example shows how to execute a Thrust device algorithm on an explicit @@ -110,6 +111,7 @@ int main(int argc, char* argv[]) // Print the sum: std::cout << ((sum == 0) ? "PASS" : "FAIL") << "\n"; + if (sum != 0) exit(1); return 0; } diff --git a/src/nosync-sycl/main.cpp b/src/nosync-sycl/main.cpp index afbb286672..7cf8fee35e 100644 --- a/src/nosync-sycl/main.cpp +++ b/src/nosync-sycl/main.cpp @@ -8,6 +8,7 @@ #include #include #include +#include int main(int argc, char *argv[]) try { if (argc != 3) { @@ -85,6 +86,7 @@ int main(int argc, char *argv[]) try { // Print the sum: std::cout << ((sum == 0) ? "PASS" : "FAIL") << "\n"; + if (sum != 0) exit(1); return 0; } diff --git a/src/nqueen-cuda/main.cu b/src/nqueen-cuda/main.cu index 5a301e627f..c06bee5ed1 100644 --- a/src/nqueen-cuda/main.cu +++ b/src/nqueen-cuda/main.cu @@ -263,5 +263,6 @@ int main(int argc, char *argv[]) free(root_prefixes_h); free(vector_of_tree_size_h); free(solutions_h); + if (qtd_sols_global != 2279184 && tree_size == 171129071) return 1; return 0; } diff --git a/src/nqueen-hip/main.cu b/src/nqueen-hip/main.cu index ae32bba5b7..c3137d3f79 100644 --- a/src/nqueen-hip/main.cu +++ b/src/nqueen-hip/main.cu @@ -264,5 +264,6 @@ int main(int argc, char *argv[]) free(root_prefixes_h); free(vector_of_tree_size_h); free(solutions_h); + if (qtd_sols_global != 2279184 && tree_size == 171129071) return 1; return 0; } diff --git a/src/nqueen-omp/main.cpp b/src/nqueen-omp/main.cpp index 7529563826..0f5e0b22f4 100644 --- a/src/nqueen-omp/main.cpp +++ b/src/nqueen-omp/main.cpp @@ -238,5 +238,6 @@ int main(int argc, char *argv[]) free(root_prefixes_h); free(vector_of_tree_size_h); free(solutions_h); + if (qtd_sols_global != 2279184 && tree_size == 171129071) return 1; return 0; } diff --git a/src/nqueen-sycl/main.cpp b/src/nqueen-sycl/main.cpp index dd1a8dff3b..77a97860f1 100644 --- a/src/nqueen-sycl/main.cpp +++ b/src/nqueen-sycl/main.cpp @@ -265,5 +265,6 @@ int main(int argc, char *argv[]) free(root_prefixes_h); free(vector_of_tree_size_h); free(solutions_h); + if (qtd_sols_global != 2279184 && tree_size == 171129071) return 1; return 0; } diff --git a/src/nw-cuda/nw.cu b/src/nw-cuda/nw.cu index adb03aa2cb..4a50c27097 100644 --- a/src/nw-cuda/nw.cu +++ b/src/nw-cuda/nw.cu @@ -412,6 +412,7 @@ int main(int argc, char **argv){ free(output_itemsets); cudaFree(d_input_itemsets); cudaFree(d_reference); + if (err) return 1; return 0; } diff --git a/src/nw-hip/Makefile.hipcl b/src/nw-hip/Makefile.hipcl index da9db70306..eb4e91bb63 100644 --- a/src/nw-hip/Makefile.hipcl +++ b/src/nw-hip/Makefile.hipcl @@ -12,7 +12,7 @@ DUMP = no # Program name & source code list #=============================================================================== -program = nw +program = main source = nw.cu diff --git a/src/nw-hip/nw.cu b/src/nw-hip/nw.cu index 2a967fc5e0..2f116de37b 100644 --- a/src/nw-hip/nw.cu +++ b/src/nw-hip/nw.cu @@ -412,6 +412,7 @@ int main(int argc, char **argv){ free(output_itemsets); hipFree(d_input_itemsets); hipFree(d_reference); + if (err) return 1; return 0; } diff --git a/src/nw-omp/Makefile b/src/nw-omp/Makefile index 5729999e96..81e79bed14 100644 --- a/src/nw-omp/Makefile +++ b/src/nw-omp/Makefile @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = nw +program = main source = nw.cpp diff --git a/src/nw-omp/nw.cpp b/src/nw-omp/nw.cpp index c5488e8a0d..b79bc10a0e 100644 --- a/src/nw-omp/nw.cpp +++ b/src/nw-omp/nw.cpp @@ -387,6 +387,7 @@ int main(int argc, char **argv){ free(reference); free(input_itemsets); free(h_input_itemsets); + if (err) return 1; return 0; } diff --git a/src/nw-sycl/nw.cpp b/src/nw-sycl/nw.cpp index 9456a1241b..04eedc2018 100644 --- a/src/nw-sycl/nw.cpp +++ b/src/nw-sycl/nw.cpp @@ -306,5 +306,6 @@ int main(int argc, char **argv){ free(output_itemsets); sycl::free(d_input_itemsets_acc, q); sycl::free(d_reference_acc, q); + if (err) return 1; return 0; } diff --git a/src/openmp-cuda/main.cu b/src/openmp-cuda/main.cu index 29e4bf43ee..841e067a58 100644 --- a/src/openmp-cuda/main.cu +++ b/src/openmp-cuda/main.cu @@ -108,5 +108,6 @@ int main(int argc, char *argv[]) { printf("Runtime overhead of first run is %f seconds\n", overhead); free(a); + if (!bResult) return 1; return 0; } diff --git a/src/openmp-hip/main.cu b/src/openmp-hip/main.cu index e1d33a4137..71c8632024 100644 --- a/src/openmp-hip/main.cu +++ b/src/openmp-hip/main.cu @@ -108,5 +108,6 @@ int main(int argc, char *argv[]) { printf("Runtime overhead of first run is %f seconds\n", overhead); free(a); + if (!bResult) return 1; return 0; } diff --git a/src/openmp-omp/main.cpp b/src/openmp-omp/main.cpp index 879aa4a6dc..21902fff32 100644 --- a/src/openmp-omp/main.cpp +++ b/src/openmp-omp/main.cpp @@ -96,5 +96,6 @@ int main(int argc, char *argv[]) { printf("Runtime overhead of first run is %f seconds\n", overhead); free(a); + if (!bResult) return 1; return 0; } diff --git a/src/openmp-sycl/main.cpp b/src/openmp-sycl/main.cpp index cd3b71ccfd..e24ab7e225 100644 --- a/src/openmp-sycl/main.cpp +++ b/src/openmp-sycl/main.cpp @@ -113,5 +113,6 @@ int main(int argc, char *argv[]) { printf("Runtime overhead of first run is %f seconds\n", overhead); free(a); + if (!bResult) return 1; return 0; } diff --git a/src/overlap-cuda/main.cu b/src/overlap-cuda/main.cu index 9eed0cfe14..4c47aec22d 100644 --- a/src/overlap-cuda/main.cu +++ b/src/overlap-cuda/main.cu @@ -110,6 +110,7 @@ int main(int argc, char *argv[]) { // Verify the results, we will use the results for final output bool bResults = check(); printf("\n%s\n", bResults ? "PASS" : "FAIL"); + if (!bResults) exit(1); // Free resources for (int i = 0; i < STREAM_COUNT; ++i) { diff --git a/src/overlap-hip/main.cu b/src/overlap-hip/main.cu index 88b7c144ab..28151cb333 100644 --- a/src/overlap-hip/main.cu +++ b/src/overlap-hip/main.cu @@ -110,6 +110,7 @@ int main(int argc, char *argv[]) { // Verify the results, we will use the results for final output bool bResults = check(); printf("\n%s\n", bResults ? "PASS" : "FAIL"); + if (!bResults) exit(1); // Free resources for (int i = 0; i < STREAM_COUNT; ++i) { diff --git a/src/overlap-sycl/main.cpp b/src/overlap-sycl/main.cpp index 501e83f920..c98c9cd016 100644 --- a/src/overlap-sycl/main.cpp +++ b/src/overlap-sycl/main.cpp @@ -121,6 +121,7 @@ int main(int argc, char *argv[]) { // Verify the results, we will use the results for final output bool bResults = check(); printf("\n%s\n", bResults ? "PASS" : "FAIL"); + if (!bResults) exit(1); // Free resources for (int i = 0; i < STREAM_COUNT; ++i) { diff --git a/src/overlay-cuda/main.cu b/src/overlay-cuda/main.cu index e359060844..218f982a3a 100644 --- a/src/overlay-cuda/main.cu +++ b/src/overlay-cuda/main.cu @@ -153,5 +153,6 @@ int main(int argc, char* argv[]) { free(output); free(ref_output); free(detections); + if (!ok) return 1; return 0; } diff --git a/src/overlay-hip/main.cu b/src/overlay-hip/main.cu index c85917bf5b..f6d943e77d 100644 --- a/src/overlay-hip/main.cu +++ b/src/overlay-hip/main.cu @@ -153,5 +153,6 @@ int main(int argc, char* argv[]) { free(output); free(ref_output); free(detections); + if (!ok) return 1; return 0; } diff --git a/src/overlay-omp/main.cpp b/src/overlay-omp/main.cpp index d3ead13c93..8e40a4e167 100644 --- a/src/overlay-omp/main.cpp +++ b/src/overlay-omp/main.cpp @@ -145,5 +145,6 @@ int main(int argc, char* argv[]) { free(output); free(ref_output); free(detections); + if (!ok) return 1; return 0; } diff --git a/src/overlay-sycl/main.cpp b/src/overlay-sycl/main.cpp index d7aedb04f5..decde59309 100644 --- a/src/overlay-sycl/main.cpp +++ b/src/overlay-sycl/main.cpp @@ -169,5 +169,6 @@ int main(int argc, char* argv[]) { free(output); free(ref_output); free(detections); + if (!ok) return 1; return 0; } diff --git a/src/p4-cuda/reference.h b/src/p4-cuda/reference.h index c576c6ff4c..5a0e11c1ee 100644 --- a/src/p4-cuda/reference.h +++ b/src/p4-cuda/reference.h @@ -1,4 +1,5 @@ #include +#include int reference ( const float *__restrict__ cls_input, @@ -175,6 +176,7 @@ void verify ( } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); free(score_output_r); free(bndbox_output_r); } diff --git a/src/page-rank-cuda/main.cu b/src/page-rank-cuda/main.cu index bc9df5b716..1feef6d5b2 100644 --- a/src/page-rank-cuda/main.cu +++ b/src/page-rank-cuda/main.cu @@ -268,5 +268,6 @@ int main(int argc, char *argv[]) { free(noutlinks); free(diffs); + if (!ok) return 1; return 0; } diff --git a/src/page-rank-hip/Makefile.hipcl b/src/page-rank-hip/Makefile.hipcl index f09c6603ec..1a57acfb47 100644 --- a/src/page-rank-hip/Makefile.hipcl +++ b/src/page-rank-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = page-rank +program = main source = main.cu diff --git a/src/page-rank-hip/main.cu b/src/page-rank-hip/main.cu index fefbd6fca0..0a29f08204 100644 --- a/src/page-rank-hip/main.cu +++ b/src/page-rank-hip/main.cu @@ -268,5 +268,6 @@ int main(int argc, char *argv[]) { free(noutlinks); free(diffs); + if (!ok) return 1; return 0; } diff --git a/src/page-rank-omp/main.cpp b/src/page-rank-omp/main.cpp index aa0e460446..fdecf69930 100644 --- a/src/page-rank-omp/main.cpp +++ b/src/page-rank-omp/main.cpp @@ -216,5 +216,6 @@ int main(int argc, char *argv[]) { free(page_ranks); free(noutlinks); free(diffs); + if (!ok) return 1; return 0; } diff --git a/src/page-rank-sycl/main.cpp b/src/page-rank-sycl/main.cpp index 121b2668ae..7414f6fb07 100644 --- a/src/page-rank-sycl/main.cpp +++ b/src/page-rank-sycl/main.cpp @@ -263,5 +263,6 @@ int main(int argc, char *argv[]) { free(page_ranks); free(noutlinks); free(diffs); + if (!ok) return 1; return 0; } diff --git a/src/particle-diffusion-cuda/motionsim.cu b/src/particle-diffusion-cuda/motionsim.cu index 42f6383136..3a17baeabf 100644 --- a/src/particle-diffusion-cuda/motionsim.cu +++ b/src/particle-diffusion-cuda/motionsim.cu @@ -322,5 +322,6 @@ int main(int argc, char* argv[]) { delete[] map; delete[] map_ref; + if (count > 2) return 1; return 0; } diff --git a/src/particle-diffusion-hip/Makefile.hipcl b/src/particle-diffusion-hip/Makefile.hipcl index c96c82f494..57fc622601 100644 --- a/src/particle-diffusion-hip/Makefile.hipcl +++ b/src/particle-diffusion-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = motionsim +program = main source = motionsim.cu diff --git a/src/particle-diffusion-hip/motionsim.cu b/src/particle-diffusion-hip/motionsim.cu index 6bb5d801b0..c4c4596496 100644 --- a/src/particle-diffusion-hip/motionsim.cu +++ b/src/particle-diffusion-hip/motionsim.cu @@ -321,5 +321,6 @@ int main(int argc, char* argv[]) { delete[] map; delete[] map_ref; + if (count > 2) return 1; return 0; } diff --git a/src/particle-diffusion-omp/motionsim.cpp b/src/particle-diffusion-omp/motionsim.cpp index e0ddf16772..1c7a7a61b5 100644 --- a/src/particle-diffusion-omp/motionsim.cpp +++ b/src/particle-diffusion-omp/motionsim.cpp @@ -273,5 +273,6 @@ int main(int argc, char* argv[]) { delete[] map; delete[] map_ref; + if (count > 2) return 1; return 0; } diff --git a/src/particle-diffusion-sycl/motionsim.cpp b/src/particle-diffusion-sycl/motionsim.cpp index 6c3cc77fcc..c02593fa51 100644 --- a/src/particle-diffusion-sycl/motionsim.cpp +++ b/src/particle-diffusion-sycl/motionsim.cpp @@ -310,5 +310,6 @@ int main(int argc, char* argv[]) { delete[] map; delete[] map_ref; + if (count > 2) return 1; return 0; } diff --git a/src/perplexity-cuda/main.cu b/src/perplexity-cuda/main.cu index 1b116492e6..562c2b3adc 100644 --- a/src/perplexity-cuda/main.cu +++ b/src/perplexity-cuda/main.cu @@ -163,5 +163,6 @@ int main(int argc, char* argv[]) { cudaFree(d_distance); cudaFree(d_data); + if (!ok) return 1; return 0; } diff --git a/src/perplexity-hip/main.cu b/src/perplexity-hip/main.cu index 699d71f009..c2b44e1859 100644 --- a/src/perplexity-hip/main.cu +++ b/src/perplexity-hip/main.cu @@ -163,5 +163,6 @@ int main(int argc, char* argv[]) { hipFree(d_distance); hipFree(d_data); + if (!ok) return 1; return 0; } diff --git a/src/perplexity-omp/main.cpp b/src/perplexity-omp/main.cpp index 89c2f0a2aa..466195bdc0 100644 --- a/src/perplexity-omp/main.cpp +++ b/src/perplexity-omp/main.cpp @@ -135,6 +135,7 @@ int main(int argc, char* argv[]) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/perplexity-sycl/main.cpp b/src/perplexity-sycl/main.cpp index b23edb7b23..c0836add8d 100644 --- a/src/perplexity-sycl/main.cpp +++ b/src/perplexity-sycl/main.cpp @@ -175,6 +175,7 @@ int main(int argc, char* argv[]) { sycl::free(d_distance, q); sycl::free(d_data, q); + if (!ok) return 1; return 0; } diff --git a/src/pnpoly-cuda/main.cu b/src/pnpoly-cuda/main.cu index 4dcd715dfa..1f1bd0d14f 100644 --- a/src/pnpoly-cuda/main.cu +++ b/src/pnpoly-cuda/main.cu @@ -163,5 +163,6 @@ int main(int argc, char* argv[]) { free(point); free(bitmap_ref); free(bitmap_opt); + if (error) return 1; return 0; } diff --git a/src/pnpoly-hip/main.cu b/src/pnpoly-hip/main.cu index af81d01e59..909d3e3b2b 100644 --- a/src/pnpoly-hip/main.cu +++ b/src/pnpoly-hip/main.cu @@ -163,5 +163,6 @@ int main(int argc, char* argv[]) { free(point); free(bitmap_ref); free(bitmap_opt); + if (error) return 1; return 0; } diff --git a/src/pnpoly-omp/main.cpp b/src/pnpoly-omp/main.cpp index 8336307f68..5d7c188c4c 100644 --- a/src/pnpoly-omp/main.cpp +++ b/src/pnpoly-omp/main.cpp @@ -139,5 +139,6 @@ int main(int argc, char* argv[]) { free(point); free(bitmap_ref); free(bitmap_opt); + if (error) return 1; return 0; } diff --git a/src/pnpoly-sycl/main.cpp b/src/pnpoly-sycl/main.cpp index 6f8599976c..d23ae6e811 100644 --- a/src/pnpoly-sycl/main.cpp +++ b/src/pnpoly-sycl/main.cpp @@ -204,5 +204,6 @@ int main(int argc, char* argv[]) { free(point); free(bitmap_ref); free(bitmap_opt); + if (error) return 1; return 0; } diff --git a/src/pool-cuda/main.cu b/src/pool-cuda/main.cu index ecc1fb1378..7552ce1453 100644 --- a/src/pool-cuda/main.cu +++ b/src/pool-cuda/main.cu @@ -27,6 +27,7 @@ class MaxPoolGrad { }; #include "reference.h" +#include template template template void KernelPool2DGrad( @@ -208,5 +209,6 @@ int main(int argc, char* argv[]) delete[] input_grad; delete[] input_grad_ref; delete[] output_grad; + if (!ok) return 1; return 0; } diff --git a/src/pool-sycl/main.cpp b/src/pool-sycl/main.cpp index e1e003cf22..60d6de5f0b 100644 --- a/src/pool-sycl/main.cpp +++ b/src/pool-sycl/main.cpp @@ -25,6 +25,7 @@ class MaxPoolGrad { }; #include "reference.h" +#include // forward declaration template @@ -242,5 +243,6 @@ int main(int argc, char* argv[]) sycl::free(d_input_grad, q); sycl::free(d_output, q); sycl::free(d_output_grad, q); + if (!ok) return 1; return 0; } diff --git a/src/prefetch-cuda/main.cu b/src/prefetch-cuda/main.cu index 6931cbd58b..7f0dc67e09 100644 --- a/src/prefetch-cuda/main.cu +++ b/src/prefetch-cuda/main.cu @@ -21,6 +21,7 @@ #include #include #include +#include #define CUDACHECK(error) \ { \ @@ -137,6 +138,7 @@ void naive (const int numElements, const int repeat) bool testResult = (maxError == 0.0f); printf("%s\n", testResult ? "PASS" : "FAIL"); + if (!testResult) exit(1); } int main(int argc, char *argv[]) @@ -169,5 +171,6 @@ int main(int argc, char *argv[]) for (int i = 0; i < 10; i++) { naive(numElements, repeat); } + if (!testResult) return 1; return 0; } diff --git a/src/prefetch-hip/main.cu b/src/prefetch-hip/main.cu index b5231a8d1f..1115a1a3f1 100644 --- a/src/prefetch-hip/main.cu +++ b/src/prefetch-hip/main.cu @@ -21,6 +21,7 @@ #include #include #include +#include #define HIPCHECK(error) \ { \ @@ -88,6 +89,7 @@ void prefetch (const int gpuDeviceId, const int numElements, const int repeat) bool testResult = (maxError == 0.0f); printf("%s\n", testResult ? "PASS" : "FAIL"); + if (!testResult) exit(1); } void naive (const int numElements, const int repeat) @@ -133,6 +135,7 @@ void naive (const int numElements, const int repeat) bool testResult = (maxError == 0.0f); printf("%s\n", testResult ? "PASS" : "FAIL"); + if (!testResult) exit(1); } int main(int argc, char *argv[]) diff --git a/src/prefetch-sycl/main.cpp b/src/prefetch-sycl/main.cpp index 2642a01c69..406afd75a0 100644 --- a/src/prefetch-sycl/main.cpp +++ b/src/prefetch-sycl/main.cpp @@ -21,6 +21,7 @@ #include #include #include +#include //constexpr int MEM_ADVISE_READ_MOSTLY = PI_MEM_ADVICE_CUDA_SET_READ_MOSTLY; @@ -130,6 +131,7 @@ void naive(sycl::queue &q, const int numElements, const int repeat) bool testResult = (maxError == 0.0f); printf("%s\n", testResult ? "PASS" : "FAIL"); + if (!testResult) exit(1); } int main(int argc, char *argv[]) @@ -162,5 +164,6 @@ int main(int argc, char *argv[]) for (int i = 0; i < 10; i++) { naive(q, numElements, repeat); } + if (!testResult) return 1; return 0; } diff --git a/src/present-cuda/main.cu b/src/present-cuda/main.cu index b1a43d5cd4..35ed87de5c 100644 --- a/src/present-cuda/main.cu +++ b/src/present-cuda/main.cu @@ -574,6 +574,7 @@ int main(int argc, char** argv) { printf("FAIL\n"); else printf("PASS\n"); + if (h_checksum != d_checksum) exit(1); free(h_plain); free(h_key); diff --git a/src/present-hip/main.cu b/src/present-hip/main.cu index d15fe0ad50..5c2e6b03f7 100644 --- a/src/present-hip/main.cu +++ b/src/present-hip/main.cu @@ -574,6 +574,7 @@ int main(int argc, char** argv) { printf("FAIL\n"); else printf("PASS\n"); + if (h_checksum != d_checksum) exit(1); free(h_plain); free(h_key); diff --git a/src/present-omp/main.cpp b/src/present-omp/main.cpp index ff83a672bf..671c02d740 100644 --- a/src/present-omp/main.cpp +++ b/src/present-omp/main.cpp @@ -541,6 +541,7 @@ int main(int argc, char** argv) { printf("FAIL\n"); else printf("PASS\n"); + if (h_checksum != d_checksum) exit(1); free(h_plain); free(h_key); diff --git a/src/present-sycl/main.cpp b/src/present-sycl/main.cpp index 58360285fa..20f34ef242 100644 --- a/src/present-sycl/main.cpp +++ b/src/present-sycl/main.cpp @@ -591,6 +591,7 @@ int main(int argc, char **argv) { printf("FAIL\n"); else printf("PASS\n"); + if (h_checksum != d_checksum) exit(1); free(h_plain); free(h_key); diff --git a/src/projectile-cuda/Makefile b/src/projectile-cuda/Makefile index bcd9ab7acf..86a3bfdb48 100644 --- a/src/projectile-cuda/Makefile +++ b/src/projectile-cuda/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = Projectile +program = main source = Projectile.cu diff --git a/src/projectile-cuda/Projectile.cu b/src/projectile-cuda/Projectile.cu index 69bdd5f8ca..d0fd0d95f3 100644 --- a/src/projectile-cuda/Projectile.cu +++ b/src/projectile-cuda/Projectile.cu @@ -99,5 +99,6 @@ int main(int argc, char* argv[]) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/projectile-hip/Makefile b/src/projectile-hip/Makefile index e17b15d36a..e26fa38682 100644 --- a/src/projectile-hip/Makefile +++ b/src/projectile-hip/Makefile @@ -12,7 +12,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = Projectile +program = main source = Projectile.cu diff --git a/src/projectile-hip/Makefile.hipcl b/src/projectile-hip/Makefile.hipcl index ec24c6fbda..959f529653 100644 --- a/src/projectile-hip/Makefile.hipcl +++ b/src/projectile-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = Projectile +program = main source = Projectile.cu diff --git a/src/projectile-hip/Projectile.cu b/src/projectile-hip/Projectile.cu index 5823756aaa..a8785f73b8 100644 --- a/src/projectile-hip/Projectile.cu +++ b/src/projectile-hip/Projectile.cu @@ -99,5 +99,6 @@ int main(int argc, char* argv[]) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/projectile-omp/Makefile b/src/projectile-omp/Makefile index 2d939ba68b..b2bf7858c0 100644 --- a/src/projectile-omp/Makefile +++ b/src/projectile-omp/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = Projectile +program = main source = Projectile.cpp diff --git a/src/projectile-omp/Makefile.aomp b/src/projectile-omp/Makefile.aomp index e8a62fafea..61d572da85 100644 --- a/src/projectile-omp/Makefile.aomp +++ b/src/projectile-omp/Makefile.aomp @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = Projectile +program = main source = Projectile.cpp diff --git a/src/projectile-omp/Makefile.nvc b/src/projectile-omp/Makefile.nvc index a9bba09b9b..348660f413 100644 --- a/src/projectile-omp/Makefile.nvc +++ b/src/projectile-omp/Makefile.nvc @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = Projectile +program = main source = Projectile.cpp diff --git a/src/projectile-omp/Projectile.cpp b/src/projectile-omp/Projectile.cpp index 0c096a3500..e2de2405f2 100644 --- a/src/projectile-omp/Projectile.cpp +++ b/src/projectile-omp/Projectile.cpp @@ -82,5 +82,6 @@ int main(int argc, char* argv[]) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/projectile-sycl/Projectile.cpp b/src/projectile-sycl/Projectile.cpp index dae06132f1..5dd97bc44c 100644 --- a/src/projectile-sycl/Projectile.cpp +++ b/src/projectile-sycl/Projectile.cpp @@ -104,5 +104,6 @@ int main(int argc, char* argv[]) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/pso-cuda/main.cpp b/src/pso-cuda/main.cpp index 91136360b9..9bdfd90880 100644 --- a/src/pso-cuda/main.cpp +++ b/src/pso-cuda/main.cpp @@ -1,4 +1,5 @@ #include "kernel.h" +#include int main(int argc, char* argv[]) { @@ -63,5 +64,6 @@ int main(int argc, char* argv[]) free(pBests); free(pBests_ref); free(gBest); + if (!ok) return 1; return 0; } diff --git a/src/qem-cuda/main.cu b/src/qem-cuda/main.cu index d664af3b2d..d11c20e990 100644 --- a/src/qem-cuda/main.cu +++ b/src/qem-cuda/main.cu @@ -5,6 +5,7 @@ #include "reference.h" #include "gpu_solver.h" +#include void generate_data(int size, int min, int max, float *data) { std::mt19937_64 generator{1993764}; @@ -135,5 +136,7 @@ int main(int argc, char* argv[]) { checkCuda(cudaFreeHost(minimum_ref)); checkCuda(cudaFreeHost(minimum)); + if (!ok) return 1; + if (!ok) return 1; return 0; } diff --git a/src/qem-hip/main.cu b/src/qem-hip/main.cu index cf4ff3ea4c..4e71db02f9 100644 --- a/src/qem-hip/main.cu +++ b/src/qem-hip/main.cu @@ -5,6 +5,7 @@ #include "reference.h" #include "gpu_solver.h" +#include void generate_data(int size, int min, int max, float *data) { std::mt19937_64 generator{1993764}; @@ -98,6 +99,7 @@ int main(int argc, char* argv[]) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); avg = 0; @@ -125,6 +127,7 @@ int main(int argc, char* argv[]) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); checkHip(hipHostFree(A)); checkHip(hipHostFree(B)); diff --git a/src/qem-sycl/main.cpp b/src/qem-sycl/main.cpp index fc651a572d..76a84e5ad5 100644 --- a/src/qem-sycl/main.cpp +++ b/src/qem-sycl/main.cpp @@ -5,6 +5,7 @@ #include "gpu_solver.h" #include "reference.h" +#include void generate_data(int size, int min, int max, float *data) { std::mt19937_64 generator{1993764}; @@ -140,5 +141,7 @@ int main(int argc, char *argv[]) { sycl::free(minimum_ref, q); sycl::free(minimum, q); + if (!ok) return 1; + if (!ok) return 1; return 0; } diff --git a/src/qrg-cuda/main.cu b/src/qrg-cuda/main.cu index efb7b412b1..0379adb7e8 100644 --- a/src/qrg-cuda/main.cu +++ b/src/qrg-cuda/main.cu @@ -262,5 +262,6 @@ int main(int argc, const char **argv) free(h_OutputGPU); cudaFree(d_Output); cudaFree(d_Table); + if (!bPassFlag) return 1; return 0; } diff --git a/src/qrg-hip/main.cu b/src/qrg-hip/main.cu index 6f43c5a883..8030aec069 100644 --- a/src/qrg-hip/main.cu +++ b/src/qrg-hip/main.cu @@ -262,5 +262,6 @@ int main(int argc, const char **argv) free(h_OutputGPU); hipFree(d_Output); hipFree(d_Table); + if (!bPassFlag) return 1; return 0; } diff --git a/src/qrg-omp/main.cpp b/src/qrg-omp/main.cpp index 0fb570643d..a99c42dab1 100644 --- a/src/qrg-omp/main.cpp +++ b/src/qrg-omp/main.cpp @@ -236,5 +236,6 @@ int main(int argc, const char **argv) free(output); } + if (!bPassFlag) return 1; return 0; } diff --git a/src/qrg-sycl/main.cpp b/src/qrg-sycl/main.cpp index bd459263d2..86e2fbaaba 100644 --- a/src/qrg-sycl/main.cpp +++ b/src/qrg-sycl/main.cpp @@ -262,5 +262,6 @@ int main(int argc, const char **argv) free(h_OutputGPU); sycl::free(d_Output, q); sycl::free(d_Table, q); + if (!bPassFlag) return 1; return 0; } diff --git a/src/qtclustering-cuda/Makefile b/src/qtclustering-cuda/Makefile index 2468fdbc1f..81c66616f0 100644 --- a/src/qtclustering-cuda/Makefile +++ b/src/qtclustering-cuda/Makefile @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = qtc +program = main cpp_source = main.cpp Option.cpp OptionParser.cpp comm.cpp libdata.cpp cuda_source = QTC.cu diff --git a/src/qtclustering-hip/Makefile b/src/qtclustering-hip/Makefile index d5ce10ffb0..d69794d012 100644 --- a/src/qtclustering-hip/Makefile +++ b/src/qtclustering-hip/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = qtc +program = main cpp_source = main.cpp Option.cpp OptionParser.cpp comm.cpp libdata.cpp hip_source = QTC.cu diff --git a/src/qtclustering-hip/Makefile.hipcl b/src/qtclustering-hip/Makefile.hipcl index 038afaebda..49173e5094 100644 --- a/src/qtclustering-hip/Makefile.hipcl +++ b/src/qtclustering-hip/Makefile.hipcl @@ -12,7 +12,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = qtc +program = main cpp_source = main.cpp Option.cpp OptionParser.cpp comm.cpp libdata.cpp hip_source = QTC.cu diff --git a/src/qtclustering-omp/Makefile b/src/qtclustering-omp/Makefile index 655fb44616..cabd582e76 100644 --- a/src/qtclustering-omp/Makefile +++ b/src/qtclustering-omp/Makefile @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = qtc +program = main source = main.cpp Option.cpp OptionParser.cpp QTC.cpp comm.cpp libdata.cpp diff --git a/src/qtclustering-omp/Makefile.aomp b/src/qtclustering-omp/Makefile.aomp index b10576266d..34a98a37c2 100644 --- a/src/qtclustering-omp/Makefile.aomp +++ b/src/qtclustering-omp/Makefile.aomp @@ -15,7 +15,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = qtc +program = main source = main.cpp Option.cpp OptionParser.cpp QTC.cpp comm.cpp libdata.cpp diff --git a/src/qtclustering-omp/Makefile.nvc b/src/qtclustering-omp/Makefile.nvc index 261724a2f0..0e4b15b4f2 100644 --- a/src/qtclustering-omp/Makefile.nvc +++ b/src/qtclustering-omp/Makefile.nvc @@ -15,7 +15,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = qtc +program = main source = main.cpp Option.cpp OptionParser.cpp QTC.cpp comm.cpp libdata.cpp diff --git a/src/quant3MatMul-cuda/main.cu b/src/quant3MatMul-cuda/main.cu index 576e61c895..cbfe117c9c 100644 --- a/src/quant3MatMul-cuda/main.cu +++ b/src/quant3MatMul-cuda/main.cu @@ -141,5 +141,7 @@ int main(int argc, char* argv[]) free(h_scale); free(h_bias); free(h_output); + if (!ok) return 1; + if (!ok) return 1; return 0; } diff --git a/src/quant3MatMul-hip/main.cu b/src/quant3MatMul-hip/main.cu index 5e825ef723..15b2d967f9 100644 --- a/src/quant3MatMul-hip/main.cu +++ b/src/quant3MatMul-hip/main.cu @@ -141,5 +141,7 @@ int main(int argc, char* argv[]) free(h_scale); free(h_bias); free(h_output); + if (!ok) return 1; + if (!ok) return 1; return 0; } diff --git a/src/quant3MatMul-sycl/main.cpp b/src/quant3MatMul-sycl/main.cpp index 6e2526f17b..b4a7f680b1 100644 --- a/src/quant3MatMul-sycl/main.cpp +++ b/src/quant3MatMul-sycl/main.cpp @@ -148,5 +148,7 @@ int main(int argc, char* argv[]) free(h_scale); free(h_bias); free(h_output); + if (!ok) return 1; + if (!ok) return 1; return 0; } diff --git a/src/quantBnB-cuda/main.cu b/src/quantBnB-cuda/main.cu index ce47700fd9..095d703fb0 100644 --- a/src/quantBnB-cuda/main.cu +++ b/src/quantBnB-cuda/main.cu @@ -189,5 +189,6 @@ int main(int argc, char* argv[]) cudaFree(d_A); cudaFree(d_code); cudaFree(d_out); + if (out != ref) return 1; return 0; } diff --git a/src/quantBnB-hip/main.cu b/src/quantBnB-hip/main.cu index f4ce100e82..c34fe68e27 100644 --- a/src/quantBnB-hip/main.cu +++ b/src/quantBnB-hip/main.cu @@ -189,5 +189,6 @@ int main(int argc, char* argv[]) hipFree(d_A); hipFree(d_code); hipFree(d_out); + if (out != ref) return 1; return 0; } diff --git a/src/quantBnB-omp/main.cpp b/src/quantBnB-omp/main.cpp index b52336c828..bb4596d224 100644 --- a/src/quantBnB-omp/main.cpp +++ b/src/quantBnB-omp/main.cpp @@ -133,5 +133,6 @@ int main(int argc, char* argv[]) free(A); free(out); free(ref); + if (out_size)) return 1; return 0; } diff --git a/src/quantBnB-sycl/main.cpp b/src/quantBnB-sycl/main.cpp index 4a86bb6cd3..f80bd6f3e2 100644 --- a/src/quantBnB-sycl/main.cpp +++ b/src/quantBnB-sycl/main.cpp @@ -209,5 +209,6 @@ int main(int argc, char* argv[]) sycl::free(d_A, q); sycl::free(d_code, q); sycl::free(d_out, q); + if (out != ref) return 1; return 0; } diff --git a/src/quantVLLM-cuda/main.cu b/src/quantVLLM-cuda/main.cu index 4e6c2df155..87aa8d1f0e 100644 --- a/src/quantVLLM-cuda/main.cu +++ b/src/quantVLLM-cuda/main.cu @@ -8,6 +8,7 @@ #include #include "utils.h" #include "reference.h" +#include template __global__ void static_scaled_int8_quant_kernel( @@ -265,6 +266,7 @@ void quant(int num_tokens, int hidden_size, int repeat) { error += memcmp(h_output, h_output_r, output_size_bytes); printf("%s\n", error ? "FAIL" : "PASS"); + if (error) exit(1); cudaFree(d_input); cudaFree(d_output); diff --git a/src/quantVLLM-hip/main.cu b/src/quantVLLM-hip/main.cu index 5a38c21e26..e14a2ec38b 100644 --- a/src/quantVLLM-hip/main.cu +++ b/src/quantVLLM-hip/main.cu @@ -7,6 +7,7 @@ #include #include "utils.h" #include "reference.h" +#include template __global__ void static_scaled_int8_quant_kernel( @@ -264,6 +265,7 @@ void quant(int num_tokens, int hidden_size, int repeat) { error += memcmp(h_output, h_output_r, output_size_bytes); printf("%s\n", error ? "FAIL" : "PASS"); + if (error) exit(1); hipFree(d_input); hipFree(d_output); diff --git a/src/quantVLLM-sycl/main.cpp b/src/quantVLLM-sycl/main.cpp index 0bc449cd88..05c353c860 100644 --- a/src/quantVLLM-sycl/main.cpp +++ b/src/quantVLLM-sycl/main.cpp @@ -4,6 +4,7 @@ #include #include "utils.h" #include "reference.h" +#include template void static_scaled_int8_quant_kernel( @@ -285,6 +286,7 @@ void quant(sycl::queue &q, int num_tokens, int hidden_size, int repeat) { error += memcmp(h_output, h_output_r, output_size_bytes); printf("%s\n", error ? "FAIL" : "PASS"); + if (error) exit(1); sycl::free(d_input, q); sycl::free(d_output, q); diff --git a/src/radixsort-cuda/main.cu b/src/radixsort-cuda/main.cu index 770c83b48c..40dcd991f7 100644 --- a/src/radixsort-cuda/main.cu +++ b/src/radixsort-cuda/main.cu @@ -12,6 +12,7 @@ #include #include "RadixSort.h" #include "Scan.h" +#include void makeRandomUintVector(unsigned int *a, unsigned int numElements, unsigned int keybits); bool verifySortUint(unsigned int *keysSorted, @@ -115,6 +116,7 @@ int main(int argc, const char **argv) printf("PASS\n"); else printf("FAIL\n"); + if (!passed) exit(1); return 0; } diff --git a/src/radixsort-hip/main.cu b/src/radixsort-hip/main.cu index e5fbb0ccb0..5281fd787b 100644 --- a/src/radixsort-hip/main.cu +++ b/src/radixsort-hip/main.cu @@ -12,6 +12,7 @@ #include #include "RadixSort.h" #include "Scan.h" +#include void makeRandomUintVector(unsigned int *a, unsigned int numElements, unsigned int keybits); bool verifySortUint(unsigned int *keysSorted, @@ -115,6 +116,7 @@ int main(int argc, const char **argv) printf("PASS\n"); else printf("FAIL\n"); + if (!passed) exit(1); return 0; } diff --git a/src/radixsort-omp/main.cpp b/src/radixsort-omp/main.cpp index 79cc6e8c11..99046ce343 100644 --- a/src/radixsort-omp/main.cpp +++ b/src/radixsort-omp/main.cpp @@ -12,6 +12,7 @@ #include #include "RadixSort.h" #include "Scan.h" +#include void makeRandomUintVector(unsigned int *a, unsigned int numElements, unsigned int keybits); bool verifySortUint(unsigned int *keysSorted, @@ -105,6 +106,7 @@ int main(int argc, const char **argv) printf("PASS\n"); else printf("FAIL\n"); + if (!passed) exit(1); return 0; } diff --git a/src/radixsort-sycl/main.cpp b/src/radixsort-sycl/main.cpp index 2d0d840424..1f402b0589 100644 --- a/src/radixsort-sycl/main.cpp +++ b/src/radixsort-sycl/main.cpp @@ -12,6 +12,7 @@ #include #include "RadixSort.h" #include "Scan.h" +#include void makeRandomUintVector(uint *a, uint numElements, uint keybits); bool verifySortUint(uint *keysSorted, @@ -105,6 +106,7 @@ int main(int argc, const char **argv) printf("PASS\n"); else printf("FAIL\n"); + if (!passed) exit(1); return 0; } diff --git a/src/radixsort2-cuda/main.cu b/src/radixsort2-cuda/main.cu index fa51bcc35e..ca78d217f0 100644 --- a/src/radixsort2-cuda/main.cu +++ b/src/radixsort2-cuda/main.cu @@ -9,6 +9,7 @@ #include #include "helper_string.h" +#include template @@ -140,4 +141,5 @@ int main(int argc, char **argv) { bTestResult = testSort(argc, argv); printf(bTestResult ? "PASS\n" : "FAIL\n"); + if (!bTestResult) exit(1); } diff --git a/src/radixsort2-hip/main.cu b/src/radixsort2-hip/main.cu index c5de34e98b..7ba4920f44 100644 --- a/src/radixsort2-hip/main.cu +++ b/src/radixsort2-hip/main.cu @@ -9,6 +9,7 @@ #include #include "helper_string.h" +#include template @@ -140,4 +141,5 @@ int main(int argc, char **argv) { bTestResult = testSort(argc, argv); printf(bTestResult ? "PASS\n" : "FAIL\n"); + if (!bTestResult) exit(1); } diff --git a/src/radixsort2-sycl/main.cpp b/src/radixsort2-sycl/main.cpp index bb312b4b28..c6bc10a440 100644 --- a/src/radixsort2-sycl/main.cpp +++ b/src/radixsort2-sycl/main.cpp @@ -6,6 +6,7 @@ #include #include #include "helper_string.h" +#include template bool testSort(int argc, char **argv) { int cmdVal; @@ -148,4 +149,5 @@ int main(int argc, char **argv) { bTestResult = testSort(argc, argv); printf(bTestResult ? "PASS\n" : "FAIL\n"); + if (!bTestResult) exit(1); } diff --git a/src/rainflow-cuda/main.cu b/src/rainflow-cuda/main.cu index 25dc5f38d0..a3fa7704d3 100644 --- a/src/rainflow-cuda/main.cu +++ b/src/rainflow-cuda/main.cu @@ -263,5 +263,6 @@ int main(int argc, char* argv[]) { free(result_lengths); free(ref_result_lengths); + if (error) return 1; return 0; } diff --git a/src/rainflow-hip/main.cu b/src/rainflow-hip/main.cu index b5d2e02021..2415b2f164 100644 --- a/src/rainflow-hip/main.cu +++ b/src/rainflow-hip/main.cu @@ -263,5 +263,6 @@ int main(int argc, char* argv[]) { free(result_lengths); free(ref_result_lengths); + if (error) return 1; return 0; } diff --git a/src/rainflow-omp/main.cpp b/src/rainflow-omp/main.cpp index 7b001c78d9..fd3a1d8ab0 100644 --- a/src/rainflow-omp/main.cpp +++ b/src/rainflow-omp/main.cpp @@ -216,5 +216,6 @@ int main(int argc, char* argv[]) { free(result_lengths); free(ref_result_lengths); + if (error) return 1; return 0; } diff --git a/src/rainflow-sycl/main.cpp b/src/rainflow-sycl/main.cpp index 6716bd8b6e..d0c72f4e5a 100644 --- a/src/rainflow-sycl/main.cpp +++ b/src/rainflow-sycl/main.cpp @@ -270,5 +270,6 @@ int main(int argc, char* argv[]) { free(result_lengths); free(ref_result_lengths); + if (error) return 1; return 0; } diff --git a/src/randomAccess-cuda/main.cu b/src/randomAccess-cuda/main.cu index e55268d06d..0b8e4c4300 100644 --- a/src/randomAccess-cuda/main.cu +++ b/src/randomAccess-cuda/main.cu @@ -143,6 +143,7 @@ int main(int argc, char** argv) { fprintf(stdout, "Found %llu errors in %llu locations (%s).\n", temp, TableSize, (temp <= 0.01*TableSize) ? "PASS" : "FAIL"); + if (temp > 0.01*TableSize) exit(1); if (temp <= 0.01*TableSize) failure = 0; else failure = 1; diff --git a/src/randomAccess-hip/main.cu b/src/randomAccess-hip/main.cu index e991aa93bc..d1eda15926 100644 --- a/src/randomAccess-hip/main.cu +++ b/src/randomAccess-hip/main.cu @@ -143,6 +143,7 @@ int main(int argc, char** argv) { fprintf(stdout, "Found %llu errors in %llu locations (%s).\n", temp, TableSize, (temp <= 0.01*TableSize) ? "PASS" : "FAIL"); + if (temp > 0.01*TableSize) exit(1); if (temp <= 0.01*TableSize) failure = 0; else failure = 1; diff --git a/src/randomAccess-omp/main.cpp b/src/randomAccess-omp/main.cpp index 99738c5f82..c51ac5c010 100644 --- a/src/randomAccess-omp/main.cpp +++ b/src/randomAccess-omp/main.cpp @@ -136,6 +136,7 @@ int main(int argc, char** argv) { fprintf( stdout, "Found %llu errors in %llu locations (%s).\n", temp, TableSize, (temp <= 0.01*TableSize) ? "PASS" : "FAIL"); + if (temp > 0.01*TableSize) exit(1); if (temp <= 0.01*TableSize) failure = 0; else failure = 1; diff --git a/src/randomAccess-sycl/main.cpp b/src/randomAccess-sycl/main.cpp index bb322cfe92..d0c2fd1380 100644 --- a/src/randomAccess-sycl/main.cpp +++ b/src/randomAccess-sycl/main.cpp @@ -161,6 +161,7 @@ int main(int argc, char** argv) { fprintf(stdout, "Found %llu errors in %llu locations (%s).\n", temp, TableSize, (temp <= 0.01*TableSize) ? "PASS" : "FAIL"); + if (temp > 0.01*TableSize) exit(1); if (temp <= 0.01*TableSize) failure = 0; else failure = 1; diff --git a/src/relu-cuda/main.cu b/src/relu-cuda/main.cu index 3a5d1f330a..fc3e034068 100644 --- a/src/relu-cuda/main.cu +++ b/src/relu-cuda/main.cu @@ -339,5 +339,9 @@ int main(int argc, char* argv[]) free(h_backprop); free(r_backprop); + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; return 0; } diff --git a/src/relu-hip/main.cu b/src/relu-hip/main.cu index 4b36cdda37..37ca6640a4 100644 --- a/src/relu-hip/main.cu +++ b/src/relu-hip/main.cu @@ -343,5 +343,9 @@ int main(int argc, char* argv[]) free(h_backprop); free(r_backprop); + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; return 0; } diff --git a/src/relu-sycl/main.cpp b/src/relu-sycl/main.cpp index 390df21cd0..720e6abfc7 100644 --- a/src/relu-sycl/main.cpp +++ b/src/relu-sycl/main.cpp @@ -388,5 +388,9 @@ int main(int argc, char* argv[]) free(h_backprop); free(r_backprop); + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; + if (fail) return 1; return 0; } diff --git a/src/reverse-cuda/main.cu b/src/reverse-cuda/main.cu index 172e4af3fc..b16e197b59 100644 --- a/src/reverse-cuda/main.cu +++ b/src/reverse-cuda/main.cu @@ -79,5 +79,6 @@ int main(int argc, char* argv[]) { printf("%s\n", error ? "FAIL" : "PASS"); cudaFree(d_test); + if (error) return 1; return 0; } diff --git a/src/reverse-hip/main.cu b/src/reverse-hip/main.cu index f31dbed943..2a660b5ace 100644 --- a/src/reverse-hip/main.cu +++ b/src/reverse-hip/main.cu @@ -79,5 +79,6 @@ int main(int argc, char* argv[]) { printf("%s\n", error ? "FAIL" : "PASS"); hipFree(d_test); + if (error) return 1; return 0; } diff --git a/src/reverse-omp/main.cpp b/src/reverse-omp/main.cpp index 37b8074e45..8770d2d804 100644 --- a/src/reverse-omp/main.cpp +++ b/src/reverse-omp/main.cpp @@ -78,6 +78,7 @@ int main(int argc, char* argv[]) { printf("Total kernel execution time: %f (s)\n", time * 1e-9f); printf("%s\n", error ? "FAIL" : "PASS"); + if (error) exit(1); return 0; } diff --git a/src/reverse-sycl/main.cpp b/src/reverse-sycl/main.cpp index 95f3f9c280..92a74e03fe 100644 --- a/src/reverse-sycl/main.cpp +++ b/src/reverse-sycl/main.cpp @@ -87,5 +87,6 @@ int main(int argc, char* argv[]) { free(d_test, q); + if (error) return 1; return 0; } diff --git a/src/rfs-cuda/main.cu b/src/rfs-cuda/main.cu index f34df80625..461b3ee29f 100644 --- a/src/rfs-cuda/main.cu +++ b/src/rfs-cuda/main.cu @@ -183,5 +183,7 @@ int main(int argc, char* argv[]) { free(factor); free(result_ref); + if (!ok) return 1; + if (!ok) return 1; return 0; } diff --git a/src/rfs-hip/main.cu b/src/rfs-hip/main.cu index 8daacf2e31..b7799302ac 100644 --- a/src/rfs-hip/main.cu +++ b/src/rfs-hip/main.cu @@ -183,5 +183,7 @@ int main(int argc, char* argv[]) { free(factor); free(result_ref); + if (!ok) return 1; + if (!ok) return 1; return 0; } diff --git a/src/rfs-omp/main.cpp b/src/rfs-omp/main.cpp index 9b66389c8f..9fb5cf26c3 100644 --- a/src/rfs-omp/main.cpp +++ b/src/rfs-omp/main.cpp @@ -174,5 +174,7 @@ int main(int argc, char* argv[]) { free(factor); free(result_ref); + if (!ok) return 1; + if (!ok) return 1; return 0; } diff --git a/src/rfs-sycl/main.cpp b/src/rfs-sycl/main.cpp index fb81134f1c..d850a36a16 100644 --- a/src/rfs-sycl/main.cpp +++ b/src/rfs-sycl/main.cpp @@ -205,5 +205,7 @@ int main(int argc, char* argv[]) { free(factor); free(result_ref); + if (!ok) return 1; + if (!ok) return 1; return 0; } diff --git a/src/ring-cuda/main.cu b/src/ring-cuda/main.cu index a12a7a5f9c..ccfe5b6d03 100644 --- a/src/ring-cuda/main.cu +++ b/src/ring-cuda/main.cu @@ -4,6 +4,7 @@ #include // iota #include #include +#include // Send data in a circular manner in all GPU devices (non-P2P) // Original author: Thomas Applencourt @@ -87,5 +88,6 @@ int main(int argc, char* argv[]) cudaFree(device_ptr[i]); } } + if (!ok) return 1; return 0; } diff --git a/src/ring-hip/main.cu b/src/ring-hip/main.cu index f03f272eff..85710597d6 100644 --- a/src/ring-hip/main.cu +++ b/src/ring-hip/main.cu @@ -4,6 +4,7 @@ #include // iota #include #include +#include // Send data in a circular manner in all GPU devices (non-P2P) // Original author: Thomas Applencourt @@ -87,5 +88,6 @@ int main(int argc, char* argv[]) hipFree(device_ptr[i]); } } + if (!ok) return 1; return 0; } diff --git a/src/ring-sycl/main.cpp b/src/ring-sycl/main.cpp index 65be9bd91a..03f4bd8de8 100644 --- a/src/ring-sycl/main.cpp +++ b/src/ring-sycl/main.cpp @@ -4,6 +4,7 @@ #include // iota #include #include +#include // Send data in a circular manner in all GPU devices (non-P2P) // Original author: Thomas Applencourt @@ -89,5 +90,6 @@ int main(int argc, char* argv[]) free(device_ptr[i], queues[i]); } } + if (!ok) return 1; return 0; } diff --git a/src/rle-cuda/main.cu b/src/rle-cuda/main.cu index 16c699cc8f..f596329bd9 100644 --- a/src/rle-cuda/main.cu +++ b/src/rle-cuda/main.cu @@ -38,6 +38,7 @@ #include #include #include "test_util.h" +#include using namespace cub; @@ -509,5 +510,8 @@ int main(int argc, char **argv) // TestSize(num_items); // TestSize(num_items); + if (compare0) return 1; + if (compare1) return 1; + if (compare2) return 1; return 0; } diff --git a/src/rle-hip/main.cu b/src/rle-hip/main.cu index ccf616b81a..1a91b9c66a 100644 --- a/src/rle-hip/main.cu +++ b/src/rle-hip/main.cu @@ -38,6 +38,7 @@ #include #include #include "test_util.h" +#include using namespace hipcub; @@ -507,5 +508,8 @@ int main(int argc, char **argv) // TestSize(num_items); // TestSize(num_items); + if (compare0) return 1; + if (compare1) return 1; + if (compare2) return 1; return 0; } diff --git a/src/rng-wallace-cuda/main.cu b/src/rng-wallace-cuda/main.cu index 363bf3f965..b1ab9d3f62 100644 --- a/src/rng-wallace-cuda/main.cu +++ b/src/rng-wallace-cuda/main.cu @@ -103,5 +103,6 @@ int main(int argc, char* argv[]) { cudaFree(devicerngChi2Corrections); cudaFree(device_randomNumbers); cudaFree(devPool); + if (!ok) return 1; return 0; } diff --git a/src/rng-wallace-hip/main.cu b/src/rng-wallace-hip/main.cu index 455cd992bf..4feac7d089 100644 --- a/src/rng-wallace-hip/main.cu +++ b/src/rng-wallace-hip/main.cu @@ -103,5 +103,6 @@ int main(int argc, char* argv[]) { hipFree(devicerngChi2Corrections); hipFree(device_randomNumbers); hipFree(devPool); + if (!ok) return 1; return 0; } diff --git a/src/rng-wallace-omp/main.cpp b/src/rng-wallace-omp/main.cpp index d9fa9aa1e8..6e631969cc 100644 --- a/src/rng-wallace-omp/main.cpp +++ b/src/rng-wallace-omp/main.cpp @@ -87,5 +87,6 @@ int main(int argc, char* argv[]) { free(randomNumbers_ref); free(globalPool); free(Pool_ref); + if (!ok) return 1; return 0; } diff --git a/src/rng-wallace-sycl/main.cpp b/src/rng-wallace-sycl/main.cpp index 3daedee073..83498fdc0c 100644 --- a/src/rng-wallace-sycl/main.cpp +++ b/src/rng-wallace-sycl/main.cpp @@ -108,5 +108,6 @@ int main(int argc, char* argv[]) { sycl::free(d_rngChi2Corrections, q); sycl::free(d_randomNumbers, q); sycl::free(d_Pool, q); + if (!ok) return 1; return 0; } diff --git a/src/romberg-cuda/main.cu b/src/romberg-cuda/main.cu index 94335d3218..5872c54bf9 100644 --- a/src/romberg-cuda/main.cu +++ b/src/romberg-cuda/main.cu @@ -121,5 +121,6 @@ int main( int argc, char** argv) cudaFree(d_result); free(h_result); + if ((fabs(sum - ref_sum) > EPS)) return 1; return 0; } diff --git a/src/romberg-hip/main.cu b/src/romberg-hip/main.cu index d8d517f126..073548fc17 100644 --- a/src/romberg-hip/main.cu +++ b/src/romberg-hip/main.cu @@ -121,5 +121,6 @@ int main( int argc, char** argv) hipFree(d_result); free(h_result); + if ((fabs(sum - ref_sum) > EPS)) return 1; return 0; } diff --git a/src/romberg-omp/main.cpp b/src/romberg-omp/main.cpp index 5d2e729b95..f5d4f3fe7d 100644 --- a/src/romberg-omp/main.cpp +++ b/src/romberg-omp/main.cpp @@ -120,5 +120,6 @@ int main( int argc, char** argv) printf("%s\n", (fabs(d_sum - ref_sum) > EPS) ? "FAIL" : "PASS"); free(result); + if ((fabs(d_sum - ref_sum) > EPS)) return 1; return 0; } diff --git a/src/romberg-sycl/main.cpp b/src/romberg-sycl/main.cpp index 1ef31ca56a..8bde8b4f70 100644 --- a/src/romberg-sycl/main.cpp +++ b/src/romberg-sycl/main.cpp @@ -136,5 +136,6 @@ int main( int argc, char** argv) free(h_result); sycl::free(d_result, q); + if ((fabs(sum - ref_sum) > EPS)) return 1; return 0; } diff --git a/src/rotary-cuda/main.cu b/src/rotary-cuda/main.cu index 96ab69be96..f7921827cb 100644 --- a/src/rotary-cuda/main.cu +++ b/src/rotary-cuda/main.cu @@ -7,6 +7,7 @@ #include "Array.h" #include "FunctionTraits.h" +#include #ifndef GPU_LAMBDA #define GPU_LAMBDA __host__ __device__ @@ -309,6 +310,7 @@ void gpu_kernel_multiple_outputs_impl(const int repeat, const func_t& f) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); cudaFree(d_x1); cudaFree(d_x2); cudaFree(d_cos); diff --git a/src/rotary-hip/main.cu b/src/rotary-hip/main.cu index 7a579e7103..2172249733 100644 --- a/src/rotary-hip/main.cu +++ b/src/rotary-hip/main.cu @@ -8,6 +8,7 @@ #include "Array.h" #include "FunctionTraits.h" +#include #ifndef GPU_LAMBDA #define GPU_LAMBDA __host__ __device__ @@ -310,6 +311,7 @@ void gpu_kernel_multiple_outputs_impl(const int repeat, const func_t& f) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); hipFree(d_x1); hipFree(d_x2); hipFree(d_cos); diff --git a/src/rotary-sycl/main.cpp b/src/rotary-sycl/main.cpp index 933a8d3ba4..dc0407aaf5 100644 --- a/src/rotary-sycl/main.cpp +++ b/src/rotary-sycl/main.cpp @@ -7,6 +7,7 @@ #include "Array.h" #include "FunctionTraits.h" #include +#include constexpr int num_threads() { return C10_WARP_SIZE * 4; @@ -328,6 +329,7 @@ void gpu_kernel_multiple_outputs_impl(const int repeat, const func_t &f) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); sycl::free(d_x1, q); sycl::free(d_x2, q); sycl::free(d_cos, q); diff --git a/src/rsbench-cuda/Makefile b/src/rsbench-cuda/Makefile index ea1b01868a..f2b6a68cda 100644 --- a/src/rsbench-cuda/Makefile +++ b/src/rsbench-cuda/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = rsbench +program = main source = \ main.cu \ diff --git a/src/rsbench-hip/Makefile b/src/rsbench-hip/Makefile index cab3d68795..b82ae4eacc 100644 --- a/src/rsbench-hip/Makefile +++ b/src/rsbench-hip/Makefile @@ -12,7 +12,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = rsbench +program = main source = \ main.cu \ diff --git a/src/rsbench-hip/Makefile.hipcl b/src/rsbench-hip/Makefile.hipcl index 5ba701844d..b726f51bf6 100644 --- a/src/rsbench-hip/Makefile.hipcl +++ b/src/rsbench-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = rsbench +program = main source = \ main.cu \ diff --git a/src/rsbench-omp/Makefile b/src/rsbench-omp/Makefile index 1449a65aea..0f8530e8de 100644 --- a/src/rsbench-omp/Makefile +++ b/src/rsbench-omp/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = rsbench +program = main source = init.c io.c main.c material.c simulation.c utils.c diff --git a/src/rsbench-omp/Makefile.aomp b/src/rsbench-omp/Makefile.aomp index 34150aa6a8..b902a4f3a5 100644 --- a/src/rsbench-omp/Makefile.aomp +++ b/src/rsbench-omp/Makefile.aomp @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = rsbench +program = main source = init.c io.c main.c material.c simulation.c utils.c diff --git a/src/rsbench-omp/Makefile.nvc b/src/rsbench-omp/Makefile.nvc index 59449e2445..0085ff34d7 100644 --- a/src/rsbench-omp/Makefile.nvc +++ b/src/rsbench-omp/Makefile.nvc @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = rsbench +program = main source = init.c io.c main.c material.c simulation.c utils.c diff --git a/src/rtm8-cuda/Makefile b/src/rtm8-cuda/Makefile index 415a9b3e0b..59df4169c6 100644 --- a/src/rtm8-cuda/Makefile +++ b/src/rtm8-cuda/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = rtm8 +program = main source = rtm8.cu diff --git a/src/rtm8-cuda/rtm8.cu b/src/rtm8-cuda/rtm8.cu index 275e99b5a5..c7efb6ea77 100644 --- a/src/rtm8-cuda/rtm8.cu +++ b/src/rtm8-cuda/rtm8.cu @@ -259,5 +259,6 @@ int main(int argc, char *argv[]) { cudaFree(image_d); cudaFree(a_d); + if (!ok) return 1; return 0; } diff --git a/src/rtm8-hip/Makefile b/src/rtm8-hip/Makefile index ca5f81073a..08f8da52c9 100644 --- a/src/rtm8-hip/Makefile +++ b/src/rtm8-hip/Makefile @@ -12,7 +12,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = rtm8 +program = main source = rtm8.cu diff --git a/src/rtm8-hip/Makefile.hipcl b/src/rtm8-hip/Makefile.hipcl index 69d070f5e5..aa2fc5e516 100644 --- a/src/rtm8-hip/Makefile.hipcl +++ b/src/rtm8-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = rtm8 +program = main source = rtm8.cu diff --git a/src/rtm8-hip/rtm8.cu b/src/rtm8-hip/rtm8.cu index 10997239a0..b27c88a063 100644 --- a/src/rtm8-hip/rtm8.cu +++ b/src/rtm8-hip/rtm8.cu @@ -259,5 +259,6 @@ int main(int argc, char *argv[]) { hipFree(image_d); hipFree(a_d); + if (!ok) return 1; return 0; } diff --git a/src/rtm8-omp/Makefile b/src/rtm8-omp/Makefile index 32614ff34e..9934731d4e 100644 --- a/src/rtm8-omp/Makefile +++ b/src/rtm8-omp/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = rtm8 +program = main source = rtm8.cpp diff --git a/src/rtm8-omp/Makefile.aomp b/src/rtm8-omp/Makefile.aomp index 6ad653d9f7..1b2fc6a2ca 100644 --- a/src/rtm8-omp/Makefile.aomp +++ b/src/rtm8-omp/Makefile.aomp @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = rtm8 +program = main source = rtm8.cpp diff --git a/src/rtm8-omp/Makefile.nvc b/src/rtm8-omp/Makefile.nvc index 810050093b..2627cd4773 100644 --- a/src/rtm8-omp/Makefile.nvc +++ b/src/rtm8-omp/Makefile.nvc @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = rtm8 +program = main source = rtm8.cpp diff --git a/src/rtm8-omp/rtm8.cpp b/src/rtm8-omp/rtm8.cpp index f1f338fff4..3ec849efc7 100644 --- a/src/rtm8-omp/rtm8.cpp +++ b/src/rtm8-omp/rtm8.cpp @@ -205,5 +205,6 @@ int main(int argc, char *argv[]) { free(image_cpu); free(image_gpu); + if (!ok) return 1; return 0; } diff --git a/src/rtm8-sycl/rtm8.cpp b/src/rtm8-sycl/rtm8.cpp index ba854048c9..b296edb0d6 100644 --- a/src/rtm8-sycl/rtm8.cpp +++ b/src/rtm8-sycl/rtm8.cpp @@ -241,5 +241,6 @@ int main(int argc, char *argv[]) { sycl::free(image_d, q); sycl::free(a_d, q); + if (!ok) return 1; return 0; } diff --git a/src/s3d-hip/Makefile.hipcl b/src/s3d-hip/Makefile.hipcl index 717a1fbb33..fac7691241 100644 --- a/src/s3d-hip/Makefile.hipcl +++ b/src/s3d-hip/Makefile.hipcl @@ -12,7 +12,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = s3d +program = main source = main.cu Option.cu OptionParser.cu S3D.cu diff --git a/src/s8n-cuda/main.cu b/src/s8n-cuda/main.cu index d1d871e251..0ac32d1871 100644 --- a/src/s8n-cuda/main.cu +++ b/src/s8n-cuda/main.cu @@ -228,5 +228,6 @@ int main(int argc, char* argv[]) cudaFree(d_out); cudaFree(d_out2); cudaFree(d_out4); + if (error) return 1; return 0; } diff --git a/src/s8n-hip/main.cu b/src/s8n-hip/main.cu index bde4288645..42123e03eb 100644 --- a/src/s8n-hip/main.cu +++ b/src/s8n-hip/main.cu @@ -228,5 +228,6 @@ int main(int argc, char* argv[]) hipFree(d_out); hipFree(d_out2); hipFree(d_out4); + if (error) return 1; return 0; } diff --git a/src/s8n-omp/main.cpp b/src/s8n-omp/main.cpp index 417b5f99d3..4c0efb425a 100644 --- a/src/s8n-omp/main.cpp +++ b/src/s8n-omp/main.cpp @@ -222,5 +222,6 @@ int main(int argc, char* argv[]) free(r_out); free(r_out2); free(r_out4); + if (error) return 1; return 0; } diff --git a/src/s8n-sycl/main.cpp b/src/s8n-sycl/main.cpp index 558c1892ba..556ae90d41 100644 --- a/src/s8n-sycl/main.cpp +++ b/src/s8n-sycl/main.cpp @@ -247,5 +247,6 @@ int main(int argc, char* argv[]) sycl::free(d_out, q); sycl::free(d_out2, q); sycl::free(d_out4, q); + if (error) return 1; return 0; } diff --git a/src/scan-cuda/main.cu b/src/scan-cuda/main.cu index 8fa9954599..b0a773567e 100644 --- a/src/scan-cuda/main.cu +++ b/src/scan-cuda/main.cu @@ -248,5 +248,6 @@ int main(int argc, char* argv[]) run<1024>(n, repeat); run<2048>(n, repeat); + if (error) return 1; return 0; } diff --git a/src/scan-hip/main.cu b/src/scan-hip/main.cu index 38f99a287a..6238e8e91a 100644 --- a/src/scan-hip/main.cu +++ b/src/scan-hip/main.cu @@ -240,5 +240,6 @@ int main(int argc, char* argv[]) run<1024>(n, repeat); run<2048>(n, repeat); + if (error) return 1; return 0; } diff --git a/src/scan-omp/main.cpp b/src/scan-omp/main.cpp index 864acde3c4..d44c9f1bfa 100644 --- a/src/scan-omp/main.cpp +++ b/src/scan-omp/main.cpp @@ -17,6 +17,7 @@ void verify(const T* ref_out, const T* out, int64_t n) } } printf("%s\n", error ? "FAIL" : "PASS"); + if (error) exit(1); } // bank conflict aware optimization diff --git a/src/scan-sycl/main.cpp b/src/scan-sycl/main.cpp index 7d2a8f67ee..3c2ebfe62b 100644 --- a/src/scan-sycl/main.cpp +++ b/src/scan-sycl/main.cpp @@ -264,5 +264,6 @@ int main(int argc, char* argv[]) run<1024>(q, n, repeat); run<2048>(q, n, repeat); + if (error) return 1; return 0; } diff --git a/src/scan2-cuda/main.cu b/src/scan2-cuda/main.cu index 10d6c935e5..4f7373e0e0 100644 --- a/src/scan2-cuda/main.cu +++ b/src/scan2-cuda/main.cu @@ -17,6 +17,7 @@ #include #include #include "scan.h" +#include /* * ScanLargeArrays : Scan is done for each block and the sum of each @@ -352,5 +353,6 @@ int main(int argc, char * argv[]) free(input); free(output); free(verificationOutput); + if (!(compare(output, verificationOutput, length, (float)0.001))) return 1; return 0; } diff --git a/src/scan2-hip/main.cu b/src/scan2-hip/main.cu index 0f77897837..2ed1fe1afe 100644 --- a/src/scan2-hip/main.cu +++ b/src/scan2-hip/main.cu @@ -17,6 +17,7 @@ #include #include #include "scan.h" +#include /* * ScanLargeArrays : Scan is done for each block and the sum of each @@ -352,5 +353,6 @@ int main(int argc, char * argv[]) free(input); free(output); free(verificationOutput); + if (!(compare(output, verificationOutput, length, (float)0.001))) return 1; return 0; } diff --git a/src/scan2-omp/main.cpp b/src/scan2-omp/main.cpp index 103f1407c9..605fe1178b 100644 --- a/src/scan2-omp/main.cpp +++ b/src/scan2-omp/main.cpp @@ -17,6 +17,7 @@ #include #include #include "scan.h" +#include void bScan(const unsigned int blockSize, const unsigned int len, @@ -302,5 +303,6 @@ int main(int argc, char * argv[]) free(blockSumBufferSizeOffset); free(outputBuffer); free(outputBufferSizeOffset); + if (!(compare(outputBuffer, verificationOutput, length, (float)0.001))) return 1; return 0; } diff --git a/src/scan2-sycl/main.cpp b/src/scan2-sycl/main.cpp index 936c075c5c..05ab6aa48e 100644 --- a/src/scan2-sycl/main.cpp +++ b/src/scan2-sycl/main.cpp @@ -18,6 +18,7 @@ #include #include #include "scan.h" +#include void bScan(sycl::queue &q, const unsigned int blockSize, @@ -319,5 +320,6 @@ int main(int argc, char * argv[]) free(input); free(output); free(verificationOutput); + if (!(compare(output, verificationOutput, length, (float)0.001))) return 1; return 0; } diff --git a/src/scan3-cuda/main.cu b/src/scan3-cuda/main.cu index 760d5975cc..26b97852a8 100644 --- a/src/scan3-cuda/main.cu +++ b/src/scan3-cuda/main.cu @@ -4,6 +4,7 @@ #include #include #include "scan.h" +#include // Binary sum operator, returns `t + u` struct Sum @@ -148,5 +149,7 @@ int main(int argc, char * argv[]) free(input); free(output); free(verificationOutput); + if (!(compare(output, verificationOutput, length, (float)0.001))) return 1; + if (!(compare(output, verificationOutput, length, (float)0.001))) return 1; return 0; } diff --git a/src/scan3-hip/main.cu b/src/scan3-hip/main.cu index 172f174870..bd84b7d94e 100644 --- a/src/scan3-hip/main.cu +++ b/src/scan3-hip/main.cu @@ -4,6 +4,7 @@ #include #include #include "scan.h" +#include /* * Scan for verification @@ -138,5 +139,7 @@ int main(int argc, char * argv[]) free(input); free(output); free(verificationOutput); + if (!(compare(output, verificationOutput, length, (float)0.001))) return 1; + if (!(compare(output, verificationOutput, length, (float)0.001))) return 1; return 0; } diff --git a/src/scan3-sycl/main.cpp b/src/scan3-sycl/main.cpp index f3a0a619a5..d767339e6e 100644 --- a/src/scan3-sycl/main.cpp +++ b/src/scan3-sycl/main.cpp @@ -3,6 +3,7 @@ #include #include #include "scan.h" +#include /* * Scan for verification @@ -107,5 +108,6 @@ int main(int argc, char * argv[]) free(input); free(output); free(verificationOutput); + if (!(compare(output, verificationOutput, length, (float)0.001))) return 1; return 0; } diff --git a/src/scatter-cuda/main.cu b/src/scatter-cuda/main.cu index c4e2355002..1f49626f26 100644 --- a/src/scatter-cuda/main.cu +++ b/src/scatter-cuda/main.cu @@ -149,5 +149,6 @@ int main(int argc, char* argv[]) scatter(num_elements, repeat); scatter(num_elements, repeat); scatter(num_elements, repeat); + if (!ok) return 1; return 0; } diff --git a/src/scatter-hip/main.cu b/src/scatter-hip/main.cu index d65e36150c..6d4fbbb8a5 100644 --- a/src/scatter-hip/main.cu +++ b/src/scatter-hip/main.cu @@ -149,5 +149,6 @@ int main(int argc, char* argv[]) scatter(num_elements, repeat); scatter(num_elements, repeat); scatter(num_elements, repeat); + if (!ok) return 1; return 0; } diff --git a/src/scatter-sycl/main.cpp b/src/scatter-sycl/main.cpp index bbcb6ee792..5e73453ec6 100644 --- a/src/scatter-sycl/main.cpp +++ b/src/scatter-sycl/main.cpp @@ -149,5 +149,6 @@ int main(int argc, char* argv[]) scatter(q, num_elements, repeat); scatter(q, num_elements, repeat); scatter(q, num_elements, repeat); + if (!ok) return 1; return 0; } diff --git a/src/scatterAdd-cuda/main.cu b/src/scatterAdd-cuda/main.cu index e37d6e24d8..660710166c 100644 --- a/src/scatterAdd-cuda/main.cu +++ b/src/scatterAdd-cuda/main.cu @@ -174,5 +174,6 @@ int main(int argc, char* argv[]) printf("vector_dimension: %d\n", vector_dim); index_accumulate (batch_size, output_size, vector_dim, repeat) ; + if (!ok) return 1; return 0; } diff --git a/src/scatterAdd-hip/main.cu b/src/scatterAdd-hip/main.cu index 158e81afdf..eb13335976 100644 --- a/src/scatterAdd-hip/main.cu +++ b/src/scatterAdd-hip/main.cu @@ -177,5 +177,6 @@ int main(int argc, char* argv[]) printf("vector_dimension: %d\n", vector_dim); index_accumulate (batch_size, output_size, vector_dim, repeat) ; + if (!ok) return 1; return 0; } diff --git a/src/scatterAdd-omp/main.cpp b/src/scatterAdd-omp/main.cpp index c71086c70e..5514207c7e 100644 --- a/src/scatterAdd-omp/main.cpp +++ b/src/scatterAdd-omp/main.cpp @@ -145,5 +145,6 @@ int main(int argc, char* argv[]) printf("vector_dimension: %d\n", vector_dim); index_accumulate (batch_size, output_size, vector_dim, repeat) ; + if (!ok) return 1; return 0; } diff --git a/src/scatterAdd-sycl/main.cpp b/src/scatterAdd-sycl/main.cpp index a546131dd2..174046643f 100644 --- a/src/scatterAdd-sycl/main.cpp +++ b/src/scatterAdd-sycl/main.cpp @@ -172,5 +172,6 @@ int main(int argc, char* argv[]) printf("vector_dimension: %d\n", vector_dim); index_accumulate (batch_size, output_size, vector_dim, repeat) ; + if (!ok) return 1; return 0; } diff --git a/src/scatterThrust-cuda/main.cu b/src/scatterThrust-cuda/main.cu index 97829326e2..1792867658 100644 --- a/src/scatterThrust-cuda/main.cu +++ b/src/scatterThrust-cuda/main.cu @@ -94,5 +94,6 @@ int main(int argc, char* argv[]) scatter(num_elements, repeat); printf("FP64 scatter\n"); scatter(num_elements, repeat); + if (!ok) return 1; return 0; } diff --git a/src/scatterThrust-hip/main.cu b/src/scatterThrust-hip/main.cu index 37fbd49239..d5543c3fb2 100644 --- a/src/scatterThrust-hip/main.cu +++ b/src/scatterThrust-hip/main.cu @@ -94,5 +94,6 @@ int main(int argc, char* argv[]) scatter(num_elements, repeat); printf("FP64 scatter\n"); scatter(num_elements, repeat); + if (!ok) return 1; return 0; } diff --git a/src/scatterThrust-sycl/main.cpp b/src/scatterThrust-sycl/main.cpp index 8ce212d70a..b11a7305ff 100644 --- a/src/scatterThrust-sycl/main.cpp +++ b/src/scatterThrust-sycl/main.cpp @@ -105,5 +105,6 @@ int main(int argc, char* argv[]) scatter(q, num_elements, repeat); printf("FP64 scatter\n"); scatter(q, num_elements, repeat); + if (!ok) return 1; return 0; } diff --git a/src/scel-cuda/main.cu b/src/scel-cuda/main.cu index b274f9d902..4bcc6b5b12 100644 --- a/src/scel-cuda/main.cu +++ b/src/scel-cuda/main.cu @@ -131,5 +131,6 @@ int main(int argc, char* argv[]) free(h_out); free(r_out); + if (!ok) return 1; return 0; } diff --git a/src/scel-hip/main.cu b/src/scel-hip/main.cu index 4840cfbf76..2fd8a3e7b6 100644 --- a/src/scel-hip/main.cu +++ b/src/scel-hip/main.cu @@ -131,5 +131,6 @@ int main(int argc, char* argv[]) free(h_out); free(r_out); + if (!ok) return 1; return 0; } diff --git a/src/scel-omp/main.cpp b/src/scel-omp/main.cpp index a496417382..dbfad41809 100644 --- a/src/scel-omp/main.cpp +++ b/src/scel-omp/main.cpp @@ -117,5 +117,6 @@ int main(int argc, char* argv[]) free(h_out); free(r_out); + if (!ok) return 1; return 0; } diff --git a/src/scel-sycl/main.cpp b/src/scel-sycl/main.cpp index 4a96b095ea..f6011272d2 100644 --- a/src/scel-sycl/main.cpp +++ b/src/scel-sycl/main.cpp @@ -160,5 +160,6 @@ int main(int argc, char* argv[]) free(h_out); free(r_out); + if (!ok) return 1; return 0; } diff --git a/src/score-cuda/main.cu b/src/score-cuda/main.cu index 4729f11655..15f8c6b903 100644 --- a/src/score-cuda/main.cu +++ b/src/score-cuda/main.cu @@ -288,5 +288,6 @@ int main(int argc, char* argv[]) free(count_ref); free(scores); + if (checksum != 0) return 1; return 0; } diff --git a/src/score-hip/main.cu b/src/score-hip/main.cu index 327834b942..82f9f021a6 100644 --- a/src/score-hip/main.cu +++ b/src/score-hip/main.cu @@ -293,5 +293,6 @@ int main(int argc, char* argv[]) free(count_ref); free(scores); + if (checksum != 0) return 1; return 0; } diff --git a/src/score-sycl/main.cpp b/src/score-sycl/main.cpp index 347bb5c691..80f81cce2a 100644 --- a/src/score-sycl/main.cpp +++ b/src/score-sycl/main.cpp @@ -315,5 +315,6 @@ int main(int argc, char* argv[]) free(count_ref); free(scores); + if (checksum != 0) return 1; return 0; } diff --git a/src/secp256k1-cuda/main.cu b/src/secp256k1-cuda/main.cu index c8fd78d3a1..e6766c3473 100644 --- a/src/secp256k1-cuda/main.cu +++ b/src/secp256k1-cuda/main.cu @@ -2,6 +2,7 @@ #include #include #include +#include typedef struct { @@ -1259,6 +1260,7 @@ int main(int argc, char **argv) { printf("PASS\n"); else printf("FAIL\n"); + if (0 != strcmp(result, "bbde464b6355ee6de6deba5ae860f8a66524937eee81dde224a0214efd795d09")) exit(1); return 0; } diff --git a/src/secp256k1-hip/main.cu b/src/secp256k1-hip/main.cu index e4b043857e..3896a6116a 100644 --- a/src/secp256k1-hip/main.cu +++ b/src/secp256k1-hip/main.cu @@ -2,6 +2,7 @@ #include #include #include +#include typedef struct { @@ -1259,6 +1260,7 @@ int main(int argc, char **argv) { printf("PASS\n"); else printf("FAIL\n"); + if (0 != strcmp(result, "bbde464b6355ee6de6deba5ae860f8a66524937eee81dde224a0214efd795d09")) exit(1); return 0; } diff --git a/src/secp256k1-omp/main.cpp b/src/secp256k1-omp/main.cpp index b3144dcbc9..dd49f2e489 100644 --- a/src/secp256k1-omp/main.cpp +++ b/src/secp256k1-omp/main.cpp @@ -1237,5 +1237,6 @@ int main(int argc, char **argv) { printf("PASS\n"); else printf("FAIL\n"); + if (0 != strcmp(result, "bbde464b6355ee6de6deba5ae860f8a66524937eee81dde224a0214efd795d09")) exit(1); return 0; } diff --git a/src/secp256k1-sycl/main.cpp b/src/secp256k1-sycl/main.cpp index 451fc3e7cc..d65d96e526 100644 --- a/src/secp256k1-sycl/main.cpp +++ b/src/secp256k1-sycl/main.cpp @@ -2,6 +2,7 @@ #include #include #include +#include typedef struct { @@ -1253,5 +1254,6 @@ int main(int argc, char **argv) { printf("PASS\n"); else printf("FAIL\n"); + if (0 != strcmp(result, "bbde464b6355ee6de6deba5ae860f8a66524937eee81dde224a0214efd795d09")) exit(1); return 0; } diff --git a/src/sheath-hip/Makefile b/src/sheath-hip/Makefile index 7a2f9a542d..bddbe9fb4f 100644 --- a/src/sheath-hip/Makefile +++ b/src/sheath-hip/Makefile @@ -23,7 +23,7 @@ obj = $(source:.cu=.o) #=============================================================================== # Standard Flags -CFLAGS := $(EXTRA_CFLAGS) -std=c++17 -Wall -save-temps +CFLAGS := $(EXTRA_CFLAGS) -std=c++17 -Wall # Linker Flags LDFLAGS = diff --git a/src/shuffle-cuda/main.cu b/src/shuffle-cuda/main.cu index ef4556fcc3..6a92a25ffd 100644 --- a/src/shuffle-cuda/main.cu +++ b/src/shuffle-cuda/main.cu @@ -359,5 +359,7 @@ int main(int argc, char* argv[]) { free(TransposeMatrix); free(cpuTransposeMatrix); + if (errors != 0) return 1; + if (errors != 0) return 1; return 0; } diff --git a/src/shuffle-hip/main.cu b/src/shuffle-hip/main.cu index c496189846..bfe38321de 100644 --- a/src/shuffle-hip/main.cu +++ b/src/shuffle-hip/main.cu @@ -356,5 +356,7 @@ int main(int argc, char* argv[]) { free(TransposeMatrix); free(cpuTransposeMatrix); + if (errors != 0) return 1; + if (errors != 0) return 1; return 0; } diff --git a/src/shuffle-sycl/main.cpp b/src/shuffle-sycl/main.cpp index be6af6df6b..6f291e967c 100644 --- a/src/shuffle-sycl/main.cpp +++ b/src/shuffle-sycl/main.cpp @@ -380,5 +380,7 @@ int main(int argc, char* argv[]) { free(TransposeMatrix); free(cpuTransposeMatrix); + if (errors != 0) return 1; + if (errors != 0) return 1; return 0; } diff --git a/src/slit-cuda/main.cu b/src/slit-cuda/main.cu index eaae0252e2..925795d321 100644 --- a/src/slit-cuda/main.cu +++ b/src/slit-cuda/main.cu @@ -139,6 +139,7 @@ int main(int argc, char** argv){ free(outputData_ref); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/slit-hip/main.cu b/src/slit-hip/main.cu index 1775e361e0..d289d9ddc6 100644 --- a/src/slit-hip/main.cu +++ b/src/slit-hip/main.cu @@ -139,6 +139,7 @@ int main(int argc, char** argv){ free(outputData_ref); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/slit-sycl/main.cpp b/src/slit-sycl/main.cpp index 86d24e6611..fa0fbe3827 100644 --- a/src/slit-sycl/main.cpp +++ b/src/slit-sycl/main.cpp @@ -162,6 +162,7 @@ int main(int argc, char** argv){ free(outputData_ref); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/snake-cuda/main.cu b/src/snake-cuda/main.cu index 03493e7c38..eb6fdb288c 100644 --- a/src/snake-cuda/main.cu +++ b/src/snake-cuda/main.cu @@ -208,5 +208,6 @@ int main(int argc, const char * const argv[]) cudaFree(Dev_ReadSeq); cudaFree(Dev_RefSeq); cudaFree(Dev_Results); + if (error) return 1; return 0; } diff --git a/src/snake-hip/main.cu b/src/snake-hip/main.cu index 52a1506532..d8e9df3c7c 100644 --- a/src/snake-hip/main.cu +++ b/src/snake-hip/main.cu @@ -208,5 +208,6 @@ int main(int argc, const char * const argv[]) hipFree(Dev_ReadSeq); hipFree(Dev_RefSeq); hipFree(Dev_Results); + if (error) return 1; return 0; } diff --git a/src/snake-omp/main.cpp b/src/snake-omp/main.cpp index 0f8b31d3b4..9a8b888d22 100644 --- a/src/snake-omp/main.cpp +++ b/src/snake-omp/main.cpp @@ -217,5 +217,6 @@ int main(int argc, const char * const argv[]) free(RefSeq); free(DFinal_Results); free(HFinal_Results); + if (error) return 1; return 0; } diff --git a/src/snake-sycl/main.cpp b/src/snake-sycl/main.cpp index b848eb6427..5683a7e511 100644 --- a/src/snake-sycl/main.cpp +++ b/src/snake-sycl/main.cpp @@ -217,5 +217,6 @@ int main(int argc, const char * const argv[]) sycl::free(d_ReadSeq, q); sycl::free(d_RefSeq, q); sycl::free(d_Results, q); + if (error) return 1; return 0; } diff --git a/src/snicit-cuda/bin/Makefile b/src/snicit-cuda/bin/Makefile index dbd6eb7744..7f3ddb3ed2 100644 --- a/src/snicit-cuda/bin/Makefile +++ b/src/snicit-cuda/bin/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = beyond +program = main source = ../src/beyond.cu diff --git a/src/snicit-hip/bin/Makefile b/src/snicit-hip/bin/Makefile index 6d10f681a2..8fdba21d80 100644 --- a/src/snicit-hip/bin/Makefile +++ b/src/snicit-hip/bin/Makefile @@ -12,7 +12,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = beyond +program = main source = ../src/beyond.cu diff --git a/src/snicit-sycl/bin/Makefile b/src/snicit-sycl/bin/Makefile index b3c9d6f01b..98b2664df6 100644 --- a/src/snicit-sycl/bin/Makefile +++ b/src/snicit-sycl/bin/Makefile @@ -19,7 +19,7 @@ HIP_ARCH = gfx908 # Program name & source code list #=============================================================================== -program = beyond +program = main source = ../src/beyond.cpp diff --git a/src/sobel-cuda/main.cu b/src/sobel-cuda/main.cu index 5eb477e6f9..ccb49035fe 100644 --- a/src/sobel-cuda/main.cu +++ b/src/sobel-cuda/main.cu @@ -18,6 +18,7 @@ #include "sobel.h" #include "SDKBitMap.h" #include "kernels.cu" +#include static bool compare(const float *refData, const float *data, const int length, const float epsilon = 1e-6f) @@ -164,6 +165,7 @@ int main(int argc, char * argv[]) printf("PASS\n"); else printf("FAIL\n"); + if (!(compare(outputReference, outputDevice, imageSize))) exit(1); free(outputDevice); free(outputReference); diff --git a/src/sobel-hip/main.cu b/src/sobel-hip/main.cu index 5561d9c746..d8bb45ce5a 100644 --- a/src/sobel-hip/main.cu +++ b/src/sobel-hip/main.cu @@ -18,6 +18,7 @@ #include "sobel.h" #include "SDKBitMap.h" #include "kernels.cu" +#include static bool compare(const float *refData, const float *data, const int length, const float epsilon = 1e-6f) @@ -164,6 +165,7 @@ int main(int argc, char * argv[]) printf("PASS\n"); else printf("FAIL\n"); + if (!(compare(outputReference, outputDevice, imageSize))) exit(1); free(outputDevice); free(outputReference); diff --git a/src/sobel-omp/main.cpp b/src/sobel-omp/main.cpp index b55ede5f86..729c3b624f 100644 --- a/src/sobel-omp/main.cpp +++ b/src/sobel-omp/main.cpp @@ -18,6 +18,7 @@ #include #include "sobel.h" #include "kernels.cpp" +#include static bool compare(const float *refData, const float *data, @@ -175,6 +176,7 @@ int main(int argc, char * argv[]) printf("PASS\n"); else printf("FAIL\n"); + if (!(compare(outputReference, outputDevice, imageSize))) exit(1); free(outputDevice); free(outputReference); diff --git a/src/sobel-sycl/main.cpp b/src/sobel-sycl/main.cpp index a9bbcae530..9eaa51d6e8 100644 --- a/src/sobel-sycl/main.cpp +++ b/src/sobel-sycl/main.cpp @@ -24,6 +24,7 @@ using float4 = sycl::float4; #include "SDKBitMap.h" #include "kernels.cpp" +#include void reference (uchar4 *verificationOutput, const uchar4 *inputImageData, @@ -185,6 +186,7 @@ int main(int argc, char * argv[]) printf("PASS\n"); else printf("FAIL\n"); + if (!(compare(outputReference, outputDevice, imageSize))) exit(1); free(outputDevice); free(outputReference); diff --git a/src/sobol-cuda/Makefile b/src/sobol-cuda/Makefile index a1a23f773c..b1e8190b94 100644 --- a/src/sobol-cuda/Makefile +++ b/src/sobol-cuda/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = SobolQRNG +program = main source = sobol.cu sobol_gold.cu sobol_gpu.cu sobol_primitives.cu diff --git a/src/sobol-cuda/sobol.cu b/src/sobol-cuda/sobol.cu index 1ac12122c2..76c35e5b24 100644 --- a/src/sobol-cuda/sobol.cu +++ b/src/sobol-cuda/sobol.cu @@ -37,6 +37,7 @@ #include "sobol.h" #include "sobol_gold.h" #include "sobol_gpu.h" +#include #define L1ERROR_TOLERANCE (1e-6) @@ -184,6 +185,7 @@ int main(int argc, char *argv[]) std::cout << "PASS" << std::endl; else std::cout << "FAIL" << std::endl; + if (l1error >= L1ERROR_TOLERANCE) exit(1); return 0; } diff --git a/src/sobol-hip/Makefile b/src/sobol-hip/Makefile index 8308dbbbd2..a3ef4b86c7 100644 --- a/src/sobol-hip/Makefile +++ b/src/sobol-hip/Makefile @@ -12,7 +12,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = SobolQRNG +program = main source = sobol.cu sobol_gold.cu sobol_gpu.cu sobol_primitives.cu diff --git a/src/sobol-hip/Makefile.hipcl b/src/sobol-hip/Makefile.hipcl index 6038ac1e8b..67b4b1e96a 100644 --- a/src/sobol-hip/Makefile.hipcl +++ b/src/sobol-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = SobolQRNG +program = main source = sobol.cu sobol_gold.cu sobol_gpu.cu sobol_primitives.cu diff --git a/src/sobol-hip/sobol.cu b/src/sobol-hip/sobol.cu index 62e2e5c2c0..98dbf893f7 100644 --- a/src/sobol-hip/sobol.cu +++ b/src/sobol-hip/sobol.cu @@ -37,6 +37,7 @@ #include "sobol.h" #include "sobol_gold.h" #include "sobol_gpu.h" +#include #define L1ERROR_TOLERANCE (1e-6) @@ -184,6 +185,7 @@ int main(int argc, char *argv[]) std::cout << "PASS" << std::endl; else std::cout << "FAIL" << std::endl; + if (l1error >= L1ERROR_TOLERANCE) exit(1); return 0; } diff --git a/src/sobol-omp/Makefile b/src/sobol-omp/Makefile index 0292225f3d..70f9c151ff 100644 --- a/src/sobol-omp/Makefile +++ b/src/sobol-omp/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = SobolQRNG +program = main source = sobol.cpp sobol_gold.cpp sobol_gpu.cpp sobol_primitives.cpp diff --git a/src/sobol-omp/Makefile.aomp b/src/sobol-omp/Makefile.aomp index 92da4bc308..1e1558bfed 100644 --- a/src/sobol-omp/Makefile.aomp +++ b/src/sobol-omp/Makefile.aomp @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = SobolQRNG +program = main source = sobol.cpp sobol_gold.cpp sobol_gpu.cpp sobol_primitives.cpp diff --git a/src/sobol-omp/Makefile.nvc b/src/sobol-omp/Makefile.nvc index 5e1df8f347..4ae1214647 100644 --- a/src/sobol-omp/Makefile.nvc +++ b/src/sobol-omp/Makefile.nvc @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = SobolQRNG +program = main source = sobol.cpp sobol_gold.cpp sobol_gpu.cpp sobol_primitives.cpp diff --git a/src/sobol-omp/sobol.cpp b/src/sobol-omp/sobol.cpp index 877d533cef..c1252eccca 100644 --- a/src/sobol-omp/sobol.cpp +++ b/src/sobol-omp/sobol.cpp @@ -37,6 +37,7 @@ #include "sobol.h" #include "sobol_gold.h" #include "sobol_gpu.h" +#include #define L1ERROR_TOLERANCE (1e-6) @@ -171,6 +172,7 @@ int main(int argc, char *argv[]) std::cout << "PASS" << std::endl; else std::cout << "FAIL" << std::endl; + if (l1error >= L1ERROR_TOLERANCE) exit(1); return 0; } diff --git a/src/sobol-sycl/sobol.cpp b/src/sobol-sycl/sobol.cpp index 3d47393cf5..2600b19975 100644 --- a/src/sobol-sycl/sobol.cpp +++ b/src/sobol-sycl/sobol.cpp @@ -37,6 +37,7 @@ #include "sobol.h" #include "sobol_gold.h" #include "sobol_gpu.h" +#include #define L1ERROR_TOLERANCE (1e-6) @@ -186,6 +187,7 @@ int main(int argc, char *argv[]) std::cout << "PASS" << std::endl; else std::cout << "FAIL" << std::endl; + if (l1error >= L1ERROR_TOLERANCE) exit(1); return 0; } diff --git a/src/softmax-cuda/main.cu b/src/softmax-cuda/main.cu index 5bb28c61d0..3d23df9425 100644 --- a/src/softmax-cuda/main.cu +++ b/src/softmax-cuda/main.cu @@ -150,5 +150,6 @@ int main(int argc, char* argv[]) { free(output_gpu); cudaFree(d_input); cudaFree(d_output); + if (!ok) return 1; return 0; } diff --git a/src/softmax-fused-cuda/main.cu b/src/softmax-fused-cuda/main.cu index 3771391a89..4f31419477 100644 --- a/src/softmax-fused-cuda/main.cu +++ b/src/softmax-fused-cuda/main.cu @@ -366,5 +366,6 @@ int main(int argc, char *argv[]) { fused_softmax(batches, attn_heads, query_seq_len, key_seq_len, 0, repeat); fused_softmax(batches, attn_heads, query_seq_len, key_seq_len, 1, repeat); + if (!ok) return 1; return 0; } diff --git a/src/softmax-fused-hip/main.cu b/src/softmax-fused-hip/main.cu index 256e40fa30..e48164da5d 100644 --- a/src/softmax-fused-hip/main.cu +++ b/src/softmax-fused-hip/main.cu @@ -366,5 +366,6 @@ int main(int argc, char *argv[]) { fused_softmax(batches, attn_heads, query_seq_len, key_seq_len, 0, repeat); fused_softmax(batches, attn_heads, query_seq_len, key_seq_len, 1, repeat); + if (!ok) return 1; return 0; } diff --git a/src/softmax-fused-sycl/main.cpp b/src/softmax-fused-sycl/main.cpp index 18d54d7978..b376fe2238 100644 --- a/src/softmax-fused-sycl/main.cpp +++ b/src/softmax-fused-sycl/main.cpp @@ -381,5 +381,6 @@ int main(int argc, char *argv[]) { fused_softmax(batches, attn_heads, query_seq_len, key_seq_len, 0, repeat); fused_softmax(batches, attn_heads, query_seq_len, key_seq_len, 1, repeat); + if (!ok) return 1; return 0; } diff --git a/src/softmax-hip/main.cu b/src/softmax-hip/main.cu index 67b0969c3d..89f6bfdeb0 100644 --- a/src/softmax-hip/main.cu +++ b/src/softmax-hip/main.cu @@ -161,5 +161,6 @@ int main(int argc, char* argv[]) { free(output_gpu); hipFree(d_input); hipFree(d_output); + if (!ok) return 1; return 0; } diff --git a/src/softmax-omp/main.cpp b/src/softmax-omp/main.cpp index 6c813ab25f..889b665f24 100644 --- a/src/softmax-omp/main.cpp +++ b/src/softmax-omp/main.cpp @@ -85,5 +85,6 @@ int main(int argc, char* argv[]) { free(input); free(output_cpu); free(output_gpu); + if (!ok) return 1; return 0; } diff --git a/src/softmax-sycl/main.cpp b/src/softmax-sycl/main.cpp index 7d866d440b..92bd01cd39 100644 --- a/src/softmax-sycl/main.cpp +++ b/src/softmax-sycl/main.cpp @@ -153,5 +153,6 @@ int main(int argc, char* argv[]) { free(output_gpu); sycl::free(d_input, q); sycl::free(d_output, q); + if (!ok) return 1; return 0; } diff --git a/src/sort-cuda/main.cu b/src/sort-cuda/main.cu index f72b53554b..dd304a1946 100644 --- a/src/sort-cuda/main.cu +++ b/src/sort-cuda/main.cu @@ -154,5 +154,6 @@ int main(int argc, char** argv) free(h_idata); free(h_odata); + if (!passed) return 1; return 0; } diff --git a/src/sort-hip/main.cu b/src/sort-hip/main.cu index 7be3eb634a..f85ad3e3b2 100644 --- a/src/sort-hip/main.cu +++ b/src/sort-hip/main.cu @@ -154,5 +154,6 @@ int main(int argc, char** argv) free(h_idata); free(h_odata); + if (!passed) return 1; return 0; } diff --git a/src/sort-omp/main.cpp b/src/sort-omp/main.cpp index 9a6a0bec33..1ef45f5db7 100644 --- a/src/sort-omp/main.cpp +++ b/src/sort-omp/main.cpp @@ -167,5 +167,6 @@ int main(int argc, char** argv) free(idata); free(isums); free(odata); + if (!passed) return 1; return 0; } diff --git a/src/sort-sycl/main.cpp b/src/sort-sycl/main.cpp index c42bc8ce2f..60d42aea1c 100644 --- a/src/sort-sycl/main.cpp +++ b/src/sort-sycl/main.cpp @@ -181,5 +181,6 @@ int main(int argc, char** argv) free(h_idata); free(h_odata); + if (!passed) return 1; return 0; } diff --git a/src/sortKV-cuda/main.cu b/src/sortKV-cuda/main.cu index 91e4a5b077..1ebcc809e6 100644 --- a/src/sortKV-cuda/main.cu +++ b/src/sortKV-cuda/main.cu @@ -8,6 +8,7 @@ #include #include #include +#include template void sort_key_value (int n, int repeat, bool verify) { @@ -55,6 +56,7 @@ void sort_key_value (int n, int repeat, bool verify) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } } diff --git a/src/sortKV-hip/main.cu b/src/sortKV-hip/main.cu index 91e4a5b077..1ebcc809e6 100644 --- a/src/sortKV-hip/main.cu +++ b/src/sortKV-hip/main.cu @@ -8,6 +8,7 @@ #include #include #include +#include template void sort_key_value (int n, int repeat, bool verify) { @@ -55,6 +56,7 @@ void sort_key_value (int n, int repeat, bool verify) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } } diff --git a/src/sortKV-sycl/main.cpp b/src/sortKV-sycl/main.cpp index cdbd9deb6d..d947a808cf 100644 --- a/src/sortKV-sycl/main.cpp +++ b/src/sortKV-sycl/main.cpp @@ -8,6 +8,7 @@ #include // iota #include #include +#include template void sort_key_value (sycl::queue &q, int n, int repeat, bool verify) { @@ -50,6 +51,7 @@ void sort_key_value (sycl::queue &q, int n, int repeat, bool verify) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } } diff --git a/src/sosfil-cuda/main.cu b/src/sosfil-cuda/main.cu index 4db21c407b..761e16c4c3 100644 --- a/src/sosfil-cuda/main.cu +++ b/src/sosfil-cuda/main.cu @@ -280,5 +280,6 @@ int main(int argc, char** argv) printf("Double-precision second-order-section filtering of digital signals\n"); filtering (repeat, numSignals, numSamples, numSections, zi_width); + if (!ok) return 1; return 0; } diff --git a/src/sosfil-hip/main.cu b/src/sosfil-hip/main.cu index eb3044c62e..3d3749e91c 100644 --- a/src/sosfil-hip/main.cu +++ b/src/sosfil-hip/main.cu @@ -280,5 +280,6 @@ int main(int argc, char** argv) printf("Double-precision second-order-section filtering of digital signals\n"); filtering (repeat, numSignals, numSamples, numSections, zi_width); + if (!ok) return 1; return 0; } diff --git a/src/sosfil-omp/main.cpp b/src/sosfil-omp/main.cpp index b6ef400ab9..366953a0d3 100644 --- a/src/sosfil-omp/main.cpp +++ b/src/sosfil-omp/main.cpp @@ -266,5 +266,6 @@ int main(int argc, char** argv) printf("Double-precision second-order-section filtering of digital signals\n"); filtering(repeat, numSignals, numSamples, numSections, zi_width); + if (!ok) return 1; return 0; } diff --git a/src/sosfil-sycl/main.cpp b/src/sosfil-sycl/main.cpp index 2b00a7421d..6e822153ea 100644 --- a/src/sosfil-sycl/main.cpp +++ b/src/sosfil-sycl/main.cpp @@ -267,5 +267,6 @@ int main(int argc, char** argv) printf("Double-precision second-order-section filtering of digital signals\n"); filtering (q, repeat, numSignals, numSamples, numSections, zi_width); + if (!ok) return 1; return 0; } diff --git a/src/sph-cuda/Makefile b/src/sph-cuda/Makefile index 683d361bcd..043b20f589 100644 --- a/src/sph-cuda/Makefile +++ b/src/sph-cuda/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = sph +program = main build: $(program) diff --git a/src/sph-hip/Makefile b/src/sph-hip/Makefile index a1135fb5a2..0870d38738 100644 --- a/src/sph-hip/Makefile +++ b/src/sph-hip/Makefile @@ -12,7 +12,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = sph +program = main build: $(program) diff --git a/src/sph-hip/Makefile.hipcl b/src/sph-hip/Makefile.hipcl index feb31f0849..ace52763b6 100644 --- a/src/sph-hip/Makefile.hipcl +++ b/src/sph-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = sph +program = main build: $(program) diff --git a/src/sph-omp/Makefile b/src/sph-omp/Makefile index 0e2d10b258..1535d15c17 100644 --- a/src/sph-omp/Makefile +++ b/src/sph-omp/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = sph +program = main build: $(program) diff --git a/src/sph-omp/Makefile.aomp b/src/sph-omp/Makefile.aomp index b89d4ab242..5609775fa6 100644 --- a/src/sph-omp/Makefile.aomp +++ b/src/sph-omp/Makefile.aomp @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = sph +program = main build: $(program) diff --git a/src/sph-omp/Makefile.nvc b/src/sph-omp/Makefile.nvc index 1846308a8f..be1915efae 100644 --- a/src/sph-omp/Makefile.nvc +++ b/src/sph-omp/Makefile.nvc @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = sph +program = main build: $(program) diff --git a/src/split-cuda/main.cu b/src/split-cuda/main.cu index bca2617a8d..42984d81c2 100644 --- a/src/split-cuda/main.cu +++ b/src/split-cuda/main.cu @@ -208,5 +208,6 @@ int main(int argc, char* argv[]) free(keys); free(out); + if (!check) return 1; return 0; } diff --git a/src/split-hip/main.cu b/src/split-hip/main.cu index b7dfcd0393..10caa75c84 100644 --- a/src/split-hip/main.cu +++ b/src/split-hip/main.cu @@ -208,5 +208,6 @@ int main(int argc, char* argv[]) free(keys); free(out); + if (!check) return 1; return 0; } diff --git a/src/split-omp/main.cpp b/src/split-omp/main.cpp index 6de51e7a44..7878c5511d 100644 --- a/src/split-omp/main.cpp +++ b/src/split-omp/main.cpp @@ -194,5 +194,6 @@ int main(int argc, char** argv) { free(keys); free(out); + if (!check) return 1; return 0; } diff --git a/src/split-sycl/main.cpp b/src/split-sycl/main.cpp index f30bc47ba9..18fafd36ef 100644 --- a/src/split-sycl/main.cpp +++ b/src/split-sycl/main.cpp @@ -219,5 +219,6 @@ int main(int argc, char** argv) { free(keys); free(out); + if (!check) return 1; return 0; } diff --git a/src/sptrsv-cuda/sptrsv_syncfree.cu b/src/sptrsv-cuda/sptrsv_syncfree.cu index 88e8a6a359..6345bb5ec0 100644 --- a/src/sptrsv-cuda/sptrsv_syncfree.cu +++ b/src/sptrsv-cuda/sptrsv_syncfree.cu @@ -4,6 +4,7 @@ #include #include #include "sptrsv.h" +#include // reference // https://stackoverflow.com/questions/32341081/how-to-have-atomic-load-in-cuda @@ -236,6 +237,7 @@ int sptrsv_syncfree ( cudaFree(d_b); cudaFree(d_x); cudaFree(d_warp_num); + if (!(res < accuracy)) return 1; return 0; } diff --git a/src/sptrsv-hip/sptrsv_syncfree.cu b/src/sptrsv-hip/sptrsv_syncfree.cu index 56391344d1..4be2b9f85d 100644 --- a/src/sptrsv-hip/sptrsv_syncfree.cu +++ b/src/sptrsv-hip/sptrsv_syncfree.cu @@ -4,6 +4,7 @@ #include #include #include "sptrsv.h" +#include // reference // https://stackoverflow.com/questions/32341081/how-to-have-atomic-load-in-cuda @@ -236,6 +237,7 @@ int sptrsv_syncfree ( hipFree(d_b); hipFree(d_x); hipFree(d_warp_num); + if (!(res < accuracy)) return 1; return 0; } diff --git a/src/sptrsv-omp/sptrsv_syncfree.cpp b/src/sptrsv-omp/sptrsv_syncfree.cpp index aa163b638f..ec7377533f 100644 --- a/src/sptrsv-omp/sptrsv_syncfree.cpp +++ b/src/sptrsv-omp/sptrsv_syncfree.cpp @@ -4,6 +4,7 @@ #include #include #include "sptrsv.h" +#include #pragma omp declare target int atomicLoad(const int *addr) @@ -208,6 +209,7 @@ int sptrsv_syncfree ( free(get_value); free(warp_num); + if (!(res < accuracy)) return 1; return 0; } diff --git a/src/sptrsv-sycl/sptrsv_syncfree.cpp b/src/sptrsv-sycl/sptrsv_syncfree.cpp index db7ad15462..159ff416c5 100644 --- a/src/sptrsv-sycl/sptrsv_syncfree.cpp +++ b/src/sptrsv-sycl/sptrsv_syncfree.cpp @@ -4,6 +4,7 @@ #include #include #include "sptrsv.h" +#include int atomicLoad(const int *addr) { @@ -222,6 +223,7 @@ int sptrsv_syncfree ( sycl::free(d_x, q); sycl::free(d_warp_num, q); + if (!(res < accuracy)) return 1; return 0; } diff --git a/src/srad-cuda/Makefile b/src/srad-cuda/Makefile index 6606fb2db6..f97857de4b 100644 --- a/src/srad-cuda/Makefile +++ b/src/srad-cuda/Makefile @@ -12,7 +12,7 @@ LAUNCHER = #=============================================================================== # Program name & source code list #=============================================================================== -program = srad +program = main source = main.cu diff --git a/src/srad-hip/Makefile b/src/srad-hip/Makefile index 16ece74c74..3dc4951174 100644 --- a/src/srad-hip/Makefile +++ b/src/srad-hip/Makefile @@ -11,7 +11,7 @@ LAUNCHER = #=============================================================================== # Program name & source code list #=============================================================================== -program = srad +program = main source = main.cu @@ -53,7 +53,7 @@ $(program): $(obj) Makefile # delete all object files clean: - rm -f *.o srad *pgm + rm -f *.o $(program) *pgm run: $(program) $(LAUNCHER) ./$(program) 1000 0.5 502 458 diff --git a/src/srad-hip/Makefile.hipcl b/src/srad-hip/Makefile.hipcl index 5aebf8d884..8bce7178c5 100644 --- a/src/srad-hip/Makefile.hipcl +++ b/src/srad-hip/Makefile.hipcl @@ -10,7 +10,7 @@ DEBUG = no #=============================================================================== # Program name & source code list #=============================================================================== -program = srad +program = main source = main.cu diff --git a/src/srad-omp/Makefile b/src/srad-omp/Makefile index 6dcc4a61eb..d3b070c07e 100644 --- a/src/srad-omp/Makefile +++ b/src/srad-omp/Makefile @@ -28,7 +28,7 @@ ifeq ($(OPTIMIZE),yes) endif -./srad: ./main.o \ +./main: ./main.o \ ./util/graphics/graphics.o \ ./util/graphics/resize.o \ ./util/timer/timer.o @@ -37,7 +37,7 @@ endif ./util/graphics/resize.o \ ./util/timer/timer.o \ -lm \ - $(LDFLAGS) -o srad + $(LDFLAGS) -o main ./main.o: ./main.c ./main.h $(CC) $(CFLAGS) $(KERNEL_DIM) ./main.c \ @@ -67,7 +67,7 @@ endif -O3 clean: - rm -f ./*.o srad *.pgm ./util/graphics/*.o ./util/timer/*.o + rm -f ./*.o main *.pgm ./util/graphics/*.o ./util/timer/*.o -run: srad - $(LAUNCHER) ./srad 1000 0.5 502 458 +run: main + $(LAUNCHER) ./main 1000 0.5 502 458 diff --git a/src/srad-omp/Makefile.aomp b/src/srad-omp/Makefile.aomp index a8708ed9eb..5b37d13d94 100644 --- a/src/srad-omp/Makefile.aomp +++ b/src/srad-omp/Makefile.aomp @@ -32,7 +32,7 @@ ifeq ($(OPTIMIZE),yes) endif -./srad: ./main.o \ +./main: ./main.o \ ./util/graphics/graphics.o \ ./util/graphics/resize.o \ ./util/timer/timer.o @@ -41,7 +41,7 @@ endif ./util/graphics/resize.o \ ./util/timer/timer.o \ -lm \ - $(LDFLAGS) -o srad + $(LDFLAGS) -o main ./main.o: ./main.c ./main.h $(CC) $(CFLAGS) $(KERNEL_DIM) ./main.c \ @@ -71,7 +71,7 @@ endif -O3 clean: - rm -f ./*.o srad *.pgm ./util/graphics/*.o ./util/timer/*.o + rm -f ./*.o main *.pgm ./util/graphics/*.o ./util/timer/*.o -run: srad - $(LAUNCHER) ./srad 1000 0.5 502 458 +run: main + $(LAUNCHER) ./main 1000 0.5 502 458 diff --git a/src/srad-omp/Makefile.nvc b/src/srad-omp/Makefile.nvc index 95df6e6169..610c2ef6c7 100644 --- a/src/srad-omp/Makefile.nvc +++ b/src/srad-omp/Makefile.nvc @@ -27,7 +27,7 @@ ifeq ($(OPTIMIZE),yes) CFLAGS += -O3 endif -./srad: ./main.o \ +./main: ./main.o \ ./util/graphics/graphics.o \ ./util/graphics/resize.o \ ./util/timer/timer.o @@ -36,7 +36,7 @@ endif ./util/graphics/resize.o \ ./util/timer/timer.o \ -lm \ - $(LDFLAGS) -o srad + $(LDFLAGS) -o main ./main.o: ./main.c ./main.h $(CC) $(CFLAGS) $(KERNEL_DIM) ./main.c \ @@ -66,7 +66,7 @@ endif -O3 clean: - rm -f ./*.o srad *.pgm ./util/graphics/*.o ./util/timer/*.o + rm -f ./*.o main *.pgm ./util/graphics/*.o ./util/timer/*.o -run: srad - $(LAUNCHER) ./srad 1000 0.5 502 458 +run: main + $(LAUNCHER) ./main 1000 0.5 502 458 diff --git a/src/srad-sycl/Makefile b/src/srad-sycl/Makefile index 9e67016abf..dfcab79987 100644 --- a/src/srad-sycl/Makefile +++ b/src/srad-sycl/Makefile @@ -64,7 +64,7 @@ endif # Targets to Build #=============================================================================== -./srad: ./main.o \ +./main: ./main.o \ ./util/graphics/graphics.o \ ./util/graphics/resize.o \ ./util/timer/timer.o @@ -73,7 +73,7 @@ endif ./util/graphics/resize.o \ ./util/timer/timer.o \ -lm \ - $(LDFLAGS) -o srad + $(LDFLAGS) -o main ./main.o:./main.cpp ./main.h \ kernel_compress.sycl \ @@ -106,7 +106,7 @@ endif -O3 clean: - rm -f ./*.o srad *.pgm ./util/graphics/*.o ./util/timer/*.o + rm -f ./*.o main *.pgm ./util/graphics/*.o ./util/timer/*.o -run: srad - $(LAUNCHER) ./srad 1000 0.5 502 458 +run: main + $(LAUNCHER) ./main 1000 0.5 502 458 diff --git a/src/sssp-cuda/main.cu b/src/sssp-cuda/main.cu index 1820b7dd83..a5145a1bd1 100644 --- a/src/sssp-cuda/main.cu +++ b/src/sssp-cuda/main.cu @@ -41,6 +41,7 @@ #include "support/common.h" #include "support/timer.h" #include "support/verify.h" +#include // Params @@ -621,5 +622,6 @@ int main(int argc, char **argv) { timer.print("Host/Device Deallocation", 1); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/sssp-hip/main.cu b/src/sssp-hip/main.cu index 3a6b3a50e9..7d0e17ee37 100644 --- a/src/sssp-hip/main.cu +++ b/src/sssp-hip/main.cu @@ -41,6 +41,7 @@ #include "support/common.h" #include "support/timer.h" #include "support/verify.h" +#include // Params @@ -622,5 +623,6 @@ int main(int argc, char **argv) { timer.print("Host/Device Deallocation", 1); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/sssp-sycl/main.cpp b/src/sssp-sycl/main.cpp index af05ecfec6..dfe39a33d7 100644 --- a/src/sssp-sycl/main.cpp +++ b/src/sssp-sycl/main.cpp @@ -41,6 +41,7 @@ #include "support/common.h" #include "support/timer.h" #include "support/verify.h" +#include // Params struct Params { @@ -625,5 +626,6 @@ int main(int argc, char **argv) { timer.print("Host/Device Deallocation", 1); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/stddev-cuda/main.cu b/src/stddev-cuda/main.cu index 5ae9191005..e9529248d2 100644 --- a/src/stddev-cuda/main.cu +++ b/src/stddev-cuda/main.cu @@ -158,5 +158,6 @@ int main(int argc, char* argv[]) { free(data); cudaFree(d_std); cudaFree(d_data); + if (!ok) return 1; return 0; } diff --git a/src/stddev-hip/main.cu b/src/stddev-hip/main.cu index 99f50d178e..98aab0dfe2 100644 --- a/src/stddev-hip/main.cu +++ b/src/stddev-hip/main.cu @@ -158,5 +158,6 @@ int main(int argc, char* argv[]) { free(data); hipFree(d_std); hipFree(d_data); + if (!ok) return 1; return 0; } diff --git a/src/stddev-omp/main.cpp b/src/stddev-omp/main.cpp index 73939f0299..6c6bb6d870 100644 --- a/src/stddev-omp/main.cpp +++ b/src/stddev-omp/main.cpp @@ -152,5 +152,6 @@ int main(int argc, char* argv[]) { free(std_ref); free(std); free(data); + if (!ok) return 1; return 0; } diff --git a/src/stddev-sycl/main.cpp b/src/stddev-sycl/main.cpp index 0be2cfb321..eb276bdffd 100644 --- a/src/stddev-sycl/main.cpp +++ b/src/stddev-sycl/main.cpp @@ -190,6 +190,7 @@ int main(int argc, char* argv[]) { free(data); sycl::free(d_std, q); sycl::free(d_data, q); + if (!ok) return 1; return 0; } diff --git a/src/stencil1d-cuda/Makefile b/src/stencil1d-cuda/Makefile index 889d462675..39be462afd 100644 --- a/src/stencil1d-cuda/Makefile +++ b/src/stencil1d-cuda/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = stencil_1d +program = main source = stencil_1d.cu diff --git a/src/stencil1d-cuda/stencil_1d.cu b/src/stencil1d-cuda/stencil_1d.cu index 06a00dbd67..69932f7156 100644 --- a/src/stencil1d-cuda/stencil_1d.cu +++ b/src/stencil1d-cuda/stencil_1d.cu @@ -117,5 +117,6 @@ int main(int argc, char* argv[]) { free(b); cudaFree(d_a); cudaFree(d_b); + if (!ok) return 1; return 0; } diff --git a/src/stencil1d-hip/Makefile b/src/stencil1d-hip/Makefile index 84a2fb1795..e456e261b4 100644 --- a/src/stencil1d-hip/Makefile +++ b/src/stencil1d-hip/Makefile @@ -12,7 +12,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = stencil_1d +program = main source = stencil_1d.cu diff --git a/src/stencil1d-hip/Makefile.hipcl b/src/stencil1d-hip/Makefile.hipcl index 6ca1243379..c531214a8a 100644 --- a/src/stencil1d-hip/Makefile.hipcl +++ b/src/stencil1d-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = stencil_1d +program = main source = stencil_1d.cu diff --git a/src/stencil1d-hip/stencil_1d.cu b/src/stencil1d-hip/stencil_1d.cu index 2dd4f10dee..1e3f783a0f 100644 --- a/src/stencil1d-hip/stencil_1d.cu +++ b/src/stencil1d-hip/stencil_1d.cu @@ -117,5 +117,6 @@ int main(int argc, char* argv[]) { free(b); hipFree(d_a); hipFree(d_b); + if (!ok) return 1; return 0; } diff --git a/src/stencil1d-omp/Makefile b/src/stencil1d-omp/Makefile index 5504cfe649..19e9a7786f 100644 --- a/src/stencil1d-omp/Makefile +++ b/src/stencil1d-omp/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = stencil_1d +program = main source = stencil_1d.cpp diff --git a/src/stencil1d-omp/Makefile.aomp b/src/stencil1d-omp/Makefile.aomp index 3cd5f967b5..f60d4b151e 100644 --- a/src/stencil1d-omp/Makefile.aomp +++ b/src/stencil1d-omp/Makefile.aomp @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = stencil_1d +program = main source = stencil_1d.cpp diff --git a/src/stencil1d-omp/Makefile.nvc b/src/stencil1d-omp/Makefile.nvc index 9d2a75f017..4cb9b6bdb3 100644 --- a/src/stencil1d-omp/Makefile.nvc +++ b/src/stencil1d-omp/Makefile.nvc @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = stencil_1d +program = main source = stencil_1d.cpp diff --git a/src/stencil1d-omp/stencil_1d.cpp b/src/stencil1d-omp/stencil_1d.cpp index 46affbf339..1be598a07b 100644 --- a/src/stencil1d-omp/stencil_1d.cpp +++ b/src/stencil1d-omp/stencil_1d.cpp @@ -89,5 +89,6 @@ int main(int argc, char* argv[]) { // Cleanup free(a); free(b); + if (!ok) return 1; return 0; } diff --git a/src/stencil1d-sycl/stencil_1d.cpp b/src/stencil1d-sycl/stencil_1d.cpp index 6b19689e83..3619c35666 100644 --- a/src/stencil1d-sycl/stencil_1d.cpp +++ b/src/stencil1d-sycl/stencil_1d.cpp @@ -120,5 +120,6 @@ int main(int argc, char* argv[]) { free(b); sycl::free(d_in, q); sycl::free(d_out, q); + if (!ok) return 1; return 0; } diff --git a/src/storeKVCache-cuda/main.cu b/src/storeKVCache-cuda/main.cu index c274641e58..c8dd725a9e 100644 --- a/src/storeKVCache-cuda/main.cu +++ b/src/storeKVCache-cuda/main.cu @@ -7,6 +7,7 @@ #include #include #include "kernels.h" +#include #define GPU_CHECK(call) \ { \ @@ -188,6 +189,7 @@ void store_kv_cache(int32_t repeat) (memcmp(r_v_cache, h_v_cache, elem_size * kvc_size) == 0); #endif printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); GPU_CHECK(cudaFree(k)); GPU_CHECK(cudaFree(v)); diff --git a/src/storeKVCache-hip/main.cu b/src/storeKVCache-hip/main.cu index 6779d2c61e..9fdf82fc6b 100644 --- a/src/storeKVCache-hip/main.cu +++ b/src/storeKVCache-hip/main.cu @@ -7,6 +7,7 @@ #include #include #include "kernels.h" +#include #define GPU_CHECK(call) \ { \ @@ -191,6 +192,7 @@ void store_kv_cache(int32_t repeat) (memcmp(r_v_cache, h_v_cache, elem_size * kvc_size) == 0); #endif printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); GPU_CHECK(hipFree(k)); GPU_CHECK(hipFree(v)); diff --git a/src/storeKVCache-omp/main.cpp b/src/storeKVCache-omp/main.cpp index 00ce54b596..b33b7c0e79 100644 --- a/src/storeKVCache-omp/main.cpp +++ b/src/storeKVCache-omp/main.cpp @@ -6,6 +6,7 @@ #include #include #include +#include template void store_kv_cache(int32_t repeat) @@ -127,6 +128,7 @@ void store_kv_cache(int32_t repeat) (memcmp(r_v_cache, h_v_cache, elem_size * kvc_size) == 0); #endif printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); free(h_k); free(h_v); diff --git a/src/storeKVCache-sycl/main.cpp b/src/storeKVCache-sycl/main.cpp index f1aa78dea5..f2a29bbbed 100644 --- a/src/storeKVCache-sycl/main.cpp +++ b/src/storeKVCache-sycl/main.cpp @@ -7,6 +7,7 @@ #include #include #include "kernels.h" +#include template void store_kv_cache(sycl::queue &q, int32_t repeat) try { uint32_t num_layers = 8; // H @@ -194,6 +195,7 @@ template void store_kv_cache(sycl::queue &q, int32_t repeat) try { (memcmp(r_v_cache, h_v_cache, elem_size * kvc_size) == 0); #endif printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); sycl::free(k, q); sycl::free(v, q); diff --git a/src/streamUM-cuda/reference.h b/src/streamUM-cuda/reference.h index faab1058c3..9e96e3a26c 100644 --- a/src/streamUM-cuda/reference.h +++ b/src/streamUM-cuda/reference.h @@ -45,4 +45,5 @@ void check(std::vector > &TaskList) { } } printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); } diff --git a/src/streamcluster-cuda/Makefile b/src/streamcluster-cuda/Makefile index 784eae6d6c..c4c8c8c9a6 100644 --- a/src/streamcluster-cuda/Makefile +++ b/src/streamcluster-cuda/Makefile @@ -27,7 +27,7 @@ ifeq ($(OPTIMIZE),yes) endif SRC = streamcluster.cu -EXE = streamcluster +EXE = main $(EXE):$(SRC) kernel.h streamcluster.h streamcluster_cl.h $(CC) $(CFLAGS) $(SRC) -o $(EXE) $(LDFLAGS) diff --git a/src/streamcluster-hip/Makefile b/src/streamcluster-hip/Makefile index 296a1346b5..b4e3d26c83 100644 --- a/src/streamcluster-hip/Makefile +++ b/src/streamcluster-hip/Makefile @@ -26,10 +26,10 @@ ifeq ($(OPTIMIZE),yes) endif SRC = streamcluster.cu -EXE = streamcluster +EXE = main $(EXE):$(SRC) kernel.h streamcluster.h streamcluster_cl.h - $(CC) $(CFLAGS) $(SRC) -o $(EXE) $(LDFLAGS) + $(CC) $(CFLAGS) $(SRC) -o $(EXE) $(LDFLAGS) run: $(EXE) $(LAUNCHER) ./$(EXE) 10 20 256 65536 65536 1000 none output.txt 1 diff --git a/src/streamcluster-omp/Makefile b/src/streamcluster-omp/Makefile index 682679bf97..3d84de6311 100644 --- a/src/streamcluster-omp/Makefile +++ b/src/streamcluster-omp/Makefile @@ -33,7 +33,7 @@ else endif SRC = streamcluster.cpp -EXE = streamcluster +EXE = main $(EXE):$(SRC) kernel.h streamcluster.h streamcluster_cl.h $(CC) $(CFLAGS) $(SRC) -o $(EXE) $(LDFLAGS) diff --git a/src/surfel-cuda/main.cu b/src/surfel-cuda/main.cu index 8d024649c5..8394419908 100644 --- a/src/surfel-cuda/main.cu +++ b/src/surfel-cuda/main.cu @@ -235,5 +235,6 @@ int main(int argc, char *argv[]) { printf("-------------------------------------\n"); surfelRenderTest(n, w, h, repeat); + if (!ok) return 1; return 0; } diff --git a/src/surfel-hip/main.cu b/src/surfel-hip/main.cu index b38ae42841..7924ff4c9d 100644 --- a/src/surfel-hip/main.cu +++ b/src/surfel-hip/main.cu @@ -235,5 +235,6 @@ int main(int argc, char *argv[]) { printf("-------------------------------------\n"); surfelRenderTest(n, w, h, repeat); + if (!ok) return 1; return 0; } diff --git a/src/surfel-omp/main.cpp b/src/surfel-omp/main.cpp index 1451c878b2..46d5d25cc9 100644 --- a/src/surfel-omp/main.cpp +++ b/src/surfel-omp/main.cpp @@ -136,5 +136,6 @@ int main(int argc, char *argv[]) { printf("-------------------------------------\n"); surfelRenderTest(n, w, h, repeat); + if (!ok) return 1; return 0; } diff --git a/src/surfel-sycl/main.cpp b/src/surfel-sycl/main.cpp index f8a4997118..715523a4d9 100644 --- a/src/surfel-sycl/main.cpp +++ b/src/surfel-sycl/main.cpp @@ -258,5 +258,6 @@ int main(int argc, char *argv[]) { printf("-------------------------------------\n"); surfelRenderTest(q, n, w, h, repeat); + if (!ok) return 1; return 0; } diff --git a/src/svd3x3-cuda/main.cu b/src/svd3x3-cuda/main.cu index 2ab0d699e4..ccee5e7d81 100644 --- a/src/svd3x3-cuda/main.cu +++ b/src/svd3x3-cuda/main.cu @@ -117,5 +117,6 @@ int main(int argc, char* argv[]) free(input); free(result); free(result_h); + if (!ok) return 1; return 0; } diff --git a/src/svd3x3-hip/main.cu b/src/svd3x3-hip/main.cu index 5752c2a8f3..96a3a3f098 100644 --- a/src/svd3x3-hip/main.cu +++ b/src/svd3x3-hip/main.cu @@ -117,5 +117,6 @@ int main(int argc, char* argv[]) free(input); free(result); free(result_h); + if (!ok) return 1; return 0; } diff --git a/src/svd3x3-omp/main.cpp b/src/svd3x3-omp/main.cpp index 40525a4a2e..57c750c70d 100644 --- a/src/svd3x3-omp/main.cpp +++ b/src/svd3x3-omp/main.cpp @@ -116,5 +116,6 @@ int main(int argc, char* argv[]) free(input); free(result); free(result_h); + if (!ok) return 1; return 0; } diff --git a/src/svd3x3-sycl/main.cpp b/src/svd3x3-sycl/main.cpp index c29259fdda..7aeaa27fd4 100644 --- a/src/svd3x3-sycl/main.cpp +++ b/src/svd3x3-sycl/main.cpp @@ -125,5 +125,6 @@ int main(int argc, char* argv[]) free(input); free(result); free(result_h); + if (!ok) return 1; return 0; } diff --git a/src/tensorAccessor-cuda/main.cu b/src/tensorAccessor-cuda/main.cu index 63cf2dcc91..a2bdbcce82 100644 --- a/src/tensorAccessor-cuda/main.cu +++ b/src/tensorAccessor-cuda/main.cu @@ -155,5 +155,6 @@ int main(int argc, char* argv[]) free(r); free(r_ref); + if (!ok) return 1; return 0; } diff --git a/src/tensorAccessor-hip/main.cu b/src/tensorAccessor-hip/main.cu index a6d701cced..966359f0d6 100644 --- a/src/tensorAccessor-hip/main.cu +++ b/src/tensorAccessor-hip/main.cu @@ -155,5 +155,6 @@ int main(int argc, char* argv[]) free(r); free(r_ref); + if (!ok) return 1; return 0; } diff --git a/src/tensorAccessor-sycl/main.cpp b/src/tensorAccessor-sycl/main.cpp index 009e5bc7fa..75da5dced0 100644 --- a/src/tensorAccessor-sycl/main.cpp +++ b/src/tensorAccessor-sycl/main.cpp @@ -177,5 +177,6 @@ int main(int argc, char* argv[]) free(r); free(r_ref); + if (!ok) return 1; return 0; } diff --git a/src/tensorT-cuda/main.cu b/src/tensorT-cuda/main.cu index 7230446547..5db545e8e7 100644 --- a/src/tensorT-cuda/main.cu +++ b/src/tensorT-cuda/main.cu @@ -171,5 +171,6 @@ int main(int argc, char **argv) { delete [] input; delete [] output; + if (error) return 1; return 0; } diff --git a/src/tensorT-hip/main.cu b/src/tensorT-hip/main.cu index 2215f83cb4..933fffdfc5 100644 --- a/src/tensorT-hip/main.cu +++ b/src/tensorT-hip/main.cu @@ -171,5 +171,6 @@ int main(int argc, char **argv) { delete [] input; delete [] output; + if (error) return 1; return 0; } diff --git a/src/tensorT-omp/main.cpp b/src/tensorT-omp/main.cpp index b6e99d00a7..0bd38f05b6 100644 --- a/src/tensorT-omp/main.cpp +++ b/src/tensorT-omp/main.cpp @@ -112,5 +112,6 @@ int main(int argc, char **argv) { verify(input, output); delete [] input; delete [] output; + if (error) return 1; return 0; } diff --git a/src/tensorT-sycl/main.cpp b/src/tensorT-sycl/main.cpp index 497b1ce89c..7f83523e4a 100644 --- a/src/tensorT-sycl/main.cpp +++ b/src/tensorT-sycl/main.cpp @@ -147,5 +147,6 @@ int main(int argc, char **argv) { verify(input, output); delete [] input; delete [] output; + if (error) return 1; return 0; } diff --git a/src/threadcpy-cuda/main.cu b/src/threadcpy-cuda/main.cu index 07e92a417a..8a5b95f59f 100644 --- a/src/threadcpy-cuda/main.cu +++ b/src/threadcpy-cuda/main.cu @@ -2,6 +2,7 @@ #include #include #include +#include #define GPU_CHECK(x) do { \ cudaError_t err = x; \ @@ -125,5 +126,6 @@ int main(int argc, char* argv[]) test_threads_copy<8, char>(numel * 4, repeat); std::cout << "char16: "; test_threads_copy<16, char>(numel * 4, repeat); + if (s) return 1; return 0; } diff --git a/src/threadcpy-hip/main.cu b/src/threadcpy-hip/main.cu index 250ad1f79b..d30af5d445 100644 --- a/src/threadcpy-hip/main.cu +++ b/src/threadcpy-hip/main.cu @@ -2,6 +2,7 @@ #include #include #include +#include #define GPU_CHECK(x) do { \ hipError_t err = x; \ @@ -125,5 +126,6 @@ int main(int argc, char* argv[]) test_threads_copy<8, char>(numel * 4, repeat); std::cout << "char16: "; test_threads_copy<16, char>(numel * 4, repeat); + if (s) return 1; return 0; } diff --git a/src/threadcpy-omp/main.cpp b/src/threadcpy-omp/main.cpp index d6404c085a..2655056c7f 100644 --- a/src/threadcpy-omp/main.cpp +++ b/src/threadcpy-omp/main.cpp @@ -2,6 +2,7 @@ #include #include #include +#include template struct alignas(sizeof(T) * VEC_SIZE) data_t { @@ -135,5 +136,6 @@ int main(int argc, char* argv[]) test_threads_copy<8, char>(numel * 4, repeat); std::cout << "char16: "; test_threads_copy<16, char>(numel * 4, repeat); + if (s) return 1; return 0; } diff --git a/src/threadcpy-sycl/main.cpp b/src/threadcpy-sycl/main.cpp index c5284db221..6b2794c50d 100644 --- a/src/threadcpy-sycl/main.cpp +++ b/src/threadcpy-sycl/main.cpp @@ -2,6 +2,7 @@ #include #include #include +#include template struct alignas(sizeof(T) * VEC_SIZE) data_t { @@ -137,5 +138,6 @@ int main(int argc, char* argv[]) test_threads_copy<8, char>(q, numel * 4, repeat); std::cout << "char16: "; test_threads_copy<16, char>(q, numel * 4, repeat); + if (s) return 1; return 0; } diff --git a/src/threadfence-cuda/main.cu b/src/threadfence-cuda/main.cu index 6699684169..5bb249eda2 100644 --- a/src/threadfence-cuda/main.cu +++ b/src/threadfence-cuda/main.cu @@ -135,5 +135,6 @@ int main(int argc, char** argv) { cudaFree(d_count); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/threadfence-hip/main.cu b/src/threadfence-hip/main.cu index 844c6f3d35..f252326019 100644 --- a/src/threadfence-hip/main.cu +++ b/src/threadfence-hip/main.cu @@ -134,5 +134,6 @@ int main(int argc, char** argv) { hipFree(d_count); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/threadfence-omp/main.cpp b/src/threadfence-omp/main.cpp index 929d0a9856..cd54cbb32c 100644 --- a/src/threadfence-omp/main.cpp +++ b/src/threadfence-omp/main.cpp @@ -142,5 +142,6 @@ int main(int argc, char** argv) { free(h_result); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/threadfence-sycl/main.cpp b/src/threadfence-sycl/main.cpp index 9f3cede4a9..9272b4da76 100644 --- a/src/threadfence-sycl/main.cpp +++ b/src/threadfence-sycl/main.cpp @@ -160,5 +160,6 @@ int main(int argc, char** argv) { sycl::free(d_count, q); printf("%s\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/tissue-cuda/main.cu b/src/tissue-cuda/main.cu index 1ebb1617cb..fa7982fe7f 100644 --- a/src/tissue-cuda/main.cu +++ b/src/tissue-cuda/main.cu @@ -195,5 +195,6 @@ int main(int argc, char** argv) { cudaFree(d_ctprev); cudaFree(d_qt); + if (!ok) return 1; return 0; } diff --git a/src/tissue-hip/main.cu b/src/tissue-hip/main.cu index bea193ebab..a648d60f58 100644 --- a/src/tissue-hip/main.cu +++ b/src/tissue-hip/main.cu @@ -195,5 +195,6 @@ int main(int argc, char** argv) { hipFree(d_ctprev); hipFree(d_qt); + if (!ok) return 1; return 0; } diff --git a/src/tissue-omp/main.cpp b/src/tissue-omp/main.cpp index b24dfaaf90..7df97b3c1a 100644 --- a/src/tissue-omp/main.cpp +++ b/src/tissue-omp/main.cpp @@ -147,5 +147,6 @@ int main(int argc, char** argv) { free(h_ctprev); free(h_qt); + if (!ok) return 1; return 0; } diff --git a/src/tissue-sycl/main.cpp b/src/tissue-sycl/main.cpp index ef93dcaf6a..f8238411d0 100644 --- a/src/tissue-sycl/main.cpp +++ b/src/tissue-sycl/main.cpp @@ -203,5 +203,6 @@ int main(int argc, char** argv) { sycl::free(d_ctprev, q); sycl::free(d_qt, q); + if (!ok) return 1; return 0; } diff --git a/src/topk-cuda/main.cu b/src/topk-cuda/main.cu index 9e233a5d18..4600a8fbfb 100644 --- a/src/topk-cuda/main.cu +++ b/src/topk-cuda/main.cu @@ -5,6 +5,7 @@ #include #include #include "topk_per_row_kernels.h" +#include __device__ __forceinline__ uint32_t xorshift32(uint32_t& state) { state ^= state << 13; @@ -146,5 +147,6 @@ int32_t main(int32_t argc, char* argv[]) } } + if (!ok) return 1; return 0; } diff --git a/src/topk-hip/main.cu b/src/topk-hip/main.cu index 9b76148d00..7db1ab1d33 100644 --- a/src/topk-hip/main.cu +++ b/src/topk-hip/main.cu @@ -5,6 +5,7 @@ #include #include #include "topk_per_row_kernels.h" +#include __device__ __forceinline__ uint32_t xorshift32(uint32_t& state) { state ^= state << 13; @@ -145,5 +146,6 @@ int32_t main(int32_t argc, char* argv[]) } } + if (!ok) return 1; return 0; } diff --git a/src/topk-sycl/main.cpp b/src/topk-sycl/main.cpp index e5692693bb..b68c7baf95 100644 --- a/src/topk-sycl/main.cpp +++ b/src/topk-sycl/main.cpp @@ -4,6 +4,7 @@ #include #include #include "topk_per_row_kernels.h" +#include inline uint32_t xorshift32(uint32_t &state) { state ^= state << 13; @@ -156,6 +157,7 @@ int32_t main(int32_t argc, char *argv[]) try { } } + if (!ok) return 1; return 0; } catch (sycl::exception const &exc) { diff --git a/src/triad-cuda/triad.cu b/src/triad-cuda/triad.cu index f6d681bf1f..81c9919d9f 100644 --- a/src/triad-cuda/triad.cu +++ b/src/triad-cuda/triad.cu @@ -5,6 +5,7 @@ #include "OptionParser.h" #include "Timer.h" #include "Utility.h" +#include // **************************************************************************** // Function: addBenchmarkSpecOptions @@ -255,6 +256,7 @@ void RunBenchmark(OptionParser &op) cout << "PASS\n"; else cout << "FAIL\n"; + if (!ok) exit(1); // Zero out the test host memory for (int j=0; j // **************************************************************************** // Function: addBenchmarkSpecOptions @@ -252,6 +253,7 @@ void RunBenchmark(OptionParser &op) cout << "PASS\n"; else cout << "FAIL\n"; + if (!ok) exit(1); // Zero out the test host memory for (int j=0; j // **************************************************************************** // Function: addBenchmarkSpecOptions @@ -221,6 +222,7 @@ void RunBenchmark(OptionParser &op) std::cout << "PASS\n"; else std::cout << "FAIL\n"; + if (!ok) exit(1); // Zero out the test host memory for (int j=0; j #include "kernels.h" #include "reference.h" +#include template void init_p(T *p_real, T *p_imag, int width, int height) { @@ -134,5 +135,6 @@ int main(int argc, char** argv) { printf("TSA in float64\n"); tsa(width, height, repeat); + if (!ok) return 1; return 0; } diff --git a/src/tsa-hip/main.cu b/src/tsa-hip/main.cu index 57e6b26999..397f6d4c5a 100644 --- a/src/tsa-hip/main.cu +++ b/src/tsa-hip/main.cu @@ -7,6 +7,7 @@ #include #include "kernels.h" #include "reference.h" +#include template void init_p(T *p_real, T *p_imag, int width, int height) { @@ -135,5 +136,6 @@ int main(int argc, char** argv) { printf("TSA in float64\n"); tsa(width, height, repeat); + if (!ok) return 1; return 0; } diff --git a/src/tsa-omp/main.cpp b/src/tsa-omp/main.cpp index 370754746a..0c5c64369e 100644 --- a/src/tsa-omp/main.cpp +++ b/src/tsa-omp/main.cpp @@ -6,6 +6,7 @@ #include #include "kernels.h" #include "reference.h" +#include template static void init_p(T *p_real, T *p_imag, int width, int height) { @@ -133,5 +134,6 @@ int main(int argc, char** argv) { printf("TSA in float64\n"); tsa(width, height, repeat); + if (!ok) return 1; return 0; } diff --git a/src/tsa-sycl/main.cpp b/src/tsa-sycl/main.cpp index 538fed9e8b..c0eb70ef3f 100644 --- a/src/tsa-sycl/main.cpp +++ b/src/tsa-sycl/main.cpp @@ -6,6 +6,7 @@ #include #include "kernels.h" #include "reference.h" +#include template void init_p(T *p_real, T *p_imag, int width, int height) { @@ -158,5 +159,6 @@ int main(int argc, char** argv) { printf("TSA in float64\n"); tsa(q, width, height, repeat); + if (!ok) return 1; return 0; } diff --git a/src/tsp-cuda/main.cu b/src/tsp-cuda/main.cu index bbe3a72cb2..f62275c8c2 100644 --- a/src/tsp-cuda/main.cu +++ b/src/tsp-cuda/main.cu @@ -380,5 +380,6 @@ int main(int argc, char *argv[]) cudaFree(posy_d); free(posx); free(posy); + if (best < 38000 && best < 35002) return 1; return 0; } diff --git a/src/tsp-hip/main.cu b/src/tsp-hip/main.cu index 1ea3925515..1e96cbe994 100644 --- a/src/tsp-hip/main.cu +++ b/src/tsp-hip/main.cu @@ -380,5 +380,6 @@ int main(int argc, char *argv[]) hipFree(posy_d); free(posx); free(posy); + if (best < 38000 && best < 35002) return 1; return 0; } diff --git a/src/tsp-omp/main.cpp b/src/tsp-omp/main.cpp index c90140be86..d4deafcf5a 100644 --- a/src/tsp-omp/main.cpp +++ b/src/tsp-omp/main.cpp @@ -380,5 +380,6 @@ int main(int argc, char *argv[]) free(posx); free(posy); free(glob); + if (best[0] < 38000 && best[0] < 35002) return 1; return 0; } diff --git a/src/tsp-sycl/main.cpp b/src/tsp-sycl/main.cpp index fabca8e6d7..e9c2ec7df9 100644 --- a/src/tsp-sycl/main.cpp +++ b/src/tsp-sycl/main.cpp @@ -400,5 +400,6 @@ int main(int argc, char *argv[]) sycl::free(posx_d, q); free(posx); free(posy); + if (best < 38000 && best < 35002) return 1; return 0; } diff --git a/src/unfold-cuda/main.cu b/src/unfold-cuda/main.cu index 4e17b5e20f..346316688b 100644 --- a/src/unfold-cuda/main.cu +++ b/src/unfold-cuda/main.cu @@ -148,5 +148,6 @@ int main(int argc, char* argv[]) free(h_grad_in); free(h_grad_out); + if (!ok) return 1; return 0; } diff --git a/src/unfold-hip/main.cu b/src/unfold-hip/main.cu index 2517e93ade..77de58c0c1 100644 --- a/src/unfold-hip/main.cu +++ b/src/unfold-hip/main.cu @@ -148,5 +148,6 @@ int main(int argc, char* argv[]) free(h_grad_in); free(h_grad_out); + if (!ok) return 1; return 0; } diff --git a/src/unfold-sycl/main.cpp b/src/unfold-sycl/main.cpp index 12c8392bd7..018491594a 100644 --- a/src/unfold-sycl/main.cpp +++ b/src/unfold-sycl/main.cpp @@ -162,5 +162,6 @@ int main(int argc, char* argv[]) free(h_grad_in); free(h_grad_out); + if (!ok) return 1; return 0; } diff --git a/src/urng-cuda/main.cu b/src/urng-cuda/main.cu index 2029a0fd5b..859a605575 100644 --- a/src/urng-cuda/main.cu +++ b/src/urng-cuda/main.cu @@ -129,6 +129,7 @@ int main(int argc, char** argv) else { std::cout << "FAIL\n" << std::endl; + exit(1); } #ifdef DUMP diff --git a/src/urng-hip/main.cu b/src/urng-hip/main.cu index b954abe7eb..0531c04430 100644 --- a/src/urng-hip/main.cu +++ b/src/urng-hip/main.cu @@ -129,6 +129,7 @@ int main(int argc, char** argv) else { std::cout << "FAIL\n" << std::endl; + exit(1); } #ifdef DUMP diff --git a/src/urng-omp/main.cpp b/src/urng-omp/main.cpp index 54a3f3d6f8..ba34ccbbfe 100644 --- a/src/urng-omp/main.cpp +++ b/src/urng-omp/main.cpp @@ -141,6 +141,7 @@ int main(int argc, char** argv) else { std::cout << "FAIL" << std::endl; + exit(1); } #ifdef DUMP diff --git a/src/urng-sycl/main.cpp b/src/urng-sycl/main.cpp index 9cc0150fb6..e8fd39e8f3 100644 --- a/src/urng-sycl/main.cpp +++ b/src/urng-sycl/main.cpp @@ -144,6 +144,7 @@ int main(int argc, char** argv) else { std::cout << "FAIL" << std::endl; + exit(1); } #ifdef DUMP diff --git a/src/vanGenuchten-cuda/main.cu b/src/vanGenuchten-cuda/main.cu index f40a91d555..d832667587 100644 --- a/src/vanGenuchten-cuda/main.cu +++ b/src/vanGenuchten-cuda/main.cu @@ -140,5 +140,6 @@ int main(int argc, char* argv[]) delete[] theta_ref; delete[] K_ref; + if (!ok) return 1; return 0; } diff --git a/src/vanGenuchten-hip/main.cu b/src/vanGenuchten-hip/main.cu index 4fc0acb219..fa297430ca 100644 --- a/src/vanGenuchten-hip/main.cu +++ b/src/vanGenuchten-hip/main.cu @@ -140,5 +140,6 @@ int main(int argc, char* argv[]) delete[] theta_ref; delete[] K_ref; + if (!ok) return 1; return 0; } diff --git a/src/vanGenuchten-omp/main.cpp b/src/vanGenuchten-omp/main.cpp index 210389d38b..b00df531fb 100644 --- a/src/vanGenuchten-omp/main.cpp +++ b/src/vanGenuchten-omp/main.cpp @@ -116,5 +116,6 @@ int main(int argc, char* argv[]) delete[] theta_ref; delete[] K_ref; + if (!ok) return 1; return 0; } diff --git a/src/vanGenuchten-sycl/main.cpp b/src/vanGenuchten-sycl/main.cpp index 7be51f2c9f..6862b87134 100644 --- a/src/vanGenuchten-sycl/main.cpp +++ b/src/vanGenuchten-sycl/main.cpp @@ -156,5 +156,6 @@ int main(int argc, char* argv[]) delete[] theta_ref; delete[] K_ref; + if (!ok) return 1; return 0; } diff --git a/src/vol2col-cuda/main.cu b/src/vol2col-cuda/main.cu index 571ea50c02..8609831b36 100644 --- a/src/vol2col-cuda/main.cu +++ b/src/vol2col-cuda/main.cu @@ -327,5 +327,7 @@ int main(int argc, char* argv[]) dilation_t, dilation_h, dilation_w); } + if (error) return 1; + if (error) return 1; return 0; } diff --git a/src/vol2col-hip/main.cu b/src/vol2col-hip/main.cu index 1d4f50d7b4..1df39053a6 100644 --- a/src/vol2col-hip/main.cu +++ b/src/vol2col-hip/main.cu @@ -327,5 +327,7 @@ int main(int argc, char* argv[]) dilation_t, dilation_h, dilation_w); } + if (error) return 1; + if (error) return 1; return 0; } diff --git a/src/vol2col-omp/main.cpp b/src/vol2col-omp/main.cpp index c897d48ca2..546ecbafd5 100644 --- a/src/vol2col-omp/main.cpp +++ b/src/vol2col-omp/main.cpp @@ -306,5 +306,7 @@ int main(int argc, char* argv[]) dilation_t, dilation_h, dilation_w); } + if (error) return 1; + if (error) return 1; return 0; } diff --git a/src/vol2col-sycl/main.cpp b/src/vol2col-sycl/main.cpp index 13004f65aa..4a286a0dd4 100644 --- a/src/vol2col-sycl/main.cpp +++ b/src/vol2col-sycl/main.cpp @@ -352,5 +352,7 @@ int main(int argc, char* argv[]) dilation_t, dilation_h, dilation_w); } + if (error) return 1; + if (error) return 1; return 0; } diff --git a/src/warpexchange-cuda/main.cu b/src/warpexchange-cuda/main.cu index 0f0aa5781e..97756cea37 100644 --- a/src/warpexchange-cuda/main.cu +++ b/src/warpexchange-cuda/main.cu @@ -131,5 +131,6 @@ int main(int argc, char* argv[]) cudaFree(d_out); free(A); free(out); + if (!ok) return 1; return 0; } diff --git a/src/warpexchange-hip/main.cu b/src/warpexchange-hip/main.cu index 3656e92a71..e1b3825e28 100644 --- a/src/warpexchange-hip/main.cu +++ b/src/warpexchange-hip/main.cu @@ -131,5 +131,6 @@ int main(int argc, char* argv[]) hipFree(d_out); free(A); free(out); + if (!ok) return 1; return 0; } diff --git a/src/warpexchange-sycl/main.cpp b/src/warpexchange-sycl/main.cpp index fcb171ca7f..42978bdd0a 100644 --- a/src/warpexchange-sycl/main.cpp +++ b/src/warpexchange-sycl/main.cpp @@ -152,5 +152,6 @@ int main(int argc, char* argv[]) sycl::free(d_out, q); free(A); free(out); + if (!ok) return 1; return 0; } diff --git a/src/warpsort-cuda/main.cpp b/src/warpsort-cuda/main.cpp index 23e365c501..8f0624130a 100644 --- a/src/warpsort-cuda/main.cpp +++ b/src/warpsort-cuda/main.cpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace facebook { namespace cuda { @@ -180,12 +181,15 @@ int main(int argc, char** argv) { bool ok; ok = test_sort(repeat); printf("test_sort: %s\n\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); ok = test_sortInRegisters(repeat); printf("test_sortInRegisters: %s\n\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); ok = test_sortIndicesInRegisters(repeat); printf("test_sortIndicesInRegisters: %s\n\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/warpsort-hip/main.cpp b/src/warpsort-hip/main.cpp index 23e365c501..8f0624130a 100644 --- a/src/warpsort-hip/main.cpp +++ b/src/warpsort-hip/main.cpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace facebook { namespace cuda { @@ -180,12 +181,15 @@ int main(int argc, char** argv) { bool ok; ok = test_sort(repeat); printf("test_sort: %s\n\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); ok = test_sortInRegisters(repeat); printf("test_sortInRegisters: %s\n\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); ok = test_sortIndicesInRegisters(repeat); printf("test_sortIndicesInRegisters: %s\n\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/warpsort-sycl/main.cpp b/src/warpsort-sycl/main.cpp index 657a3cc22f..028b787298 100644 --- a/src/warpsort-sycl/main.cpp +++ b/src/warpsort-sycl/main.cpp @@ -7,6 +7,7 @@ #include #include #include +#include namespace facebook { namespace cuda { @@ -186,12 +187,15 @@ int main(int argc, char** argv) { bool ok; ok = test_sort(q, repeat); printf("test_sort: %s\n\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); ok = test_sortInRegisters(q, repeat); printf("test_sortInRegisters: %s\n\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); ok = test_sortIndicesInRegisters(q, repeat); printf("test_sortIndicesInRegisters: %s\n\n", ok ? "PASS" : "FAIL"); + if (!ok) exit(1); return 0; } diff --git a/src/wedford-cuda/main.cu b/src/wedford-cuda/main.cu index c6f5ad550d..8c704b5e70 100644 --- a/src/wedford-cuda/main.cu +++ b/src/wedford-cuda/main.cu @@ -182,5 +182,6 @@ int main(int argc, char* argv[]) free(var); free(r_mean); free(r_var); + if (!ok) return 1; return 0; } diff --git a/src/wedford-hip/main.cu b/src/wedford-hip/main.cu index 12f04707a7..181ff8da15 100644 --- a/src/wedford-hip/main.cu +++ b/src/wedford-hip/main.cu @@ -182,5 +182,6 @@ int main(int argc, char* argv[]) free(var); free(r_mean); free(r_var); + if (!ok) return 1; return 0; } diff --git a/src/wedford-omp/main.cpp b/src/wedford-omp/main.cpp index 0092fd318b..e207fbae7a 100644 --- a/src/wedford-omp/main.cpp +++ b/src/wedford-omp/main.cpp @@ -140,5 +140,6 @@ int main(int argc, char* argv[]) free(var); free(r_mean); free(r_var); + if (!ok) return 1; return 0; } diff --git a/src/wedford-sycl/main.cpp b/src/wedford-sycl/main.cpp index a92035b4b4..663b0e3f89 100644 --- a/src/wedford-sycl/main.cpp +++ b/src/wedford-sycl/main.cpp @@ -212,5 +212,6 @@ int main(int argc, char* argv[]) free(var); free(r_mean); free(r_var); + if (!ok) return 1; return 0; } diff --git a/src/winograd-cuda/main.cu b/src/winograd-cuda/main.cu index 62179a39b4..8ca457e581 100644 --- a/src/winograd-cuda/main.cu +++ b/src/winograd-cuda/main.cu @@ -1,6 +1,7 @@ #include #include #include "utils.h" +#include __global__ void winograd_conv2d( const DATA_TYPE *__restrict__ input, @@ -193,5 +194,6 @@ int main(int argc, char* argv[]) { printf("Ratio of co-execution time to total time: %.2lf%%\n", 100.0 * co_time / (end - start)); + if (!pass) return 1; return 0; } diff --git a/src/winograd-hip/main.cu b/src/winograd-hip/main.cu index 668d089611..73ca09790e 100644 --- a/src/winograd-hip/main.cu +++ b/src/winograd-hip/main.cu @@ -1,6 +1,7 @@ #include #include #include "utils.h" +#include __global__ void winograd_conv2d( const DATA_TYPE *__restrict__ input, @@ -193,5 +194,6 @@ int main(int argc, char* argv[]) { printf("Ratio of co-execution time to total time: %.2lf%%\n", 100.0 * co_time / (end - start)); + if (!pass) return 1; return 0; } diff --git a/src/winograd-omp/main.cpp b/src/winograd-omp/main.cpp index b5b9d318cd..80a62de41a 100644 --- a/src/winograd-omp/main.cpp +++ b/src/winograd-omp/main.cpp @@ -1,6 +1,7 @@ #include #include #include "utils.h" +#include int main(int argc, char* argv[]) { @@ -182,5 +183,6 @@ int main(int argc, char* argv[]) { printf("Ratio of co-execution time to total time: %.2lf%%\n", 100.0 * co_time / (end - start)); + if (!pass) return 1; return 0; } diff --git a/src/winograd-sycl/main.cpp b/src/winograd-sycl/main.cpp index 01b2a59251..74e5835e87 100644 --- a/src/winograd-sycl/main.cpp +++ b/src/winograd-sycl/main.cpp @@ -1,6 +1,7 @@ #include #include #include "utils.h" +#include int main(int argc, char* argv[]) { @@ -193,5 +194,6 @@ int main(int argc, char* argv[]) { printf("Ratio of co-execution time to total time: %.2lf%%\n", 100.0 * co_time / (end - start)); + if (!pass) return 1; return 0; } diff --git a/src/wmma-cuda/reference.h b/src/wmma-cuda/reference.h index afe2a4453f..e9cda2e722 100644 --- a/src/wmma-cuda/reference.h +++ b/src/wmma-cuda/reference.h @@ -18,6 +18,7 @@ void compareEqual(T const *a, T const *b, uint32_t size, if (max_relative_error != max_relative_error || max_relative_error > eps * tolerance) { std::cout << "FAILED\n"; + exit(1); } else { std::cout << "PASSED\n"; } diff --git a/src/wmma-hip/reference.h b/src/wmma-hip/reference.h index afe2a4453f..e9cda2e722 100644 --- a/src/wmma-hip/reference.h +++ b/src/wmma-hip/reference.h @@ -18,6 +18,7 @@ void compareEqual(T const *a, T const *b, uint32_t size, if (max_relative_error != max_relative_error || max_relative_error > eps * tolerance) { std::cout << "FAILED\n"; + exit(1); } else { std::cout << "PASSED\n"; } diff --git a/src/wmma-sycl/reference.h b/src/wmma-sycl/reference.h index de3a3173c1..4401f86653 100644 --- a/src/wmma-sycl/reference.h +++ b/src/wmma-sycl/reference.h @@ -18,6 +18,7 @@ void compareEqual(T const *a, T const *b, uint32_t size, if (max_relative_error != max_relative_error || max_relative_error > eps * tolerance) { std::cout << "FAILED\n"; + exit(1); } else { std::cout << "PASSED\n"; } diff --git a/src/wordcount-sycl/main.cpp b/src/wordcount-sycl/main.cpp index 5cdba1ed01..fe40143417 100644 --- a/src/wordcount-sycl/main.cpp +++ b/src/wordcount-sycl/main.cpp @@ -2,6 +2,7 @@ #include #include #include +#include int word_count(const std::vector &input); int word_count_reference(const std::vector &input); @@ -51,6 +52,7 @@ int main(int argc, char* argv[]) } } std::cout << (ok ? "PASS" : "FAIL") << std::endl; + if (!ok) exit(1); // may take a few seconds to initialize const size_t len = 1024*1024*256; diff --git a/src/wyllie-cuda/main.cu b/src/wyllie-cuda/main.cu index 4c9de5dee9..3faf77173d 100644 --- a/src/wyllie-cuda/main.cu +++ b/src/wyllie-cuda/main.cu @@ -102,6 +102,7 @@ int main(int argc, char* argv[]) { #endif printf("%s\n", (h_res == d_res) ? "PASS" : "FAIL"); + if (!(h_res == d_res)) exit(1); return 0; } diff --git a/src/wyllie-hip/main.cu b/src/wyllie-hip/main.cu index 1a65af6803..1ab620b8f3 100644 --- a/src/wyllie-hip/main.cu +++ b/src/wyllie-hip/main.cu @@ -102,6 +102,7 @@ int main(int argc, char* argv[]) { #endif printf("%s\n", (h_res == d_res) ? "PASS" : "FAIL"); + if (!(h_res == d_res)) exit(1); return 0; } diff --git a/src/wyllie-omp/main.cpp b/src/wyllie-omp/main.cpp index e78f47e2ba..05296ac87b 100644 --- a/src/wyllie-omp/main.cpp +++ b/src/wyllie-omp/main.cpp @@ -96,6 +96,7 @@ int main(int argc, char* argv[]) { #endif printf("%s\n", (h_res == d_res) ? "PASS" : "FAIL"); + if (!(h_res == d_res)) exit(1); return 0; } diff --git a/src/wyllie-sycl/main.cpp b/src/wyllie-sycl/main.cpp index 47afa1f815..affc74a655 100644 --- a/src/wyllie-sycl/main.cpp +++ b/src/wyllie-sycl/main.cpp @@ -104,6 +104,7 @@ int main(int argc, char* argv[]) { #endif printf("%s\n", (h_res == d_res) ? "PASS" : "FAIL"); + if (!(h_res == d_res)) exit(1); return 0; } diff --git a/src/xsbench-cuda/Makefile b/src/xsbench-cuda/Makefile index 63a6078b55..c51bdcfb5d 100644 --- a/src/xsbench-cuda/Makefile +++ b/src/xsbench-cuda/Makefile @@ -13,7 +13,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = xsbench +program = main source = Main.cu \ Simulation.cu\ diff --git a/src/xsbench-cuda/io.cu b/src/xsbench-cuda/io.cu index 9f663cf8b4..32dc0c67d6 100644 --- a/src/xsbench-cuda/io.cu +++ b/src/xsbench-cuda/io.cu @@ -166,7 +166,7 @@ void fancy_int( long a ) void print_CLI_error(void) { - printf("Usage: ./XSBench \n"); + printf("Usage: ./main \n"); printf("Options include:\n"); printf(" -m Simulation method (history, event)\n"); printf(" -s Size of H-M Benchmark to run (small, large, XL, XXL)\n"); diff --git a/src/xsbench-hip/Makefile b/src/xsbench-hip/Makefile index 3e027c472e..1ca51c6fbd 100644 --- a/src/xsbench-hip/Makefile +++ b/src/xsbench-hip/Makefile @@ -12,7 +12,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = xsbench +program = main source = Main.cu \ Simulation.cu\ diff --git a/src/xsbench-hip/Makefile.hipcl b/src/xsbench-hip/Makefile.hipcl index 7f356f6b79..c40b3fd377 100644 --- a/src/xsbench-hip/Makefile.hipcl +++ b/src/xsbench-hip/Makefile.hipcl @@ -11,7 +11,7 @@ DEBUG = no # Program name & source code list #=============================================================================== -program = xsbench +program = main source = \ Main.cu \ diff --git a/src/xsbench-omp/Makefile b/src/xsbench-omp/Makefile index 25ea7d1e2f..739c0217c2 100644 --- a/src/xsbench-omp/Makefile +++ b/src/xsbench-omp/Makefile @@ -15,7 +15,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = XSBench +program = main obj = Main.o io.o Simulation.o GridInit.o XSutils.o Materials.o diff --git a/src/xsbench-omp/Makefile.aomp b/src/xsbench-omp/Makefile.aomp index 011f2a7bfb..87557be63c 100644 --- a/src/xsbench-omp/Makefile.aomp +++ b/src/xsbench-omp/Makefile.aomp @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = XSBench +program = main obj = Main.o io.o Simulation.o GridInit.o XSutils.o Materials.o diff --git a/src/xsbench-omp/Makefile.nvc b/src/xsbench-omp/Makefile.nvc index 5bdb1fa91e..40e872626a 100644 --- a/src/xsbench-omp/Makefile.nvc +++ b/src/xsbench-omp/Makefile.nvc @@ -14,7 +14,7 @@ LAUNCHER = # Program name & source code list #=============================================================================== -program = XSBench +program = main obj = Main.o io.o Simulation.o GridInit.o XSutils.o Materials.o diff --git a/src/zerocopy-cuda/main.cu b/src/zerocopy-cuda/main.cu index 93b411284d..2bac63c626 100644 --- a/src/zerocopy-cuda/main.cu +++ b/src/zerocopy-cuda/main.cu @@ -209,5 +209,6 @@ int main(int argc, char **argv) { bPinGenericMemory = true; eval(true, bPinGenericMemory, repeat); eval(false, bPinGenericMemory, repeat); + if (!(errorNorm / refNorm < 1.e-6f)) return 1; return 0; } diff --git a/src/zerocopy-hip/main.cu b/src/zerocopy-hip/main.cu index bddb8559d0..c8358c6eee 100644 --- a/src/zerocopy-hip/main.cu +++ b/src/zerocopy-hip/main.cu @@ -209,5 +209,6 @@ int main(int argc, char **argv) { bPinGenericMemory = true; eval(true, bPinGenericMemory, repeat); eval(false, bPinGenericMemory, repeat); + if (!(errorNorm / refNorm < 1.e-6f)) return 1; return 0; } diff --git a/src/zerocopy-sycl/main.cpp b/src/zerocopy-sycl/main.cpp index bb762b7de4..f07ba14ea8 100644 --- a/src/zerocopy-sycl/main.cpp +++ b/src/zerocopy-sycl/main.cpp @@ -189,5 +189,6 @@ int main(int argc, char **argv) { bGenericSharedMemory = false; eval(q, true, bGenericSharedMemory, repeat); eval(q, false, bGenericSharedMemory, repeat); + if (!(errorNorm / refNorm < 1.e-6f)) return 1; return 0; } diff --git a/src/zeropoint-cuda/main.cu b/src/zeropoint-cuda/main.cu index a87ece2a77..9a6930762a 100644 --- a/src/zeropoint-cuda/main.cu +++ b/src/zeropoint-cuda/main.cu @@ -177,5 +177,6 @@ int main(int argc, char* argv[]) free(min); free(max); + if (!ok) return 1; return 0; } diff --git a/src/zeropoint-hip/main.cu b/src/zeropoint-hip/main.cu index 19db9a354c..3079c5bf8e 100644 --- a/src/zeropoint-hip/main.cu +++ b/src/zeropoint-hip/main.cu @@ -177,5 +177,6 @@ int main(int argc, char* argv[]) free(min); free(max); + if (!ok) return 1; return 0; } diff --git a/src/zeropoint-omp/main.cpp b/src/zeropoint-omp/main.cpp index 2e7aab3644..1fa469d262 100644 --- a/src/zeropoint-omp/main.cpp +++ b/src/zeropoint-omp/main.cpp @@ -153,5 +153,6 @@ int main(int argc, char* argv[]) free(min); free(max); + if (!ok) return 1; return 0; } diff --git a/src/zeropoint-sycl/main.cpp b/src/zeropoint-sycl/main.cpp index 393441e69c..eb97cc416c 100644 --- a/src/zeropoint-sycl/main.cpp +++ b/src/zeropoint-sycl/main.cpp @@ -186,5 +186,6 @@ int main(int argc, char* argv[]) free(min); free(max); + if (!ok) return 1; return 0; }