diff --git a/samples/core/blur/blur.cpp b/samples/core/blur/blur.cpp index db36ed67..e476698a 100644 --- a/samples/core/blur/blur.cpp +++ b/samples/core/blur/blur.cpp @@ -510,11 +510,6 @@ std::tuple BlurCppExample::query_capabilities() use_subgroup_exchange_relative); } -bool BlurCppExample::query_opencl_2_0_support() -{ - return cl::util::opencl_c_version_contains(device, "2.0"); -} - void BlurCppExample::create_image_buffers() { input_image_buf = cl::Image2D( diff --git a/samples/core/blur/blur.hpp b/samples/core/blur/blur.hpp index 88c7904d..ccfd0c0c 100644 --- a/samples/core/blur/blur.hpp +++ b/samples/core/blur/blur.hpp @@ -41,9 +41,6 @@ class BlurCppExample { // Query device and runtime capabilities std::tuple query_capabilities(); - // Query device support for OpenCL 2.0 - bool query_opencl_2_0_support(); - void create_image_buffers(); void build_program(std::string kernel_op); diff --git a/samples/core/blur/main.c b/samples/core/blur/main.c index 67325f45..f4a3179c 100644 --- a/samples/core/blur/main.c +++ b/samples/core/blur/main.c @@ -1051,18 +1051,6 @@ int main(int argc, char *argv[]) free(name); } - // 5) query if OpenCL driver version is 2.0 - bool opencl_version_2_0 = false; - { - char *driver_version = NULL; - OCLERROR_PAR( - driver_version = cl_util_get_device_info(s.device, CL_DRIVER_VERSION, &error), - error, clean); - opencl_version_2_0 = strcmp("2.0", driver_version) ? 0 : 1; - clean: - free(driver_version); - } - /// Create image buffers const cl_image_desc desc = { .image_type = CL_MEM_OBJECT_IMAGE2D, .image_width = s.input_image.width, @@ -1128,25 +1116,21 @@ int main(int argc, char *argv[]) error, prg); /// Subgroup exchange in dual-pass blur - if (use_subgroup_exchange_relative && opencl_version_2_0) + if (use_subgroup_exchange_relative) { 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); } - if (use_subgroup_exchange && opencl_version_2_0) + if (use_subgroup_exchange) { 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( @@ -1185,26 +1169,22 @@ int main(int argc, char *argv[]) } /// Subgroup exchange in dual-pass Gaussian blur - if (use_subgroup_exchange_relative && opencl_version_2_0) + if (use_subgroup_exchange_relative) { 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, gauss_kern), error, gkrn); } - if (use_subgroup_exchange && opencl_version_2_0) + if (use_subgroup_exchange) { 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, diff --git a/samples/core/blur/main.cpp b/samples/core/blur/main.cpp index 7472f7e2..aa9504cc 100644 --- a/samples/core/blur/main.cpp +++ b/samples/core/blur/main.cpp @@ -49,8 +49,6 @@ int main(int argc, char* argv[]) std::tie(use_local_mem, use_subgroup_exchange, use_subgroup_exchange_relative) = blur.query_capabilities(); - bool opencl_version_2_0 = blur.query_opencl_2_0_support(); - // Create image buffers used for operation. In this example input, // output and temporary image buffers are used. Temporary buffer is used // when 2 blur operations in the row are performed. Result of the first @@ -87,23 +85,20 @@ int main(int argc, char* argv[]) // file you can find 'USE_SUBGROUP_EXCHANGE_RELATIVE' C-like // definition switch for blur_box_horizontal_subgroup_exchange // function. In this case, 2 blur kernel functors are used. - if (use_subgroup_exchange_relative && opencl_version_2_0) + if (use_subgroup_exchange_relative) { std::cout << "Dual-pass subgroup relative exchange blur" << std::endl; - // cl_khr_subgroup_shuffle_relative requires OpenCL 2.0 - blur.build_program( - "-D USE_SUBGROUP_EXCHANGE_RELATIVE -cl-std=CL2.0 "); + blur.build_program("-D USE_SUBGROUP_EXCHANGE_RELATIVE "); blur.dual_pass_subgroup_exchange_box_blur(); } // Same as the previous one, but with a different build switch. See // the blur.cl file for more info about the switch. - if (use_subgroup_exchange && opencl_version_2_0) + if (use_subgroup_exchange) { std::cout << "Dual-pass subgroup exchange blur" << std::endl; - // cl_khr_subgroup_shuffle requires OpenCL 2.0 - blur.build_program("-D USE_SUBGROUP_EXCHANGE -cl-std=CL2.0 "); + blur.build_program("-D USE_SUBGROUP_EXCHANGE "); blur.dual_pass_subgroup_exchange_box_blur(); } } // Box blur @@ -135,25 +130,22 @@ int main(int argc, char* argv[]) // Similar to dual_pass_subgroup_exchange_box_blur but with a gauss // kernel. - if (use_subgroup_exchange_relative && opencl_version_2_0) + if (use_subgroup_exchange_relative) { std::cout << "Dual-pass subgroup relative exchange Gaussian blur" << std::endl; - // cl_khr_subgroup_shuffle_relative requires OpenCL 2.0 - blur.build_program( - "-D USE_SUBGROUP_EXCHANGE_RELATIVE -cl-std=CL2.0 "); + blur.build_program("-D USE_SUBGROUP_EXCHANGE_RELATIVE "); blur.dual_pass_subgroup_exchange_kernel_blur(); } // Same as the previous one, but with a different build switch. See // the blur.cl file for more info about the switch. - if (use_subgroup_exchange && opencl_version_2_0) + if (use_subgroup_exchange) { std::cout << "Dual-pass subgroup exchange Gaussian blur" << std::endl; - // cl_khr_subgroup_shuffle requires OpenCL 2.0 - blur.build_program("-D USE_SUBGROUP_EXCHANGE -cl-std=CL2.0 "); + blur.build_program("-D USE_SUBGROUP_EXCHANGE "); blur.dual_pass_subgroup_exchange_kernel_blur(); } } // Gaussian blur