diff --git a/example01/main.cpp b/example01/main.cpp index a1bb5c3..5284a40 100644 --- a/example01/main.cpp +++ b/example01/main.cpp @@ -1,6 +1,7 @@ #include -#include "CL/cl.hpp" #include +#include +#include "../CL/cl.hpp" void compareResults (double CPUtime, double GPUtime, int trial) { @@ -30,9 +31,8 @@ double timeAddVectorsCPU(int n, int k) { start = std::clock(); for (int i=0; i all_platforms; cl::Platform::get(&all_platforms); @@ -71,7 +86,7 @@ int main() { std::string kernel_code= // is equivalent to the host's "time_add_vectors" function, except the // timing will be done on the host. - " void kernel looped_add(global const int* v1, global const int* v2, global int* v3, " + " void kernel add_looped(global const int* v1, global const int* v2, global int* v3, " " global const int* constants) {" " int ID, NUM_GLOBAL_WITEMS, n, k, ratio, start, stop;" " ID = get_global_id(0);" @@ -105,12 +120,23 @@ int main() { " v3[i] = v1[i] + v2[i];" " }" "" - " void kernel add_single(global const int* v1, global const int* v2, global int* v3, " - " global const int* constants) { " - " int k = constants[1];" + " void kernel add_single(global const int* v1, global const int* v2, global int* v3) { " " int ID = get_global_id(0);" - " for (int i=0; i