Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace C++11 raw string literal by C array #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ sa-solver : ${OBJ}
${OBJ} : ${INCLUDES}

_kernel.h : input.cl param.h
echo 'const char *ocl_code = R"_mrb_(' >$@
cpp $< >>$@
echo ')_mrb_";' >>$@
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 @@ -1277,8 +1277,8 @@ void init_and_run_opencl(uint8_t *header, size_t header_len)
cl_program program;
const char *source;
size_t source_len;
source = ocl_code;
source_len = strlen(ocl_code);
source = (char *)ocl_code;
source_len = ocl_code_len - 1;
program = clCreateProgramWithSource(context, 1, (const char **)&source,
&source_len, &status);
if (status != CL_SUCCESS || !program)
Expand Down