summaryrefslogtreecommitdiff
path: root/utests/cl_create_kernel.cpp
blob: 36a7c3826c97a3a22528ff40530a20f1ec053ee5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "utest_helper.hpp"

static void test_create_kernel(void)
{
  cl_ulong max_mem_size;
  cl_int status;

  OCL_CALL(clGetDeviceInfo, device, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof(max_mem_size), &max_mem_size, NULL);
  OCL_ASSERT(max_mem_size < (cl_ulong)-1);
  // increment the size so that following clCreateBuffer() would fail.
  ++max_mem_size;
  buf[0] = clCreateBuffer(ctx, 0, max_mem_size, NULL, &status);
  OCL_ASSERT(status == CL_INVALID_BUFFER_SIZE);
}

MAKE_UTEST_FROM_FUNCTION(test_create_kernel);