mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 03:00:11 +01:00
include: sync OpenCL headers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35241>
This commit is contained in:
parent
034ac06c64
commit
924c76b7e5
3 changed files with 48 additions and 32 deletions
|
|
@ -24,6 +24,12 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER) && __CL_HAS_ANON_STRUCT__
|
||||
/* Disable warning C4201: nonstandard extension used : nameless struct/union */
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4201 )
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
typedef struct _cl_platform_id * cl_platform_id;
|
||||
|
|
@ -133,39 +139,14 @@ typedef struct _cl_image_desc {
|
|||
size_t image_slice_pitch;
|
||||
cl_uint num_mip_levels;
|
||||
cl_uint num_samples;
|
||||
#ifdef CL_VERSION_2_0
|
||||
#if defined(__GNUC__)
|
||||
__extension__ /* Prevents warnings about anonymous union in -pedantic builds */
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(__STDC__)
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4201 ) /* Prevents warning about nameless struct/union in /W4 builds */
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wc11-extensions" /* Prevents warning about nameless union being C11 extension*/
|
||||
#endif
|
||||
#if defined(_MSC_VER) && defined(__STDC__)
|
||||
/* Anonymous unions are not supported in /Za builds */
|
||||
#else
|
||||
union {
|
||||
#endif
|
||||
#if defined(CL_VERSION_2_0) && __CL_HAS_ANON_STRUCT__
|
||||
__CL_ANON_STRUCT__ union {
|
||||
#endif
|
||||
cl_mem buffer;
|
||||
#ifdef CL_VERSION_2_0
|
||||
#if defined(_MSC_VER) && defined(__STDC__)
|
||||
/* Anonymous unions are not supported in /Za builds */
|
||||
#else
|
||||
#if defined(CL_VERSION_2_0) && __CL_HAS_ANON_STRUCT__
|
||||
cl_mem mem_object;
|
||||
};
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(__STDC__)
|
||||
#pragma warning( pop )
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
} cl_image_desc;
|
||||
|
||||
#endif
|
||||
|
|
@ -1932,4 +1913,8 @@ clEnqueueTask(cl_command_queue command_queue,
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER) && __CL_HAS_ANON_STRUCT__
|
||||
#pragma warning( pop )
|
||||
#endif
|
||||
|
||||
#endif /* __OPENCL_CL_H */
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#include <CL/cl_egl.h>
|
||||
#include <CL/cl_ext.h>
|
||||
#include <CL/cl_gl.h>
|
||||
#include <CL/cl_platform.h>
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <CL/cl_d3d11.h>
|
||||
|
|
@ -29,6 +30,12 @@
|
|||
#include <CL/cl_dx9_media_sharing.h>
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER) && __CL_HAS_ANON_STRUCT__
|
||||
/* Disable warning C4201: nonstandard extension used : nameless struct/union */
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4201 )
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
@ -37,7 +44,15 @@ extern "C" {
|
|||
|
||||
typedef struct _cl_icd_dispatch {
|
||||
/* OpenCL 1.0 */
|
||||
#if __CL_HAS_ANON_STRUCT__
|
||||
__CL_ANON_STRUCT__ union {
|
||||
#endif
|
||||
clGetPlatformIDs_t *clGetPlatformIDs;
|
||||
#if __CL_HAS_ANON_STRUCT__
|
||||
/* Set to CL_ICD2_TAG_KHR for cl_khr_icd 2.0.0 */
|
||||
intptr_t clGetPlatformIDs_icd2_tag;
|
||||
};
|
||||
#endif
|
||||
clGetPlatformInfo_t *clGetPlatformInfo;
|
||||
clGetDeviceIDs_t *clGetDeviceIDs;
|
||||
clGetDeviceInfo_t *clGetDeviceInfo;
|
||||
|
|
@ -68,7 +83,15 @@ typedef struct _cl_icd_dispatch {
|
|||
clRetainProgram_t *clRetainProgram;
|
||||
clReleaseProgram_t *clReleaseProgram;
|
||||
clBuildProgram_t *clBuildProgram;
|
||||
#if __CL_HAS_ANON_STRUCT__
|
||||
__CL_ANON_STRUCT__ union {
|
||||
#endif
|
||||
clUnloadCompiler_t *clUnloadCompiler;
|
||||
#if __CL_HAS_ANON_STRUCT__
|
||||
/* Set to CL_ICD2_TAG_KHR for cl_khr_icd 2.0.0 */
|
||||
intptr_t clUnloadCompiler_icd2_tag;
|
||||
};
|
||||
#endif
|
||||
clGetProgramInfo_t *clGetProgramInfo;
|
||||
clGetProgramBuildInfo_t *clGetProgramBuildInfo;
|
||||
clCreateKernel_t *clCreateKernel;
|
||||
|
|
@ -312,4 +335,8 @@ typedef struct _cl_icd_dispatch {
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER) && __CL_HAS_ANON_STRUCT__
|
||||
#pragma warning( pop )
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef OPENCL_CL_ICD_H */
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ use std::ptr;
|
|||
use std::sync::Arc;
|
||||
|
||||
pub static DISPATCH: cl_icd_dispatch = cl_icd_dispatch {
|
||||
anon_1: _cl_icd_dispatch__bindgen_ty_1 {
|
||||
clGetPlatformIDs: Some(clGetPlatformIDs),
|
||||
},
|
||||
clGetPlatformInfo: Some(clGetPlatformInfo),
|
||||
clGetDeviceIDs: Some(clGetDeviceIDs),
|
||||
clGetDeviceInfo: Some(clGetDeviceInfo),
|
||||
|
|
@ -53,7 +55,9 @@ pub static DISPATCH: cl_icd_dispatch = cl_icd_dispatch {
|
|||
clRetainProgram: Some(clRetainProgram),
|
||||
clReleaseProgram: Some(clReleaseProgram),
|
||||
clBuildProgram: Some(clBuildProgram),
|
||||
anon_2: _cl_icd_dispatch__bindgen_ty_2 {
|
||||
clUnloadCompiler: None,
|
||||
},
|
||||
clGetProgramInfo: Some(clGetProgramInfo),
|
||||
clGetProgramBuildInfo: Some(clGetProgramBuildInfo),
|
||||
clCreateKernel: Some(clCreateKernel),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue