summaryrefslogtreecommitdiff
path: root/utests
AgeCommit message (Collapse)AuthorFilesLines
2016-01-08change built-in function name from get_sub_group_id to get_sub_group_local_idGuo Yejun2-4/+4
Fix bug at https://bugs.freedesktop.org/show_bug.cgi?id=93469 The fucntion is mapped to OP_SIMD_ID which returns the SIMD lane ID. However, the SIMD lane ID is the equivalent of get_sub_group_local_id(). contributor: Georg Kolling <georg.kolling@gmail.com> Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-01-08change built-in function name from get_sub_group_size to get_max_sub_group_sizeGuo Yejun2-4/+4
Fix bug at https://bugs.freedesktop.org/show_bug.cgi?id=93469 The fucntion is mapped to OP_SIMD_SIZE which returns the constant SIMD width, the correct function name is get_max_sub_group_size. contributor: Georg Kolling <georg.kolling@gmail.com> Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-12-14Utest: Add a bitonic sort test for non-constant extractelementPan Xiuli2-1/+47
This test case is for the new added non-constand index extractelement path in llvm_scalarize pass. Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-12-14Utests: Add test cases for reduce add.Junyan He1-0/+69
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-12-14Utests: Add test cases for workgroup reduce max/min.Junyan He2-0/+175
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-12-10utests: add an utest for mixPan Xiuli2-1/+52
Add a testcase for compiler mix. Since mix will have error, we take err limit as 1e-3 and print the max err. Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-12-10utest: add utest to generate spir binary from beignet.Luo Xionghu1-0/+99
include case compile_spir_binary and build_spir_binary. Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-12-10Utest: Add test for get_global/local_linear_idPan Xiuli3-1/+173
Add two utest case test for OCL2.0 new work-item built-in functions. Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-12-09add utest to demo how to run CM kernerl via OpenCL APIsGuo Yejun2-0/+280
In this test case, the CM kernel is in VISA binary format, not in GenX Binary format, it means that the CM jitter is needed to compile the CM kernel from VISA format to GenX format, please refer to cmrt_package_path/jitter/readme.txt to prepare the jitter. v2: add comments about the CM jitter Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-11-25Add utest for workgroup_broadcast.Junyan He2-0/+48
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-11-25Add a option which could set the benchmark unit properly.Meng Mengmeng2-7/+7
For benchmarks, the units are varied e.g. GB/S, FPS, score and so on. So we need to make a choice for every benchmark. Signed-off-by: Meng Mengmeng <mengmeng.meng@intel.com> Reviewed-by: Ruiling Song <ruiling.song@intel.com>
2015-11-25Utests: Fix the failure for half math tests.Junyan He1-17/+24
We do not have native half type support on X86 platforms. The half math functions on CPU side are just used in utests, so we do not want to import the soft imitation code or add dependency on some math libs for half. We just use float to to calculate the reference value. This causes the diff between CPU results and GPU results. We use random func to generate src value but when this src value is very close to pi or pi/2, the truncation diff imported by float -> half will be magnified a lot in the result of some math functions, e.g. sin, cos and tan. We now just use a float table as src to fix this. Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-11-10Add basic utest for block_motion_estimate_intel.Chuanbo Weng3-0/+111
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>
2015-11-06utests: fix compiler_fill_image_2d_array random bugPan Xiuli1-6/+12
Use safer image write instead of map and memset. When create image without data, we could not set pitch and we don't know the pitch either. So use map and memset the space is too dangerous if pitch is bigger than w*sizeof(bpp), in this case the actually pitch is 512 but memset use pitch as 64*4=256. With only half space set to 0, there will be undefined behavior when we want to check the result for those space that we haven't set to 0. Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-11-06utests: fix image_from_buffer bugsPan Xiuli1-8/+9
Fixed 2 bugs: 1.This test case uses usrptr, so we should never free the orginal buffer space, otherwise undefined behavior would happen: adding or losing one header file causing data in front broken, NDRangeKernel fail etc. 2.The utest need to test when to free image from buffer and the buffer, but the utest helper function will released it again and causes libc made some warnings. We just make the global variable to NULL to avoid these questions. These will fix the utests image_from_buffer broken. Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Luo Xionghu <xionghu.luo@intel.com>
2015-11-06Utest: Fix a bug for double div.Junyan He2-2/+4
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-11-06Utests: Add test cases for double conversion.Junyan He4-47/+725
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-11-03utests: fix multithread queue chaosPan Xiuli1-7/+1
Utest profiling exec create a new queue and replace the global shared queue for no use. It will result in some strange segmeng fault. Fix by removing the replacment of the global queue. Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Ruiling Song <ruiling.song@intel.com>
2015-10-27Utest: Add double division test.Junyan He3-40/+81
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-10-27Utests: Add double check and refine compiler_double case.Junyan He5-1/+31
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-10-27Backend: Delete getDoubleExecWidth and refine handleDouble.Junyan He1-1/+0
We will not support double type on gen7 and gen75 platforms, so there is no need for getDoubleExecWidth for all platforms. We redefine handleDouble as a virtual function and just handle the double type just on BDW later platforms, other platforms will just generate assert. V3: Delete the double utest case to avoid utest failure. Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-10-21Utest: fix random assert in function cl_kernel_link.Yang Rong1-8/+6
err is not used, should use status in function cl_kernel_compile and cl_kernel_link. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Ruiling Song <ruiling.song@intel.com>
2015-10-21add utests option: -j which specifies the 'number' of jobs (multi-thread)Meng Mengmeng5-13/+89
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>
2015-10-20use sampler to copy image_from_buffer to another image for verification.Luo Xionghu1-0/+21
Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
2015-10-14add utest runtime_use_host_ptr_imageGuo Yejun2-0/+73
Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
2015-10-13utests: event should be releasedPan Xiuli1-0/+1
This is also gpgpu event, which can cause leakes. Just release it. Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
2015-10-13utests: Added unit tests to test LLVM and ASM dump generation in a two step ↵Manasi Navare3-0/+208
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>
2015-09-22add bswap64 in utest.Luo Xionghu1-4/+59
Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
2015-09-22add utest for creating 2d image from buffer.Luo Xionghu2-0/+83
v2: check cl_khr_image2d_from_buffer support first; use CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT to allocate memory. v3: fix clGetDeviceInfo use. Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
2015-09-08utests: Added unit tests to test LLVM and ASM dump generation.Sirisha Gandikota1-0/+107
This patch adds 2 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 build options along with the dump file names. Methods added: 1) get_build_llvm_info() tests LLVM dump generation 2) get_build_asm_info() tests ASM dump generation Signed-off-by: Sirisha Gandikota <sirisha.gandikota@intel.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
2015-09-07Utest: Add -cl-kernel-arg-info to the utest test_get_arg_infoJunyan He1-1/+1
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
2015-08-27utests: refine image 1d buffer test case.Zhigang Gong1-44/+29
We need to test large image 1d buffer read and write testing. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
2015-08-11fix utest fail.Luo Xionghu1-1/+3
should use M_180_PI_F to improve the precision. Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
2015-08-10fix a powr function issue in cpu compiler mathMeng Mengmeng1-4/+20
In OpenCL spec, gentype powr(gentype x, gentype y). In the meantime, added edge tests for powr. Signed-off-by: Mengmeng meng <mengmeng.meng@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-08-05Utest: fix a builtin_powr_float fail when OCL_STRICT_CONFORMANCE=0.Yang Rong1-7/+8
Need ingore isnan and isinf when OCL_STRICT_CONFORMANCE=0. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
2015-07-15correct ULP value in utestsMeng Mengmeng5-16/+24
Set a global function in utests to get the right ULP value.
2015-07-14fix utest bug.Luo Xionghu1-1/+1
should query and use extension info by same API clGetPlatformInfo. Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
2015-07-14Fix comparison in if() check.Koop Mast1-1/+1
std::strstr() returns a char * or NULL if the substring isn't found not false. Signed-off-by: Koop Mast <kwm@rainbow-runner.nl> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
2015-07-02utest: Add test cases for half.Junyan He2-0/+925
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
2015-05-26build: use EXECUTE_PROCESS to replace the deprecated EXEC_PROGRAM.Zhigang Gong1-2/+2
I found EXEC_PROMGRAM may truncate the output variable for some case thus we may get incorrect generated unit test cases thus break the configuration some times. This patch use EXECUTE_PROCESS to replace all the deprecated EXEC_PROGRAM and it will not truncate the output variable of the command. v2: fix the error in examples/CMakeLists.txt. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Tested-by: "Meng, Mengmeng" <mengmeng.meng@intel.com>
2015-05-18Add a sanity test in clGetDeviceIDsRebecca N. Palmer1-0/+2
Run a small __local-using kernel in clGetDeviceIDs; if this returns the wrong result, return CL_DEVICE_NOT_FOUND. As far as I can see, there's no way to tell in advance (except unreliably with a global version check) whether __local-using batches will be accepted...so the easiest solution is probably to just try running one and see what result we get. Signed-off-by: Rebecca Palmer <rebecca_palmer@zoho.com> Reviewed-by: "Luo, Xionghu" <xionghu.luo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-05-15Add stuct argument indirect load test.Yang Rong3-3/+43
1. Enable compiler_argument_structure_indirect. 2. Add compiler_argument_structure_indirect, which has select address and load argument instruction. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@intel.com>
2015-05-13add utest for intel_sub_group_shuffleGuo Yejun2-1/+47
v2: correct kernel to be suitable for simd_width both 8 and 16 Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@intel.com>
2015-05-12rename __gen_ocl_simd_any/all to sub_group_any/allGuo Yejun3-8/+8
it is defined in https://www.khronos.org/registry/cl/extensions/intel/cl_intel_subgroups.txt Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-05-12rename __gen_ocl_get_simd_id/size to get_sub_group_id/sizeGuo Yejun3-8/+8
Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com> Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
2015-04-30utests: fix test case builtin_tgamma.Rebecca N. Palmer1-3/+16
Compare with tgamma instead of tgammaf for better accuracy. Include negative inputs, and handle the resulting denormals. Print maximum error found. Signed-off-by: Rebecca Palmer <rebecca_palmer@zoho.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-04-30Allow building with Python 3Rebecca N. Palmer1-1/+2
Make the build scripts work in both Python 2 and Python 3. (CMake prefers Python 2 if both are available, but will use Python 3 if only it is installed.) Signed-off-by: Rebecca Palmer <rebecca_palmer@zoho.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-04-29utest_pow: don't fail on declared lack of denormals.Rebecca N. Palmer1-2/+8
0.01**20.5 is denormal; at least Ivy Bridge does not support denormals and hence returns 0. As this is allowed by the OpenCL standard, it shouldn't fail the test. Signed-off-by: Rebecca Palmer <rebecca_palmer@zoho.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
2015-04-24add utest for __gen_ocl_get_simd_idGuo Yejun2-1/+35
Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
2015-04-24add utest for __gen_ocl_get_simd_sizeGuo Yejun2-1/+34
Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>