From 87e607a19b385f29b22dd62817d9899652d1d430 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sat, 13 Mar 2021 05:56:40 +0000 Subject: [PATCH] core(ocl): skip SPIR test on AMD devices if problem detected --- modules/core/test/ocl/test_opencl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/core/test/ocl/test_opencl.cpp b/modules/core/test/ocl/test_opencl.cpp index 27cd82d424..275dc0f3cd 100644 --- a/modules/core/test/ocl/test_opencl.cpp +++ b/modules/core/test/ocl/test_opencl.cpp @@ -120,6 +120,11 @@ TEST(OpenCL, support_SPIR_programs) cv::ocl::ProgramSource src = cv::ocl::ProgramSource::fromSPIR(module_name, "simple_spir", (uchar*)&program_binary_code[0], program_binary_code.size(), ""); cv::String errmsg; cv::ocl::Program program(src, "", errmsg); + if (program.ptr() == NULL && device.isAMD()) + { + // https://community.amd.com/t5/opencl/spir-support-in-new-drivers-lost/td-p/170165 + throw cvtest::SkipTestException("Bypass AMD OpenCL runtime bug: 'cl_khr_spir' extension is declared, but it doesn't really work"); + } ASSERT_TRUE(program.ptr() != NULL); k.create("test_kernel", program); }