Browse Source

final

master
Daniel Gyulai 3 years ago
parent
commit
510cd557e1
  1. 5
      Linear/Jacobi.cpp
  2. 2
      Linear/Linear.cpp

5
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 {

2
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));

Loading…
Cancel
Save