mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 00:59:44 -06:00
Update CLRun to have OCL 1.2
This commit is contained in:
203
Externals/CLRun/include/CL/cl_platform.h
vendored
203
Externals/CLRun/include/CL/cl_platform.h
vendored
@ -1,5 +1,5 @@
|
||||
/**********************************************************************************
|
||||
* Copyright (c) 2008-2010 The Khronos Group Inc.
|
||||
* Copyright (c) 2008-2012 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and/or associated documentation files (the
|
||||
@ -21,7 +21,7 @@
|
||||
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
**********************************************************************************/
|
||||
|
||||
/* $Revision: 11707 $ on $Date: 2010-06-13 23:30:16 -0700 (Sun, 13 Jun 2010) $ */
|
||||
/* $Revision: 11803 $ on $Date: 2010-06-25 10:02:12 -0700 (Fri, 25 Jun 2010) $ */
|
||||
|
||||
#ifndef __CL_PLATFORM_H
|
||||
#define __CL_PLATFORM_H
|
||||
@ -36,21 +36,85 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define CL_API_ENTRY
|
||||
#define CL_API_CALL __stdcall
|
||||
#define CL_API_ENTRY
|
||||
#define CL_API_CALL __stdcall
|
||||
#define CL_CALLBACK __stdcall
|
||||
#else
|
||||
#define CL_API_ENTRY
|
||||
#define CL_API_CALL
|
||||
#define CL_API_ENTRY
|
||||
#define CL_API_CALL
|
||||
#define CL_CALLBACK
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define CL_API_SUFFIX__VERSION_1_0 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
|
||||
#define CL_API_SUFFIX__VERSION_1_1
|
||||
#define CL_EXTENSION_WEAK_LINK __attribute__((weak_import))
|
||||
#define CL_EXTENSION_WEAK_LINK __attribute__((weak_import))
|
||||
#define CL_API_SUFFIX__VERSION_1_0 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
|
||||
#define CL_EXT_SUFFIX__VERSION_1_0 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
|
||||
#define CL_API_SUFFIX__VERSION_1_1 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
#define GCL_API_SUFFIX__VERSION_1_1 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
#define CL_EXT_SUFFIX__VERSION_1_1 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
|
||||
|
||||
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
|
||||
#define CL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
|
||||
#define GCL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
|
||||
#define CL_EXT_SUFFIX__VERSION_1_2 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
|
||||
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
|
||||
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
|
||||
#else
|
||||
#warning This path should never happen outside of internal operating system development. AvailabilityMacros do not function correctly here!
|
||||
#define CL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
#define GCL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
#define CL_EXT_SUFFIX__VERSION_1_2 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
#endif
|
||||
#else
|
||||
#define CL_API_SUFFIX__VERSION_1_0
|
||||
#define CL_API_SUFFIX__VERSION_1_1
|
||||
#define CL_EXTENSION_WEAK_LINK
|
||||
#define CL_EXTENSION_WEAK_LINK
|
||||
#define CL_API_SUFFIX__VERSION_1_0
|
||||
#define CL_EXT_SUFFIX__VERSION_1_0
|
||||
#define CL_API_SUFFIX__VERSION_1_1
|
||||
#define CL_EXT_SUFFIX__VERSION_1_1
|
||||
#define CL_API_SUFFIX__VERSION_1_2
|
||||
#define CL_EXT_SUFFIX__VERSION_1_2
|
||||
|
||||
#ifdef __GNUC__
|
||||
#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
|
||||
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
|
||||
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
|
||||
#else
|
||||
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED __attribute__((deprecated))
|
||||
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
|
||||
#endif
|
||||
|
||||
#ifdef CL_USE_DEPRECATED_OPENCL_1_1_APIS
|
||||
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
|
||||
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
|
||||
#else
|
||||
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED __attribute__((deprecated))
|
||||
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
|
||||
#endif
|
||||
#elif _WIN32
|
||||
#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
|
||||
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
|
||||
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
|
||||
#else
|
||||
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
|
||||
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED __declspec(deprecated)
|
||||
#endif
|
||||
|
||||
#ifdef CL_USE_DEPRECATED_OPENCL_1_1_APIS
|
||||
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
|
||||
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
|
||||
#else
|
||||
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
|
||||
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED __declspec(deprecated)
|
||||
#endif
|
||||
#else
|
||||
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
|
||||
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
|
||||
|
||||
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
|
||||
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (defined (_WIN32) && defined(_MSC_VER))
|
||||
@ -108,14 +172,40 @@ typedef double cl_double;
|
||||
#define CL_DBL_MIN 2.225073858507201383090e-308
|
||||
#define CL_DBL_EPSILON 2.220446049250313080847e-16
|
||||
|
||||
#define CL_M_E 2.718281828459045090796
|
||||
#define CL_M_LOG2E 1.442695040888963387005
|
||||
#define CL_M_LOG10E 0.434294481903251816668
|
||||
#define CL_M_LN2 0.693147180559945286227
|
||||
#define CL_M_LN10 2.302585092994045901094
|
||||
#define CL_M_PI 3.141592653589793115998
|
||||
#define CL_M_PI_2 1.570796326794896557999
|
||||
#define CL_M_PI_4 0.785398163397448278999
|
||||
#define CL_M_1_PI 0.318309886183790691216
|
||||
#define CL_M_2_PI 0.636619772367581382433
|
||||
#define CL_M_2_SQRTPI 1.128379167095512558561
|
||||
#define CL_M_SQRT2 1.414213562373095145475
|
||||
#define CL_M_SQRT1_2 0.707106781186547572737
|
||||
|
||||
#define CL_M_E_F 2.71828174591064f
|
||||
#define CL_M_LOG2E_F 1.44269502162933f
|
||||
#define CL_M_LOG10E_F 0.43429449200630f
|
||||
#define CL_M_LN2_F 0.69314718246460f
|
||||
#define CL_M_LN10_F 2.30258512496948f
|
||||
#define CL_M_PI_F 3.14159274101257f
|
||||
#define CL_M_PI_2_F 1.57079637050629f
|
||||
#define CL_M_PI_4_F 0.78539818525314f
|
||||
#define CL_M_1_PI_F 0.31830987334251f
|
||||
#define CL_M_2_PI_F 0.63661974668503f
|
||||
#define CL_M_2_SQRTPI_F 1.12837922573090f
|
||||
#define CL_M_SQRT2_F 1.41421353816986f
|
||||
#define CL_M_SQRT1_2_F 0.70710676908493f
|
||||
|
||||
#define CL_NAN (CL_INFINITY - CL_INFINITY)
|
||||
#define CL_HUGE_VALF ((cl_float) 1e50)
|
||||
#define CL_HUGE_VAL ((cl_double) 1e500)
|
||||
#define CL_MAXFLOAT CL_FLT_MAX
|
||||
#define CL_INFINITY CL_HUGE_VALF
|
||||
|
||||
#define CL_CALLBACK __stdcall
|
||||
|
||||
#else
|
||||
|
||||
#include <stdint.h>
|
||||
@ -173,6 +263,34 @@ typedef double cl_double __attribute__((aligned(8)));
|
||||
#define CL_DBL_MIN 0x1.0p-1022
|
||||
#define CL_DBL_EPSILON 0x1.0p-52
|
||||
|
||||
#define CL_M_E 2.718281828459045090796
|
||||
#define CL_M_LOG2E 1.442695040888963387005
|
||||
#define CL_M_LOG10E 0.434294481903251816668
|
||||
#define CL_M_LN2 0.693147180559945286227
|
||||
#define CL_M_LN10 2.302585092994045901094
|
||||
#define CL_M_PI 3.141592653589793115998
|
||||
#define CL_M_PI_2 1.570796326794896557999
|
||||
#define CL_M_PI_4 0.785398163397448278999
|
||||
#define CL_M_1_PI 0.318309886183790691216
|
||||
#define CL_M_2_PI 0.636619772367581382433
|
||||
#define CL_M_2_SQRTPI 1.128379167095512558561
|
||||
#define CL_M_SQRT2 1.414213562373095145475
|
||||
#define CL_M_SQRT1_2 0.707106781186547572737
|
||||
|
||||
#define CL_M_E_F 2.71828174591064f
|
||||
#define CL_M_LOG2E_F 1.44269502162933f
|
||||
#define CL_M_LOG10E_F 0.43429449200630f
|
||||
#define CL_M_LN2_F 0.69314718246460f
|
||||
#define CL_M_LN10_F 2.30258512496948f
|
||||
#define CL_M_PI_F 3.14159274101257f
|
||||
#define CL_M_PI_2_F 1.57079637050629f
|
||||
#define CL_M_PI_4_F 0.78539818525314f
|
||||
#define CL_M_1_PI_F 0.31830987334251f
|
||||
#define CL_M_2_PI_F 0.63661974668503f
|
||||
#define CL_M_2_SQRTPI_F 1.12837922573090f
|
||||
#define CL_M_SQRT2_F 1.41421353816986f
|
||||
#define CL_M_SQRT1_2_F 0.70710676908493f
|
||||
|
||||
#if defined( __GNUC__ )
|
||||
#define CL_HUGE_VALF __builtin_huge_valf()
|
||||
#define CL_HUGE_VAL __builtin_huge_val()
|
||||
@ -186,13 +304,11 @@ typedef double cl_double __attribute__((aligned(8)));
|
||||
#define CL_MAXFLOAT CL_FLT_MAX
|
||||
#define CL_INFINITY CL_HUGE_VALF
|
||||
|
||||
#define CL_CALLBACK
|
||||
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
/* Mirror types to GL types. Mirror types allow us to avoid deciding which headers to load based on whether we are using GL or GLES here. */
|
||||
/* Mirror types to GL types. Mirror types allow us to avoid deciding which 87s to load based on whether we are using GL or GLES here. */
|
||||
typedef unsigned int cl_GLuint;
|
||||
typedef int cl_GLint;
|
||||
typedef unsigned int cl_GLenum;
|
||||
@ -389,6 +505,9 @@ typedef union
|
||||
#endif
|
||||
}cl_char4;
|
||||
|
||||
/* cl_char3 is identical in size, alignment and behavior to cl_char4. See section 6.1.5. */
|
||||
typedef cl_char4 cl_char3;
|
||||
|
||||
typedef union
|
||||
{
|
||||
cl_char CL_ALIGNED(8) s[8];
|
||||
@ -461,6 +580,9 @@ typedef union
|
||||
#endif
|
||||
}cl_uchar4;
|
||||
|
||||
/* cl_uchar3 is identical in size, alignment and behavior to cl_uchar4. See section 6.1.5. */
|
||||
typedef cl_uchar4 cl_uchar3;
|
||||
|
||||
typedef union
|
||||
{
|
||||
cl_uchar CL_ALIGNED(8) s[8];
|
||||
@ -533,6 +655,9 @@ typedef union
|
||||
#endif
|
||||
}cl_short4;
|
||||
|
||||
/* cl_short3 is identical in size, alignment and behavior to cl_short4. See section 6.1.5. */
|
||||
typedef cl_short4 cl_short3;
|
||||
|
||||
typedef union
|
||||
{
|
||||
cl_short CL_ALIGNED(16) s[8];
|
||||
@ -605,6 +730,9 @@ typedef union
|
||||
#endif
|
||||
}cl_ushort4;
|
||||
|
||||
/* cl_ushort3 is identical in size, alignment and behavior to cl_ushort4. See section 6.1.5. */
|
||||
typedef cl_ushort4 cl_ushort3;
|
||||
|
||||
typedef union
|
||||
{
|
||||
cl_ushort CL_ALIGNED(16) s[8];
|
||||
@ -676,6 +804,9 @@ typedef union
|
||||
#endif
|
||||
}cl_int4;
|
||||
|
||||
/* cl_int3 is identical in size, alignment and behavior to cl_int4. See section 6.1.5. */
|
||||
typedef cl_int4 cl_int3;
|
||||
|
||||
typedef union
|
||||
{
|
||||
cl_int CL_ALIGNED(32) s[8];
|
||||
@ -748,6 +879,9 @@ typedef union
|
||||
#endif
|
||||
}cl_uint4;
|
||||
|
||||
/* cl_uint3 is identical in size, alignment and behavior to cl_uint4. See section 6.1.5. */
|
||||
typedef cl_uint4 cl_uint3;
|
||||
|
||||
typedef union
|
||||
{
|
||||
cl_uint CL_ALIGNED(32) s[8];
|
||||
@ -819,6 +953,9 @@ typedef union
|
||||
#endif
|
||||
}cl_long4;
|
||||
|
||||
/* cl_long3 is identical in size, alignment and behavior to cl_long4. See section 6.1.5. */
|
||||
typedef cl_long4 cl_long3;
|
||||
|
||||
typedef union
|
||||
{
|
||||
cl_long CL_ALIGNED(64) s[8];
|
||||
@ -891,6 +1028,9 @@ typedef union
|
||||
#endif
|
||||
}cl_ulong4;
|
||||
|
||||
/* cl_ulong3 is identical in size, alignment and behavior to cl_ulong4. See section 6.1.5. */
|
||||
typedef cl_ulong4 cl_ulong3;
|
||||
|
||||
typedef union
|
||||
{
|
||||
cl_ulong CL_ALIGNED(64) s[8];
|
||||
@ -964,6 +1104,9 @@ typedef union
|
||||
#endif
|
||||
}cl_float4;
|
||||
|
||||
/* cl_float3 is identical in size, alignment and behavior to cl_float4. See section 6.1.5. */
|
||||
typedef cl_float4 cl_float3;
|
||||
|
||||
typedef union
|
||||
{
|
||||
cl_float CL_ALIGNED(32) s[8];
|
||||
@ -1036,6 +1179,9 @@ typedef union
|
||||
#endif
|
||||
}cl_double4;
|
||||
|
||||
/* cl_double3 is identical in size, alignment and behavior to cl_double4. See section 6.1.5. */
|
||||
typedef cl_double4 cl_double3;
|
||||
|
||||
typedef union
|
||||
{
|
||||
cl_double CL_ALIGNED(64) s[8];
|
||||
@ -1077,6 +1223,29 @@ typedef union
|
||||
#endif
|
||||
}cl_double16;
|
||||
|
||||
/* Macro to facilitate debugging
|
||||
* Usage:
|
||||
* Place CL_PROGRAM_STRING_DEBUG_INFO on the line before the first line of your source.
|
||||
* The first line ends with: CL_PROGRAM_STRING_DEBUG_INFO \"
|
||||
* Each line thereafter of OpenCL C source must end with: \n\
|
||||
* The last line ends in ";
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* const char *my_program = CL_PROGRAM_STRING_DEBUG_INFO "\
|
||||
* kernel void foo( int a, float * b ) \n\
|
||||
* { \n\
|
||||
* // my comment \n\
|
||||
* *b[ get_global_id(0)] = a; \n\
|
||||
* } \n\
|
||||
* ";
|
||||
*
|
||||
* This should correctly set up the line, (column) and file information for your source
|
||||
* string so you can do source level debugging.
|
||||
*/
|
||||
#define __CL_STRINGIFY( _x ) # _x
|
||||
#define _CL_STRINGIFY( _x ) __CL_STRINGIFY( _x )
|
||||
#define CL_PROGRAM_STRING_DEBUG_INFO "#line " _CL_STRINGIFY(__LINE__) " \"" __FILE__ "\" \n\n"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Reference in New Issue
Block a user