From 0b9010b007b43903b6d73d636f9be2b7ae4e3d37 Mon Sep 17 00:00:00 2001 From: mitchellhansen Date: Mon, 29 Aug 2016 21:31:04 -0700 Subject: [PATCH] little tweaks, tomorrow/this week will hook up the arguments and data loading --- kernels/minimal_kernel.c | 8 ++++++-- src/main.cpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/kernels/minimal_kernel.c b/kernels/minimal_kernel.c index 4a312ca..30e61e5 100644 --- a/kernels/minimal_kernel.c +++ b/kernels/minimal_kernel.c @@ -1,5 +1,9 @@ -__kernel void min_kern(__global char* in) +__kernel void min_kern( + global char* in, + global char* map, + global int3 map_dim) { int a = 10; - printf("%s\n", "this is a test string\n"); + size_t id = get_global_id(0); + printf("%c%i\n", in[id], id); } \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 10f32ac..4c5aea2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -47,7 +47,7 @@ int main(){ std::string in = "hello!!!!!!!!!!!!!!!!!!!!!"; cl_mem buff = clCreateBuffer( c.getContext(), CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, - sizeof(char) * 128, NULL, NULL); + sizeof(char) * 128, &in[0], NULL); c.store_buffer(buff, "buffer_1");