Skip to content

Commit

Permalink
Fix blur/blurcpp samples failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Beanavil authored and mfep committed Sep 13, 2023
1 parent 26b28a1 commit 7bb6303
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 24 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
BIN: [64]
STD:
- C: 11 # Utils C library uses C11 functions (e.g. timespec_get)
CXX: 14
CXX: 14 # Utils C++ library uses C14 types (e.g. integer_sequence)
- C: 17
CXX: 17
CONF:
Expand Down Expand Up @@ -616,7 +616,6 @@ jobs:
cmake --build $GITHUB_WORKSPACE/build_install --config Debug --parallel `sysctl -n hw.logicalcpu` `if [[ "${{matrix.GEN}}" == "Xcode" ]]; then echo "-- -quiet"; fi;`

python:
if: false
name: Exercise Python examples on ${{matrix.os}}
strategy:
matrix:
Expand Down Expand Up @@ -653,7 +652,6 @@ jobs:
done
checkruby:
if: false
name: Check Ruby Samples ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -679,7 +677,6 @@ jobs:
working-directory: ruby

android:
if: false
runs-on: ubuntu-latest
needs: format
strategy:
Expand Down
2 changes: 1 addition & 1 deletion external/OpenCL-CLHPP
Submodule OpenCL-CLHPP updated 1 files
+1 −1 external/CMock
21 changes: 11 additions & 10 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,18 @@ macro(add_sample)
)

foreach(CONFIG ${OPENCL_SAMPLE_CONFIGS})
install(TARGETS ${OPENCL_SAMPLE_TARGET} CONFIGURATIONS ${CONFIG} DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${OPENCL_SAMPLE_KERNELS} CONFIGURATIONS ${CONFIG} DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${OPENCL_SAMPLE_SHADERS} CONFIGURATIONS ${CONFIG} DESTINATION ${CMAKE_INSTALL_BINDIR})
install(TARGETS ${OPENCL_SAMPLE_TARGET} CONFIGURATIONS ${CONFIG} DESTINATION ${CMAKE_INSTALL_BINDIR}/${CONFIG})
install(FILES ${OPENCL_SAMPLE_KERNELS} CONFIGURATIONS ${CONFIG} DESTINATION ${CMAKE_INSTALL_BINDIR}/${CONFIG})
install(FILES ${OPENCL_SAMPLE_SHADERS} CONFIGURATIONS ${CONFIG} DESTINATION ${CMAKE_INSTALL_BINDIR}/${CONFIG})
if(OPENCL_SDK_TEST_SAMPLES AND OPENCL_SAMPLE_TEST)
add_test(
NAME "${OPENCL_SAMPLE_TARGET}_${CONFIG}"
COMMAND ${OPENCL_SAMPLE_TARGET}
CONFIGURATIONS ${CONFIG}
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
)
endif()
endforeach()
if(OPENCL_SDK_TEST_SAMPLES AND OPENCL_SAMPLE_TEST)
add_test(
NAME ${OPENCL_SAMPLE_TARGET}
COMMAND ${OPENCL_SAMPLE_TARGET}
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
)
endif()
endmacro()


Expand Down
9 changes: 8 additions & 1 deletion samples/core/blur/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1119,8 +1119,9 @@ int main(int argc, char *argv[])
printf("Dual-pass subgroup relative exchange blur\n");

kernel_op[0] = '\0';
// cl_khr_subgroup_shuffle_relative requires OpenCL 2.0
strcat(kernel_op, " -cl-std=CL2.0 ");
strcat(kernel_op, "-D USE_SUBGROUP_EXCHANGE_RELATIVE ");

OCLERROR_RET(dual_pass_subgroup_exchange_box_blur(
&s, (cl_int)blur_opts.size),
error, prg);
Expand All @@ -1130,6 +1131,8 @@ int main(int argc, char *argv[])
printf("Dual-pass subgroup exchange blur\n");

kernel_op[0] = '\0';
// cl_khr_subgroup_shuffle requires OpenCL 2.0
strcat(kernel_op, " -cl-std=CL2.0 ");
strcat(kernel_op, "-D USE_SUBGROUP_EXCHANGE ");

OCLERROR_RET(dual_pass_subgroup_exchange_box_blur(
Expand Down Expand Up @@ -1173,6 +1176,8 @@ int main(int argc, char *argv[])
printf("Dual-pass subgroup relative exchange Gaussian blur\n");

kernel_op[0] = '\0';
// cl_khr_subgroup_shuffle_relative requires OpenCL 2.0
strcat(kernel_op, " -cl-std=CL2.0 ");
strcat(kernel_op, "-D USE_SUBGROUP_EXCHANGE_RELATIVE ");

OCLERROR_RET(dual_pass_subgroup_exchange_kernel_blur(&s, gauss_size,
Expand All @@ -1184,6 +1189,8 @@ int main(int argc, char *argv[])
printf("Dual-pass subgroup exchange Gaussian blur\n");

kernel_op[0] = '\0';
// cl_khr_subgroup_shuffle requires OpenCL 2.0
strcat(kernel_op, " -cl-std=CL2.0 ");
strcat(kernel_op, "-D USE_SUBGROUP_EXCHANGE ");

OCLERROR_RET(dual_pass_subgroup_exchange_kernel_blur(&s, gauss_size,
Expand Down
18 changes: 10 additions & 8 deletions samples/core/blur/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ int main(int argc, char* argv[])
{
std::cout << "Dual-pass subgroup relative exchange blur"
<< std::endl;

blur.build_program("-D USE_SUBGROUP_EXCHANGE_RELATIVE ");
// cl_khr_subgroup_shuffle_relative requires OpenCL 2.0
blur.build_program(
"-D USE_SUBGROUP_EXCHANGE_RELATIVE -cl-std=CL2.0 ");
blur.dual_pass_subgroup_exchange_box_blur();
}

Expand All @@ -99,8 +100,8 @@ int main(int argc, char* argv[])
if (use_subgroup_exchange)
{
std::cout << "Dual-pass subgroup exchange blur" << std::endl;

blur.build_program("-D USE_SUBGROUP_EXCHANGE ");
// cl_khr_subgroup_shuffle requires OpenCL 2.0
blur.build_program("-D USE_SUBGROUP_EXCHANGE -cl-std=CL2.0 ");
blur.dual_pass_subgroup_exchange_box_blur();
}
} // Box blur
Expand Down Expand Up @@ -137,8 +138,9 @@ int main(int argc, char* argv[])
std::cout
<< "Dual-pass subgroup relative exchange Gaussian blur"
<< std::endl;

blur.build_program("-D USE_SUBGROUP_EXCHANGE_RELATIVE ");
// cl_khr_subgroup_shuffle_relative requires OpenCL 2.0
blur.build_program(
"-D USE_SUBGROUP_EXCHANGE_RELATIVE -cl-std=CL2.0 ");
blur.dual_pass_subgroup_exchange_kernel_blur();
}

Expand All @@ -148,8 +150,8 @@ int main(int argc, char* argv[])
{
std::cout << "Dual-pass subgroup exchange Gaussian blur"
<< std::endl;

blur.build_program("-D USE_SUBGROUP_EXCHANGE ");
// cl_khr_subgroup_shuffle requires OpenCL 2.0
blur.build_program("-D USE_SUBGROUP_EXCHANGE -cl-std=CL2.0 ");
blur.dual_pass_subgroup_exchange_kernel_blur();
}
} // Gaussian blur
Expand Down

0 comments on commit 7bb6303

Please sign in to comment.