Description

The macro names given in the following list must use the values specified. The values shall all be constant expressions suitable for use in #if preprocessing directives.

#define CHAR_BIT        8
#define CHAR_MAX        SCHAR_MAX
#define CHAR_MIN        SCHAR_MIN
#define INT_MAX         2147483647
#define INT_MIN         (-2147483647 - 1)
#define LONG_MAX        0x7fffffffffffffffL
#define LONG_MIN        (-0x7fffffffffffffffL - 1)
#define SCHAR_MAX       127
#define SCHAR_MIN       (-127 - 1)
#define SHRT_MAX        32767
#define SHRT_MIN        (-32767 - 1)
#define UCHAR_MAX       255
#define USHRT_MAX       65535
#define UINT_MAX        0xffffffff
#define ULONG_MAX       0xffffffffffffffffUL

The following table describes the built-in macro names given above in the OpenCL C programming language and the corresponding macro names available to the application.

Macro in OpenCL Language

Macro for application

CHAR_BIT

CL_CHAR_BIT

CHAR_MAX

CL_CHAR_MAX

CHAR_MIN

CL_CHAR_MIN

INT_MAX

CL_INT_MAX

INT_MIN

CL_INT_MIN

LONG_MAX

CL_LONG_MAX

LONG_MIN

CL_LONG_MIN

SCHAR_MAX

CL_SCHAR_MAX

SCHAR_MIN

CL_SCHAR_MIN

SHRT_MAX

CL_SHRT_MAX

SHRT_MIN

CL_SHRT_MIN

UCHAR_MAX

CL_UCHAR_MAX

USHRT_MAX

CL_USHRT_MAX

UINT_MAX

CL_UINT_MAX

ULONG_MAX

CL_ULONG_MAX

See Also

Document Notes

For more information, see the OpenCL C Specification

This page is extracted from the OpenCL C Specification. Fixes and changes should be made to the Specification, not directly.

Copyright (c) 2014-2020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.