diff options
Diffstat (limited to 'resources/includes/CL')
-rw-r--r-- | resources/includes/CL/cl.h | 76 | ||||
-rw-r--r-- | resources/includes/CL/cl_gl.h | 2 | ||||
-rw-r--r-- | resources/includes/CL/cl_platform.h | 225 |
3 files changed, 158 insertions, 145 deletions
diff --git a/resources/includes/CL/cl.h b/resources/includes/CL/cl.h index 4a2c6712..6c3011fc 100644 --- a/resources/includes/CL/cl.h +++ b/resources/includes/CL/cl.h @@ -21,6 +21,8 @@ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. ******************************************************************************/ +/* $Revision: 8406 $ on $Date: 2009-06-12 10:56:01 -0700 (Fri, 12 Jun 2009) $ */ + #ifndef __OPENCL_CL_H #define __OPENCL_CL_H @@ -85,13 +87,56 @@ typedef struct _cl_image_format { cl_channel_type image_channel_data_type; } cl_image_format; + +/******************************************************************************/ + +// Macro names and corresponding values defined by OpenCL + +#define CL_CHAR_BIT 8 +#define CL_SCHAR_MAX 127 +#define CL_SCHAR_MIN (-127-1) +#define CL_CHAR_MAX CL_SCHAR_MAX +#define CL_CHAR_MIN CL_SCHAR_MIN +#define CL_UCHAR_MAX 255 +#define CL_SHRT_MAX 32767 +#define CL_SHRT_MIN (-32767-1) +#define CL_USHRT_MAX 65535 +#define CL_INT_MAX 2147483647 +#define CL_INT_MIN (-2147483647-1) +#define CL_UINT_MAX 0xffffffffU +#define CL_LONG_MAX ((cl_long) 0x7FFFFFFFFFFFFFFFLL) +#define CL_LONG_MIN ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL) +#define CL_ULONG_MAX ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL) + +#define CL_FLT_DIG 6 +#define CL_FLT_MANT_DIG 24 +#define CL_FLT_MAX_10_EXP +38 +#define CL_FLT_MAX_EXP +128 +#define CL_FLT_MIN_10_EXP -37 +#define CL_FLT_MIN_EXP -125 +#define CL_FLT_RADIX 2 +#define CL_FLT_MAX 0x1.fffffep127f +#define CL_FLT_MIN 0x1.0p-126f +#define CL_FLT_EPSILON 0x1.0p-23f + +#define CL_DBL_DIG 15 +#define CL_DBL_MANT_DIG 53 +#define CL_DBL_MAX_10_EXP +308 +#define CL_DBL_MAX_EXP +1024 +#define CL_DBL_MIN_10_EXP -307 +#define CL_DBL_MIN_EXP -1021 +#define CL_DBL_RADIX 2 +#define CL_DBL_MAX 0x1.fffffffffffffp1023 +#define CL_DBL_MIN 0x1.0p-1022 +#define CL_DBL_EPSILON 0x1.0p-52 + /******************************************************************************/ // Error Codes #define CL_SUCCESS 0 #define CL_DEVICE_NOT_FOUND -1 #define CL_DEVICE_NOT_AVAILABLE -2 -#define CL_DEVICE_COMPILER_NOT_AVAILABLE -3 +#define CL_COMPILER_NOT_AVAILABLE -3 #define CL_MEM_OBJECT_ALLOCATION_FAILURE -4 #define CL_OUT_OF_RESOURCES -5 #define CL_OUT_OF_HOST_MEMORY -6 @@ -148,6 +193,7 @@ typedef struct _cl_image_format { #define CL_PLATFORM_VERSION 0x0901 #define CL_PLATFORM_NAME 0x0902 #define CL_PLATFORM_VENDOR 0x0903 +#define CL_PLATFORM_EXTENSIONS 0x0904 // cl_device_type - bitfield #define CL_DEVICE_TYPE_DEFAULT (1 << 0) @@ -208,10 +254,6 @@ typedef struct _cl_image_format { #define CL_DEVICE_EXTENSIONS 0x1030 #define CL_DEVICE_PLATFORM 0x1031 -// cl_device_address_info - bitfield -#define CL_DEVICE_ADDRESS_32_BITS (1 << 0) -#define CL_DEVICE_ADDRESS_64_BITS (1 << 1) - // cl_device_fp_config - bitfield #define CL_FP_DENORM (1 << 0) #define CL_FP_INF_NAN (1 << 1) @@ -239,9 +281,10 @@ typedef struct _cl_image_format { // cl_context_info #define CL_CONTEXT_REFERENCE_COUNT 0x1080 -#define CL_CONTEXT_NUM_DEVICES 0x1081 -#define CL_CONTEXT_DEVICES 0x1082 -#define CL_CONTEXT_PROPERTIES 0x1083 +#define CL_CONTEXT_DEVICES 0x1081 +#define CL_CONTEXT_PROPERTIES 0x1082 + +// cl_context_properties #define CL_CONTEXT_PLATFORM 0x1084 // cl_command_queue_info @@ -385,10 +428,8 @@ typedef struct _cl_image_format { #define CL_COMMAND_MAP_IMAGE 0x11FC #define CL_COMMAND_UNMAP_MEM_OBJECT 0x11FD #define CL_COMMAND_MARKER 0x11FE -#define CL_COMMAND_WAIT_FOR_EVENTS 0x11FF -#define CL_COMMAND_BARRIER 0x1200 -#define CL_COMMAND_ACQUIRE_GL_OBJECTS 0x1201 -#define CL_COMMAND_RELEASE_GL_OBJECTS 0x1202 +#define CL_COMMAND_ACQUIRE_GL_OBJECTS 0x11FF +#define CL_COMMAND_RELEASE_GL_OBJECTS 0x1200 // command execution status #define CL_COMPLETE 0x0 @@ -834,7 +875,7 @@ clEnqueueTask(cl_command_queue /* command_queue */, extern CL_API_ENTRY cl_int CL_API_CALL clEnqueueNativeKernel(cl_command_queue /* command_queue */, - void (*user_func)(void *), + void (*user_func)(void *), void * /* args */, size_t /* cb_args */, cl_uint /* num_mem_objects */, @@ -856,6 +897,15 @@ clEnqueueWaitForEvents(cl_command_queue /* command_queue */, extern CL_API_ENTRY cl_int CL_API_CALL clEnqueueBarrier(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0; +// Extension function access +// +// Returns the extension function address for the given function name, +// or NULL if a valid function can not be found. The client must +// check to make sure the address is not NULL, before using or +// calling the returned function address. +// +void *clGetExtensionFunctionAddress(const char * /* func_name */) CL_API_SUFFIX__VERSION_1_0; + #ifdef __cplusplus } #endif diff --git a/resources/includes/CL/cl_gl.h b/resources/includes/CL/cl_gl.h index 4eab6d7a..d4c427cd 100644 --- a/resources/includes/CL/cl_gl.h +++ b/resources/includes/CL/cl_gl.h @@ -21,6 +21,8 @@ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. **********************************************************************************/ +/* $Revision: 8407 $ on $Date: 2009-06-12 10:56:38 -0700 (Fri, 12 Jun 2009) $ */ + #ifndef __OPENCL_CL_GL_H #define __OPENCL_CL_GL_H diff --git a/resources/includes/CL/cl_platform.h b/resources/includes/CL/cl_platform.h index 775e9ae8..20791030 100644 --- a/resources/includes/CL/cl_platform.h +++ b/resources/includes/CL/cl_platform.h @@ -21,11 +21,11 @@ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. **********************************************************************************/ +/* $Revision: 8407 $ on $Date: 2009-06-12 10:56:38 -0700 (Fri, 12 Jun 2009) $ */ + #ifndef __CL_PLATFORM_H #define __CL_PLATFORM_H -#define CL_PLATFORM_NVIDIA 0x3001 - #ifdef __APPLE__ /* Contains #defines for AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER below */ #include <AvailabilityMacros.h> @@ -35,93 +35,100 @@ extern "C" { #endif -#ifdef _WIN32 - #ifdef __CL_EXPORTS - #define CL_API_ENTRY __declspec(dllexport) - #else - #define CL_API_ENTRY __declspec(dllimport) - #endif - #define CL_API_CALL +#define CL_API_ENTRY +#define CL_API_CALL +#ifdef __APPLE__ +#define CL_API_SUFFIX__VERSION_1_0 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER +#define CL_EXTENSION_WEAK_LINK __attribute__((weak_import)) #else - #define CL_API_ENTRY - #define CL_API_CALL +#define CL_API_SUFFIX__VERSION_1_0 +#define CL_EXTENSION_WEAK_LINK #endif -#if defined(__APPLE__) - #define CL_API_SUFFIX__VERSION_1_0 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER -#else - #define CL_API_SUFFIX__VERSION_1_0 -#endif +#if (defined (WIN32) && (_MSC_VER)) + +/* scalar types */ +typedef signed __int8 cl_char; +typedef unsigned __int8 cl_uchar; +typedef signed __int16 cl_short; +typedef unsigned __int16 cl_ushort; +typedef signed __int32 cl_int; +typedef unsigned __int32 cl_uint; +typedef signed __int64 cl_long; +typedef unsigned __int64 cl_ulong; + +typedef unsigned __int16 cl_half; +typedef float cl_float; +typedef double cl_double; + -#define clGetExtensionFunctionAddress(name) (NULL) - -/* scalar and vector types */ -#ifdef _WIN32 -typedef __int8 cl_char; -typedef unsigned __int8 cl_uchar; -typedef __int16 cl_short; -typedef unsigned __int16 cl_ushort; -typedef __int32 cl_int; -typedef unsigned __int32 cl_uint; -typedef __int64 cl_long; -typedef unsigned __int64 cl_ulong; - -typedef unsigned __int16 cl_half; -typedef float cl_float; -typedef double cl_double; /* - * OpenCL requires all types be naturally aligned, but Win32 already does - * that. (I think.) + * Vector types + * + * Note: OpenCL requires that all types be naturally aligned. + * This means that vector types must be naturally aligned. + * For example, a vector of four floats must be aligned to + * a 16 byte boundary (calculated as 4 * the natural 4-byte + * alignment of the float). The alignment qualifiers here + * will only function properly if your compiler supports them + * and if you don't actively work to defeat them. For example, + * in order for a cl_float4 to be 16 byte aligned in a struct, + * the start of the struct must itself be 16-byte aligned. + * + * Maintaining proper alignment is the user's responsibility. */ -typedef __int8 cl_char2[2]; -typedef __int8 cl_char4[4]; -typedef __int8 cl_char8[8]; -typedef __int8 cl_char16[16]; -typedef unsigned __int8 cl_uchar2[2]; -typedef unsigned __int8 cl_uchar4[4]; -typedef unsigned __int8 cl_uchar8[8]; -typedef unsigned __int8 cl_uchar16[16]; - -typedef __int16 cl_short2[2]; -typedef __int16 cl_short4[4]; -typedef __int16 cl_short8[8]; -typedef __int16 cl_short16[16]; -typedef unsigned __int16 cl_ushort2[2]; -typedef unsigned __int16 cl_ushort4[4]; -typedef unsigned __int16 cl_ushort8[8]; -typedef unsigned __int16 cl_ushort16[16]; - -typedef __int32 cl_int2[2]; -typedef __int32 cl_int4[4]; -typedef __int32 cl_int8[8]; -typedef __int32 cl_int16[16]; -typedef unsigned __int32 cl_uint2[2]; -typedef unsigned __int32 cl_uint4[4]; -typedef unsigned __int32 cl_uint8[8]; -typedef unsigned __int32 cl_uint16[16]; - -typedef __int64 cl_long2[2]; -typedef __int64 cl_long4[4]; -typedef __int64 cl_long8[8]; -typedef __int64 cl_long16[16]; -typedef unsigned __int64 cl_ulong2[2]; -typedef unsigned __int64 cl_ulong4[4]; -typedef unsigned __int64 cl_ulong8[8]; -typedef unsigned __int64 cl_ulong16[16]; - -typedef float cl_float2[2]; -typedef float cl_float4[4]; -typedef float cl_float8[8]; -typedef float cl_float16[16]; - -typedef double cl_double2[2]; -typedef double cl_double4[4]; -typedef double cl_double8[8]; -typedef double cl_double16[16]; - -#else // _WIN32 +typedef signed __int8 cl_char2[2]; +typedef signed __int8 cl_char4[4]; +typedef signed __int8 cl_char8[8]; +typedef signed __int8 cl_char16[16]; +typedef unsigned __int8 cl_uchar2[2]; +typedef unsigned __int8 cl_uchar4[4]; +typedef unsigned __int8 cl_uchar8[8]; +typedef unsigned __int8 cl_uchar16[16]; + +typedef signed __int16 cl_short2[2]; +typedef signed __int16 cl_short4[4]; +typedef signed __int16 cl_short8[8]; +typedef signed __int16 cl_short16[16]; +typedef unsigned __int16 cl_ushort2[2]; +typedef unsigned __int16 cl_ushort4[4]; +typedef unsigned __int16 cl_ushort8[8]; +typedef unsigned __int16 cl_ushort16[16]; + +typedef signed __int32 cl_int2[2]; +typedef signed __int32 cl_int4[4]; +typedef signed __int32 cl_int8[8]; +typedef signed __int32 cl_int16[16]; +typedef unsigned __int32 cl_uint2[2]; +typedef unsigned __int32 cl_uint4[4]; +typedef unsigned __int32 cl_uint8[8]; +typedef unsigned __int32 cl_uint16[16]; + +typedef signed __int64 cl_long2[2]; +typedef signed __int64 cl_long4[4]; +typedef signed __int64 cl_long8[8]; +typedef signed __int64 cl_long16[16]; +typedef unsigned __int64 cl_ulong2[2]; +typedef unsigned __int64 cl_ulong4[4]; +typedef unsigned __int64 cl_ulong8[8]; +typedef unsigned __int64 cl_ulong16[16]; + +typedef float cl_float2[2]; +typedef float cl_float4[4]; +typedef float cl_float8[8]; +typedef float cl_float16[16]; + +typedef double cl_double2[2]; +typedef double cl_double4[4]; +typedef double cl_double8[8]; +typedef double cl_double16[16]; +/* There are no vector types for half */ + +#else #include <stdint.h> + +/* scalar types */ typedef int8_t cl_char; typedef uint8_t cl_uchar; typedef int16_t cl_short __attribute__((aligned(2))); @@ -134,7 +141,10 @@ typedef uint64_t cl_ulong __attribute__((aligned(8))); typedef uint16_t cl_half __attribute__((aligned(2))); typedef float cl_float __attribute__((aligned(4))); typedef double cl_double __attribute__((aligned(8))); + /* + * Vector types + * * Note: OpenCL requires that all types be naturally aligned. * This means that vector types must be naturally aligned. * For example, a vector of four floats must be aligned to @@ -194,62 +204,13 @@ typedef double cl_double8[8] __attribute__((aligned(64))); typedef double cl_double16[16] __attribute__((aligned(128))); /* There are no vector types for half */ +#endif -#endif // WIN32 #include <stddef.h> -/* and a few goodies to go with them */ -#define CL_CHAR_BIT 8 -#define CL_SCHAR_MAX 127 -#define CL_SCHAR_MIN (-127-1) -#define CL_CHAR_MAX CL_SCHAR_MAX -#define CL_CHAR_MIN CL_SCHAR_MIN -#define CL_UCHAR_MAX 255 -#define CL_SHRT_MAX 32767 -#define CL_SHRT_MIN (-32767-1) -#define CL_USHRT_MAX 65535 -#define CL_INT_MAX 2147483647 -#define CL_INT_MIN (-2147483647-1) -//#define CL_UINT_MAX 0xffffffffU -#define CL_LONG_MAX ((cl_long) 0x7FFFFFFFFFFFFFFFLL) -#define CL_LONG_MIN ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL) -#define CL_ULONG_MAX ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL) - -#define CL_FLT_DIG 6 -#define CL_FLT_MANT_DIG 24 -#define CL_FLT_MAX_10_EXP +38 -#define CL_FLT_MAX_EXP +128 -#define CL_FLT_MIN_10_EXP -37 -#define CL_FLT_MIN_EXP -125 -#define CL_FLT_RADIX 2 -#ifdef WIN32 -#define CL_FLT_MAX 3.402823466e+38F -#define CL_FLT_MIN 1.175494351e-38F -#define CL_FLT_EPSILON 1.192092896e-07F -#else -#define CL_FLT_MAX 0x1.fffffep127f -#define CL_FLT_MIN 0x1.0p-126f -#define CL_FLT_EPSILON 0x1.0p-23f -#endif -#define CL_DBL_DIG 15 -#define CL_DBL_MANT_DIG 53 -#define CL_DBL_MAX_10_EXP +308 -#define CL_DBL_MAX_EXP +1024 -#define CL_DBL_MIN_10_EXP -307 -#define CL_DBL_MIN_EXP -1021 -#define CL_DBL_RADIX 2 -#ifdef WIN32 -#define CL_DBL_MAX 1.7976931348623158e+308 -#define CL_DBL_MIN 2.2250738585072014e-308 -#define CL_DBL_EPSILON 2.2204460492503131e-016 -#else -#define CL_DBL_MAX 0x1.fffffffffffffp1023 -#define CL_DBL_MIN 0x1.0p-1022 -#define CL_DBL_EPSILON 0x1.0p-52 -#endif #ifdef __cplusplus } #endif -#endif // __CL_PLATFORM_H
\ No newline at end of file +#endif // __CL_PLATFORM_H |