Skip to content

Commit

Permalink
refactoring: extract a function; avoid clang warning
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomif committed Sep 16, 2024
1 parent 79b4091 commit 0e71fe4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions fc-solve/scripts/opencl-test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ run_deal="$deal"
{
test \( \! -e "$lib" \) -o \( "$REBUILD" = "1" \)
}
_compile_c()
{
${CC:-clang} -shared -fPIC -O3 -march=native -flto -o "$lib" ${include_dir_flags[*]} ${WCFLAGS:--Weverything -Wno-unsafe-buffer-usage -Wno-declaration-after-statement} "$@"
}

board_gen_dir="../../source/board_gen"
test -d "$board_gen_dir"
Expand All @@ -32,14 +36,14 @@ run_deal="$deal"
fi
if should_rebuild
then
${CC:-clang} -shared -fPIC -O3 -march=native -flto -o "$lib" ${include_dir_flags[*]} ${WCFLAGS:--Weverything} "$board_gen_dir/find_deal.c"
_compile_c "$board_gen_dir/find_deal.c"
fi
test -f "$gen_ocl_py_prog"
lib=libopencl_find_deal_idx.so
if should_rebuild
then
python3 "$gen_ocl_py_prog" --ms <(pi-make-microsoft-freecell-board -t "$deal")
${CC:-clang} -shared -fPIC -O3 -march=native -flto -o "$lib" ${include_dir_flags[*]} ${WCFLAGS:--Weverything} "opencl_find_deal_idx.c" -lOpenCL
_compile_c "opencl_find_deal_idx.c" -lOpenCL
fi
if ! test "$SKIP_CISH" = 1
then
Expand Down
2 changes: 1 addition & 1 deletion fc-solve/source/board_gen/fcs_ocl_boiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static __attribute__((format(printf, 2, 3))) void ocl_check(

// Return the ID of the platform specified in the OCL_PLATFORM
// environment variable (or the first one if none specified)
static cl_platform_id select_platform()
static cl_platform_id select_platform(void)
{
cl_uint nplats;
cl_int err;
Expand Down

0 comments on commit 0e71fe4

Please sign in to comment.