Commit e5de8111 authored by rok-cesnovar's avatar rok-cesnovar
Browse files

macros test

parent 1e5f13e3
No related merge requests found
Showing with 5 additions and 10 deletions
+5 -10
......@@ -139,6 +139,10 @@ class kernel_cl {
+ std::to_string(this->base_options()[comp_opts]);
}
}
kernel_opts += std::string(" -DA(i,j)=A[j*rows+i]");
kernel_opts += std::string(" -DB(i,j)=B[j*rows+i]");
kernel_opts += std::string(" -DC(i,j)=C[j*rows+i]");
try {
cl::Program::Sources source(
1,
......
#define STRINGIFY(src) #src
STRINGIFY(
//#ifndef A
//#define A(i, j) A[j * rows + i]
//#endif
//#ifndef B
//#define B(i, j) B[j * rows + i]
//#endif
//#ifndef C
//#define C(i, j) C[j * rows + i]
//#endif
/**
* Matrix addition on the GPU
*
......@@ -25,7 +16,7 @@ __kernel void add(__global double *C, __global double *A, __global double *B,
int i = get_global_id(0);
int j = get_global_id(1);
if (i < rows && j < cols) {
C[j * rows + i] = A[j * rows + i] + B[j * rows + i];
C(i, j) = A(i, j) + B(i, j);
}
}
);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment