Skip to content

Commit 7b900f7

Browse files
committed
replace C++11 raw string by C array
-
1 parent a7eccdc commit 7b900f7

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ sa-solver : ${OBJ}
2222
${OBJ} : ${INCLUDES}
2323

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

2929
test : sa-solver
3030
@echo Testing...
@@ -38,6 +38,6 @@ test : sa-solver
3838
# different: testing/sols-100
3939

4040
clean :
41-
rm -f sa-solver _kernel.h *.o _temp_*
41+
rm -f sa-solver _kernel.h *.o _temp_* ocl.code
4242

4343
re : clean all

main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,8 +1292,8 @@ void init_and_run_opencl(uint8_t *header, size_t header_len)
12921292
const char *source;
12931293
size_t source_len;
12941294
//load_file("kernel.cl", &source, &source_len);
1295-
source = ocl_code;
1296-
source_len = strlen(ocl_code);
1295+
source = (char *)ocl_code;
1296+
source_len = strlen((char *)ocl_code);
12971297
program = clCreateProgramWithSource(context, 1, (const char **)&source,
12981298
&source_len, &status);
12991299
if (status != CL_SUCCESS || !program)

0 commit comments

Comments
 (0)