summaryrefslogtreecommitdiff
path: root/utests
AgeCommit message (Collapse)AuthorFilesLines
2015-04-14utests: don't continue to run any case when fail to initialize device.Zhigang Gong1-1/+5
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
2015-03-13simple return if spir extension not supported.Luo Xionghu1-1/+1
Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-03-09Modify the utest case for bswap.Junyan He1-61/+142
We add the test case for uniform when doing the bswap. Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-03-09add utest for load spir binary.Luo Xionghu2-0/+91
To generate SPIR binary, please refer to the page https://github.com/KhronosGroup/SPIR. For llvm3.2, the command is "clang -cc1 -emit-llvm-bc -triple spir-unknown-unknown -cl-std=CL1.2 -include opencl_spir.h compiler_ceil.cl -o compiler_ceil32.spir" For llvm3.5, the option -cl-kernel-arg-info is required, and option -fno-builtin is required to avoid warning. v2: add missing load_program_from_spir.cpp file. Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-02-06Refine benchmark output.Chuanbo Weng4-9/+13
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>
2015-02-04Fix a bug of 1d image array test case.Junyan He1-6/+8
Because of the HW limitation, vertical stride is at least aligned to 2. For 1D array image, the data has interval. The image size is just twice as big as the buffer size we think. Use clEnqueueWriteImage is safe and fix this bug. Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-01-30Backend: fix one bug of long mad_sat.Junyan He1-5/+4
The bug caused because we didn't consider two overflow cases when type is long, which do not cause carry and are easy to be ignored. V2: Clean some verbose NOPs. Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-01-28fix clz utest issue.Luo Xionghu4-90/+103
should use clz function instead of __builtin_clz. add zero input check. v2: add signed type test. remove redundant case. v3: remove printf. Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-01-23add builtin function atan2pi and ldexpZhu Bingbing1-13/+25
The two cases are are generated by utest_math_gen.py. Signed-off-by: Zhu Bingbing <bingbingx.zhu@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-01-23update utest to loose userptr limitationGuo Yejun1-1/+1
the limitation is loosed from page size to cache line size alignment inside driver, update utest accordingly. Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-01-22Fix bug for bitcast test case because of long type.Junyan He1-5/+5
ulong and uint64_t have different size on i386 and i386_64, which cause the test case failure. Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-01-20Add test case for long bitcast.Junyan He2-0/+228
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-01-20Add long NOT test case.Junyan He2-0/+53
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-01-20Add test case for i64 div and rem.Junyan He2-0/+89
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-01-20Add test case for long mul_sat and mul_hiJunyan He2-0/+189
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-01-15add clz(count leading zero) utest.Luo Xionghu2-0/+68
this kernl calls the llvm __builtin_clz to generate llvm.clz function then call the gen instruction clz, different from the test compiler_clz_int, which use the fbh to implement. Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-01-12only build tests that do not need compiler when standalone compiler is providedGuo Yejun1-9/+19
the built test case is load_program_from_bin_file, it demos how to generate from source kernel compiler_ceil.cl to binary kernel compiler_ceil.bin with the standalone compiler for a specific gen pci id, and also demos how to load and execute the binary kernel when the compiler is not available in the running system. btw, please make sure compiler_ceil.bin is really updated if there is already one there, the safe way is to delete it first. Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-01-12add CMake option USE_STANDALONE_GBE_COMPILER and STANDALONE_GBE_COMPILER_DIRGuo Yejun1-2/+3
At some platforms with old c/c++ environment, C++11 features are not supported, it results in the failure to build the gbe compiler part which depends on LLVM/clang using C++11 features. The way to resolve is to build a standalone gbe compiler within another feasible system, and build beignet with the already built standalone gbe compiler by setting USE_STANDALONE_GBE_COMPILER=true. The path of the standalone compiler is /usr/local/lib/beignet as default or could be specified by STANDALONE_GBE_COMPILER_DIR. Once USE_STANDALONE_GBE_COMPILER is given, all the gbe compiler relative code will not be built any longer, only libcl.so and libgebinterp.so are built. And libcl.so is special for GEN_PCI_ID, which is queried from the building machie or could be specified as CMake option. v2: separate the CMake option name. update the commit comments. add back the script for gen pci id, and build driver with it. v3: add file FindStandaloneGbeCompiler.cmake to make the main cmakefile clean. Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-01-09utests: skip one test when it fail to open XDisplay.Zhigang Gong1-0/+4
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
2015-01-06fix utest build for some old gcc versionGuo Yejun5-26/+26
change the keyword from constexpr to const, update the code for explicit type conversion and std::map's iterator. Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-01-06Don't check some edge condtion in non-strict mode.Zhigang Gong1-2/+2
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
2015-01-04add edge case detection for powr in utestsMeng Mengmeng2-3/+6
power(x,y) return Nan for x<0 in spec, so add that for powr. Signed-off-by: Meng Mengmeng <mengmeng.meng@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2015-01-04utests: reduce test count.Zhigang Gong1-4/+5
No need to iterate so many times. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Tested-by: "Meng, Mengmeng" <mengmeng.meng@intel.com>
2014-12-16disable overflow utest test before llvm-3.5Luo Xionghu1-1/+6
the overflow intrinsics are introduced since llvm-3.5. v2: no need to exclude bswap test since llvm-3.3 supports it. v3: disable the overflow utest in cmake instead of code. Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2014-12-16change the utest summary codeZhu Bingbing2-5/+6
Signed-off-by: Zhu Bingbing<bingbingx.zhu@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2014-12-16Fix delete operator using.Yan Wang2-2/+2
The 2 delete operators work on array pointer. Signed-off-by: Yan Wang <yan.wang@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2014-12-15refine overflow utest to cover nsetc fail cases.Luo Xionghu1-0/+52
the original case only tested overflow when src1 is 1, add the test of src1 is max(this could trigger signed type uadd.with.overflow results incorrect, the fail was fixed in backend already, just update the utest.) Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2014-12-04refine bswap utest to cover nsetc fail cases.Luo Xionghu1-0/+7
two bswap call in one block would trigger nsetc failures. the fail was fixed in backend already, just update the utest. Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2014-12-04utests: Add const private array initialization test.Ruiling Song2-0/+28
Signed-off-by: Ruiling Song <ruiling.song@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2014-12-02utests: make utests maths ULP values consistent with specificationMeng Mengmeng3-8/+96
Signed-off-by: Meng Mengmeng <mengmeng.meng@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2014-12-02add utest of CL_MEM_ALLOC_HOST_PTRGuo Yejun2-0/+26
Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
2014-12-02refine utest of cl_mem_use_host_ptrGuo Yejun2-12/+1
From application perspective, userptr is transparent. App does not need to know if userptr is enabled or not, just invokes standard OpenCL APIs. Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
2014-12-02add test of cl_mem_use_host_ptr into benchmarkGuo Yejun2-0/+25
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>
2014-12-01utests: Add one case to test negative index array access.Zhigang Gong2-0/+46
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: Ruiling Song <ruiling.song@intel.com>
2014-11-27utests: fix indent in CMakeLists.txtZhigang Gong1-10/+10
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
2014-11-27add test for clCreateImageFromLibvaIntelGuo Yejun2-1/+218
Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2014-11-27utests: reduce work group size to 256 to satisfy BYT platform.Zhigang Gong1-1/+1
The maximum work group size on BYT is 256. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
2014-11-25utests: fix a typo in test cases.Zhigang Gong1-1/+1
due to a stray . at utests/builtin_pow.cpp:79:112. Reported by "Rebecca N. Palmer" <rebecca_palmer@zoho.com>. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
2014-11-25utests: fix work group size issue in compiler_fill_image_2d_array.Zhigang Gong1-2/+2
Reduce work group size from 1024 to 256 to fit all platforms. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
2014-11-11License: adjust all license version to LGPL v2.1+.Zhigang Gong19-19/+19
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>
2014-11-11utests: remove all shader toy test cases.Zhigang Gong2-88/+0
As we can't find the original license of these test cases, we have to remove them from beignet's unit test cases. Reported by "Rebecca N. Palmer" <rebecca_palmer@zoho.com>. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
2014-11-11Revert "add test for clCreateImageFromLibvaIntel"Zhigang Gong2-218/+1
This reverts commit 9e236b18542f2564e399bf13d4d1fbcc48a5ec9f.
2014-11-10use posix_memalign instead of aligned_alloc to be more compatibleGuo Yejun1-1/+4
At some systems, function aligned_alloc is not supported. From Linux Programmer's Manual: The function aligned_alloc() was added to glibc in version 2.16. The function posix_memalign() is available since glibc 2.1.91. V2: add check for return value of posix_memalign Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2014-11-10add test for clCreateImageFromLibvaIntelGuo Yejun2-1/+218
Signed-off-by: Guo Yejun <yejun.guo@intel.com> Tested-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2014-11-07add test for cl buffer created with CL_MEM_USE_HOST_PTRGuo Yejun2-0/+42
Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2014-11-06utests: add a test to trigger cl_float3 bug in clSetKernelArg.Ruiling Song2-0/+31
Signed-off-by: Ruiling Song <ruiling.song@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2014-11-06utests: fix bugs in builtin_tgamma().Rebecca Palmer1-2/+7
This patch is based on Rebecca's patch at: https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=Fix-pow-erf-tgamma.patch;att=3;bug=768090. And fixed another bug which we should not use an absolute error checking. We should use ULP and considering the strict conformance or non strict conformance state. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Signed-off-by: Rebecca Palmer <rebecca_palmer@zoho.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
2014-11-06utests: fix bugs in builtin_pow().Rebecca Palmer1-5/+11
This patch is based on Rebecca's patch at: https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=Fix-pow-erf-tgamma.patch;att=3;bug=768090. And fixed another bug which we should not use an absolute error checking. We should use ULP and considering the strict conformance or non strict conformance state. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Signed-off-by: Rebecca Palmer <rebecca_palmer@zoho.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
2014-11-06GBE: fix bug in erf()/erfc().Rebecca Palmer1-10/+10
erf/erfc diverge (instead of converging to 1 or 0) for arguments above about 2. This patch is from: https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=Fix-pow-erf-tgamma.patch;att=3;bug=768090 Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Signed-off-by: Rebecca Palmer <rebecca_palmer@zoho.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
2014-11-06utest: add new test that trigger an assignment operation bug in if.Chuanbo Weng2-0/+46
This test case shows that assignment operation in if block seems does not affect lvalue. Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>