diff --git a/Makefile b/Makefile index 4bf9dad..6b25288 100644 --- a/Makefile +++ b/Makefile @@ -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... @@ -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 diff --git a/main.c b/main.c index 9ebc242..2144792 100644 --- a/main.c +++ b/main.c @@ -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)