Utest: Add a test case for validating built-in function get_global_size()
authorYi Sun <yi.sun@intel.com>
Thu, 13 Jun 2013 07:12:44 +0000 (15:12 +0800)
committerZhigang Gong <zhigang.gong@linux.intel.com>
Tue, 18 Jun 2013 06:30:42 +0000 (14:30 +0800)
commit7b326851ab83b153ebbc976096bfa2147066d6b7
tree08d47c808843b04a062abd1abb5382f760ae9fca
parent37687ac7c7b3b5bf5fb7ceeb9229c503afe74c87
Utest: Add a test case for validating built-in function get_global_size()

v1:
According to the OpenCL v1.1 & v1.2 chapter 6.11, the behavior of function get_global_size should be as following:

get_global_size(-1) = 1 (dimension:1)
get_global_size(0) = 3 (dimension:1)
get_global_size(1) = 1 (dimension:1)
get_global_size(2) = 1 (dimension:1)

get_global_size(-1) = 1 (dimension:2)
get_global_size(0) = 3 (dimension:2)
get_global_size(1) = 4 (dimension:2)
get_global_size(2) = 1 (dimension:2)
get_global_size(3) = 1 (dimension:2)

get_global_size(-1) = 1 (dimension:3)
get_global_size(0) = 3 (dimension:3)
get_global_size(1) = 4 (dimension:3)
get_global_size(2) = 5 (dimension:3)
get_global_size(3) = 1 (dimension:3)
get_global_size(4) = 1 (dimension:3)

if defined:
  globals[0] = 3;
  globals[1] = 4;
  globals[2] = 5;

v2:
    Handle different version.

    Add #if and #elif to make the test case be suitable to different version.

Signed-off-by: Yi Sun <yi.sun@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
kernels/builtin_global_size.cl [new file with mode: 0644]
utests/CMakeLists.txt
utests/builtin_global_size.cpp [new file with mode: 0644]