Skip to content

Commit

Permalink
replace C++11 raw string by C array
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksander committed Dec 14, 2016
1 parent a7eccdc commit fc89d50
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ sa-solver : ${OBJ}

${OBJ} : ${INCLUDES}

_kernel.h : input.cl param.h
echo 'const char *ocl_code = R"_mrb_(' >$@
cpp $< >>$@
echo ')_mrb_";' >>$@
_kernel.h: input.cl param.h
cpp $< ocl.code
printf "\x00" >> ocl.code
xxd -i ocl.code $@

test : sa-solver
@echo Testing...
Expand All @@ -38,6 +38,6 @@ test : sa-solver
# different: testing/sols-100

clean :
rm -f sa-solver _kernel.h *.o _temp_*
rm -f sa-solver _kernel.h *.o _temp_* ocl.code

re : clean all
4 changes: 2 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1292,8 +1292,8 @@ void init_and_run_opencl(uint8_t *header, size_t header_len)
const char *source;
size_t source_len;
//load_file("kernel.cl", &source, &source_len);
source = ocl_code;
source_len = strlen(ocl_code);
source = (char *)ocl_code;
source_len = strlen((char *)ocl_code);
program = clCreateProgramWithSource(context, 1, (const char **)&source,
&source_len, &status);
if (status != CL_SUCCESS || !program)
Expand Down

0 comments on commit fc89d50

Please sign in to comment.