summaryrefslogtreecommitdiff
path: root/utests/utest_helper.hpp
Commit message (Collapse)AuthorAgeFilesLines
* Implement extension cl_intel_device_side_avc_motion_estimation.Chuanbo Weng2017-07-121-0/+3
| | | | | | | | | | | | | | | | | | This patch mainly contains: 1. built-in function __gen_ocl_ime implementation. 2. Lots of built-in functions of cl_intel_device_side_avc_motion_estimation are implemented. 3. This extension is required to run in simd16 mode. v2: move the utests to seprate patches one by one; as all the utests has extension function check, no need to put them in stand alone utest; uncomment the self test; fix extension check logic issue, should be && instead of ||. Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com> Signed-off-by: Xionghu Luo <xionghu.luo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Utset: Add test case for cl_intel_required_subgroup_size extensionPan Xiuli2017-06-161-0/+3
| | | | | | | | | | Check the device supported subgroup sizes, and use intel_reqd_sub_group_size to build kernels in these size. Then check if there is spill for each kernel. V2: Fix memory leak Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* add extension cl_intel_media_block_io READ related functionLuo Xionghu2017-03-131-0/+3
| | | | | | | | v2: add #define intel_media_block_io in libocl; move extension check code to this patch; Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Pan Xiuli <xiuli.pan@intel.com>
* Add example of using cl_khr_gl_sharing to do gl buffer sharing.Chuanbo Weng2017-02-101-0/+2
| | | | | Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Utest: Add OCL20 into utest and check version in runtimePan Xiuli2017-02-101-2/+2
| | | | | | | | | The utest should always be built and we can check ocl version at the test begin. Contributor: Rebecca N. Palmer <rebecca_palmer@zoho.com> Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Utest: Add check subgroup short helper functionPan Xiuli2016-11-031-0/+2
| | | | | | | | Check if the device support intel_subgroups_short extension, also check if the device support intel_subgroups extension first. Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Utests: Allow testing cl_intel_accelerator via ICDRebecca N. Palmer2016-10-201-0/+3
| | | | | | | | | v3: Use extension check, not beignet check. Treat claiming to have the extension but not having the kernel as a failure. v4: Make extension check a function, use stderr. Signed-off-by: Rebecca N. Palmer <rebecca_palmer@zoho.com> Reviewed-by: Chuanbo Weng <chuanbo.weng@intel.com>
* Runtime: re-enable cl_khr_gl_sharing with existing egl extension.Chuanbo Weng2016-09-121-2/+7
| | | | | | | | | | | | | | | | | | In order to query low level layout of GL buffer object/texture/render buffer, previous implementation introduced an egl extension and implemented in Beignet side. This way is broken once mesa change its related internal code. In this patch, we use an new egl extension (EGL_MESA_image_dma_buf_export) to query related layout infomations of gl texture. Since this egl extension is already accepted by Khronos, so it's a stable method. This patch just implement GL texture 2d buffer sharing, and we will implement other target type if necessary. v2: Add CMake build option to enable cl_khr_gl_sharing(default off). Clean up related CMake code. Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Utest: Add as_float as_uint helper functionPan Xiuli2016-08-121-0/+7
| | | | | | | These functions are used with half float convert funcitons. Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Utest: Move half related helper function into utest helperPan Xiuli2016-08-121-0/+7
| | | | | | | For more half related tests, need to use helper funciton in utest. Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Utest: Add check for OpenCL 2.0 extensionPan Xiuli2016-07-201-0/+3
| | | | | | | | Beignet has some opencl2.0 builtin functions, add check for OpenCL 2.0 or Beignet for these test cases. Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Utest: Add check for cl_intel_subgroups extension testsPan Xiuli2016-07-151-1/+9
| | | | | | | | | | These tests can only run with cl_intel_subgroups extension, add check before runing the tests. Also refine the call of the extension API with function pointer. V2: Use clGetExtensionFunctionAddress to get extension API function Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Android: fix __thread keyword issue in android.Yang Rong2016-05-271-0/+4
| | | | | | | | | Android doesn't support __thread keyword, so use pthread instead in cl_thread.c and disable multithread in the utest. V2: remove __thread in the scr/cl_thread. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@intel.com>
* add functions cl_check_beignet.Luo Xionghu2016-04-221-0/+2
| | | | | | | __gen_ocl_get_timestamp functions is beignet builtin. Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* fix failed cases for stand alone utest;Luo Xionghu2016-04-221-2/+4
| | | | | | | | | | | 1. use clEnqueueMapBuffer/Image instead of clEnqueueReadBuffer/Image; 2. add sanity check for clEnqueueMapImage; v2: disable OpenCL 2.0 specific builtin cases for stand alone utest. v3: don't hide failed cases. fix utest build warnings. Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* standalone utest for unified OpenCL implementation.Luo Xionghu2016-04-221-4/+38
| | | | | | | | | | | | | | | | | | | | | | | | use the variable NOT_BUILD_STAND_ALONE_UTEST to control the build type: for beignet build, set it to 1; for stand alone build, do NOT need set it. remove all clXXXIntel extension call and such kind of tests since we intend to provide the unit test independently for viariant OpenCL implementation; replace the clMapBufferIntel/clMapBufferGTTIntel with clEnqueueMapBuffer/clEnqueueMapImage; link the utest binary to libOpenCL to follow the icd standard; remove the useless env in setenv.sh since we need make install the package after build. v2: fix the indent error; use function pointer for extesion case like vme and libva since we link to libOpenCL; v3: builtin_kernel_block_motion_estimate_intel released kernel twice; v4: find OpenCL library for standalone utest and link to libcl for not standalone utest; check default variables in setenv.sh whether empty before use. Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Add basic utest for block_motion_estimate_intel.Chuanbo Weng2015-11-101-0/+1
| | | | | | | | If the CL device does not support this builtin kernel, the test returns PASS. Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Ruiling Song <ruiling.song@intel.com>
* Utests: Add double check and refine compiler_double case.Junyan He2015-10-271-0/+3
| | | | | Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* add utests option: -j which specifies the 'number' of jobs (multi-thread)Meng Mengmeng2015-10-211-6/+6
| | | | | | | It's out-of-order execution in multi-tread which value range should be [1 - CPU cores]. Signed-off-by: Meng Mengmeng <mengmeng.meng@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
* utests: Added unit tests to test LLVM and ASM dump generation in a two step ↵Manasi Navare2015-10-131-0/+4
| | | | | | | | | | | | | | | | build process with clCompile and clLink APIs. This patch adds two new tests to the unit tests. It uses the existing framework and data structures and tests the llvm/asm dump generation when these flags (-dump-opt-llvm, -dump-opt-asm) are passed as compile and link options to clCompileProgram and clLinkProgram APIs along with the dump file names. Method added: 1) get_compile_llvm_info() tests LLVM dump generation after clCompileProgram() stage 2) get_link_asm_info() tests Gen ASM dump generation after clLinkProgram() stage Signed-off-by: Manasi Navare <manasi.d.navare@intel.com> Reviewed-by: Ruiling Song <ruiling.song@intel.com>
* correct ULP value in utestsMeng Mengmeng2015-07-151-0/+4
| | | | Set a global function in utests to get the right ULP value.
* Refine benchmark output.Chuanbo Weng2015-02-061-1/+1
| | | | | | | | | | | Change output measurement from time to bandwidth, so we can compare all benchmark results easily. And change return type of benchmark from int to double, because int is not precise enough. v2: Change output measurement from time to bandwidth. Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* add test of cl_mem_use_host_ptr into benchmarkGuo Yejun2014-12-021-0/+3
| | | | | | | and also refine the code to move time_subtract into utest_helper.hpp/cpp Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
* License: adjust all license version to LGPL v2.1+.Zhigang Gong2014-11-111-1/+1
| | | | | | | | To make the license statement consistent to each other, adjust all license versions to v2.1+. Thus beignet should have a pure LGPL v2.1+ license. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
* Fix compile warnings for ICC compilerLv Meng2014-08-191-2/+2
| | | | | | | | | 1.the "const" associated functions' modification is to fix "type qualifier on return type is meaningless" for ICC compile warning. 2.the "operator new" shoud have the corresponding "operator delete" function. 3.In C++0x std::auto_ptr will be deprecated in favor of std::unique_ptr. Signed-off-by: Lv Meng <meng.lv@intel.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
* utests: use OpenCL 1.2 API for image related test cases.Zhigang Gong2014-06-131-12/+0
| | | | Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
* Move the defination union SF to header file utest_helper.hppYi Sun2014-03-131-0/+15
| | | | | Signed-off-by: Yi Sun <yi.sun@intel.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
* Add test cases generator.Yi Sun2013-12-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | v1: File utest_generator.py contain the base class and function for generating File utest_math_gen.py can generate most math function for all the gentype utest_math_gen.py can be run during cmake. v2: 1. Put all the generated unit test cases to folder utest/generated. 2. Delete all generated folder while involve make clean. 3. At the top of the generated test cases, add some comments 4. Instead of defined FLT_ULP(0.000001) as the ulp unit, caculate the float ulp before using it. 5. Add several math functions' test case. v3: 1. Refine the calculation for float, and calculate each float got from cpu function. v4: Refine the calculation for float. Following fucntions test cases fail with input 0, 1 or 3.14: builtin_atan2_float builtin_atanh_float builtin_rootn_float builtin_cos_float builtin_cospi_float builtin_erf_float builtin_erfc_float builtin_mad_float builtin_nextafter_float builtin_pown_float builtin_powr_float builtin_rint_float builtin_sinpi_float builtin_tan_float builtin_tanpi_float v5: remove case builtin_mad_float todo: atan2pi fmax fmin sincos Signed-off-by: Yi Sun <yi.sun@intel.com> Signed-off-by: Yangwei Shui <yangweix.shui@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
* Accelerate utest.Zhigang Gong2013-12-161-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For some test cases which include more than one kernel, the current implementation always build the program for a new sub test case. That wastes a lot of time. This patch introduce a new macro MAKE_UTEST_FROM_FUNCTION_KEEP_PROGRAM which has an extra parameter to specify whether to keep the previous program and avoid the extra build. The normal usage is: MAKE_UTEST_FROM_FUNCTION_KEEP_PROGRAM(fn1, true); MAKE_UTEST_FROM_FUNCTION_KEEP_PROGRAM(fn2, true); MAKE_UTEST_FROM_FUNCTION_KEEP_PROGRAM(fn3, true); MAKE_UTEST_FROM_FUNCTION_KEEP_PROGRAM(fn4, true); MAKE_UTEST_FROM_FUNCTION_KEEP_PROGRAM(fn5, false); The scenario is that the above fn1-5 are included in the same kernel file and we define the sub cases in the same cpp file. We already have some examples of this usage in the compiler_abs.cpp, compiler_abs_diff.cpp compiler_basic_arithmetic.cpp, compiler_vector_load_store.cpp, etc. This patch reduces 2/3 of the utests execution time. v2: should always destroy the program when run one specific test case. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
* Add a test case for binary load.Junyan He2013-09-121-0/+3
| | | | | Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
* add a space to make the error more readableLu Guanqun2013-08-301-1/+1
| | | | | Signed-off-by: Lu Guanqun <guanqun.lu@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Add event unit test.Yang Rong2013-08-121-2/+8
| | | | | Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Add the test case for clGetProgramInfo APIJunyan He2013-06-261-3/+4
| | | | | Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* update to OpenCL 1.1 headerHomer Hsing2013-06-191-0/+12
| | | | | | | | | | | | | | | | | | | | | Based on our current progress, we plan to implement OpenCL 1.1 rather than OpenCL 1.2 for the next release. Thus we downgrade the header file to 1.1 in this commit. put OpenCL 1.1 header in include/CL/ add OpenCL 1.2 defs, used by some code, by "#ifndef CL_VERSION_1.2" " some OpenCL 1.2 defs" "#endif" add OCL_CREATE_IMAGE2D, OCL_CREATE_IMAGE3D, OCL_CREATE_GL_IMAGE2D, OCL_CREATE_GL_IMAGE3D update test cases Signed-off-by: Homer Hsing <homer.xing@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* utests: Added one test case for clFinish().Edward Ching2013-06-131-0/+5
| | | | | Reviewed-by: Zou, Nanhai <nanhai.zou@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* utests: Add test case for box blur on image bufferDag Lem2013-05-301-0/+6
| | | | | | | | This test demonstrates box blur on an image buffer, using an extremely simple kernel. Signed-off-by: Dag Lem <dag@nimrod.no> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* utests: Refine the fill image0 test case to use map gtt.Zhigang Gong2013-05-171-0/+11
| | | | | | | | | | Now we don't fill the whole image to a const color. we fill it according to the coords. Then we can use map gtt to get the result and verify the result easily on cpu side. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Tested-by: Simon Richter <Simon.Richter@hogyros.de>
* Rename Intel specific extension functions for ICDSimon Richter2013-04-221-2/+2
| | | | | | | | | The ICD extension specification requires that extension function names end in the vendor name to allow clGetExtensionFunctionAddress to switch between implementations. Signed-off-by: Simon Richter <Simon.Richter@hogyros.de> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Make EGL optionalSimon Richter2013-04-181-4/+4
| | | | | | | This fixes builds if EGL is unavailable. The OpenGL sharing extension will be disabled then. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* utests: refine the helper macros.Release_v0.1Zhigang Gong2013-04-121-31/+12
| | | | | | | | | | The previous implementation has many duplicate code, and the FN is used incorrectly. Now fix it and the code looks a little bit clean and when it fails the reported function name should be correct now. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: Lu Guanqun <guanqun.lu@intel.com>
* utests: added cl_khr_gl_sharing related helper functions.Zhigang Gong2013-04-121-0/+33
| | | | | | | This is the preparation to add clgl interoperate test cases. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Tested-by: Lu, Guanqun <guanqun.lu@intel.com>
* Use new OCL1.2 API rather than those deprecated API.Zhigang Gong2013-04-101-2/+2
| | | | | | | | Use clCreateImage to replace the old API clCreateImage2D. It will silent the compiler warnings. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: Homer Hsing <homer.xing@intel.com>
* utest: Added some new helper macros for image2d test cases.Zhigang Gong2013-04-101-0/+14
| | | | | | | | This is the first commit to prepare to add some image 2d test cases. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: Lu Guanqun <guanqun.lu@intel.com>
* fix assertion when two kernels exist in cl fileLu Guanqun2013-03-291-0/+5
| | | | | | | The root cause is that it fails to increment `currID` when traversing hash map. Signed-off-by: Lu Guanqun <guanqun.lu@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Fixed a bug in the flag register allocatorBenjamin Segovia2012-10-091-0/+7
| | | | | | Started to add more brutal test to improve functional regressions. Kind of needed for big modifications that are going to come Check switch case lowering functionality
* Made Mandelbrot work on Fulsim (SIMD8 only right now)Benjamin Segovia2012-08-101-0/+6
|
* Added flat_address_space testsBenjamin Segovia2012-08-101-5/+7
|
* Finished the small test frameworkBenjamin Segovia2012-08-101-23/+31
|
* Revamped tests to make them smaller and simpler (and more automatic to use)Benjamin Segovia2012-08-101-9/+2
|
* tests -> utestsBenjamin Segovia2012-08-101-0/+127