From 510cd557e17baa4d16538eb4b0129506e87e1a7b Mon Sep 17 00:00:00 2001 From: gyulaid Date: Wed, 16 Mar 2022 21:37:34 +0100 Subject: [PATCH] final --- Linear/Jacobi.cpp | 5 +++-- Linear/Linear.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Linear/Jacobi.cpp b/Linear/Jacobi.cpp index 15f4edf..ff6716d 100644 --- a/Linear/Jacobi.cpp +++ b/Linear/Jacobi.cpp @@ -21,7 +21,7 @@ void Jacobi::generateLinEq() for (int j = 0; j < Jn; ++j) { float v = 0.0f; if (i == j) { - v = 0.5f; + v += 0.5f; } JA_c[i + j * Jn] = v; JA_g[i + j * Jn] = v; @@ -92,12 +92,13 @@ void Jacobi::gpu_compute(cl::Context* context, cl::CommandQueue* queue, cl::Prog cl_ulong time = 0; if (MVMultiplier != NULL) { + printMatrix(Jn, Jn, JA_g); int inputBuffer = 0; const int iterations = 20; for (int i = 0; i < iterations; ++i) { time += MVMultiplier->dewIt(Jn, Jn, Jx_g[(inputBuffer + 1) % 2], JA_g, Jx_g[inputBuffer], Jb_g); inputBuffer = (inputBuffer + 1) % 2; - //printMatrix(1, Jn, Jx_g[inputBuffer]); + printMatrix(1, Jn, Jx_g[inputBuffer]); } } else { diff --git a/Linear/Linear.cpp b/Linear/Linear.cpp index 8a8d0d0..1718d33 100644 --- a/Linear/Linear.cpp +++ b/Linear/Linear.cpp @@ -61,7 +61,7 @@ int main() //cppapi(); OpenCLHandler handler("../kernels/linear.cl"); - handler.run_test(new Jacobi(64, MVType::SimpleMV)); + handler.run_test(new Jacobi(8, MVType::SimpleMV)); //handler.run_test(new Jacobi(64, MVType::ReduceMV)); //handler.run_test(new Jacobi(64, MVType::LargeMV));