How to obtain max number of work-items?

I am to calculate something using a 1x1xN work-group. How could I know which N is maximum for my card?
And what if I pass a number greater than maxN to clEnqueueNDRangeKernel?

Thanks in advance.

I think you will have to retrieve the the max work item sizes for each dimension using clGetDeviceInfo() using CL_DEVICE_MAX_WORK_ITEM_SIZES and use those values while en-queuing the kernel.

Note that the kernel also has a maximum work group size associated with it as well. This can be retrieved with clGetKernelWorkGroupInfo using the CL_KERNEL_WORK_GROUP_SIZE constant.