From eb3b933dd0c32c1db7e44a8292c3523927d9ef99 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Wed, 11 Dec 2013 15:15:55 -0600 Subject: [PATCH] Remove all instances of OpenCL in the Dolphin Project. A brief history of OpenCL in Dolphin. OpenCL was originally added to the Dolphin codebase 1 month after it was released with OS X Snow Leopard in 2009. OpenCL was one of the largest group projects that Dolphin ever has had. The OpenCL texture decoder was originally aded with version 1.0 of the OpenCL spec; This version didn't have the capability of a OpenCL-OpenGL interop which would allow for uploading textures once and have it decoded directly to a OpenGL texure. This was to be worked out when the OpenCL 1.1 spec was released and allowed the interop. This work has never been done, and no one in the team is willing to work on it for various reasons. OpenCL has had the unreasonable expectation that it increases the performance of video games that require a large amount of EFB copies like NSMBW. In reality, enabling OpenCL just put the graphics card in a higher power mode which increased the game speed. This is due to the unfortunate effect of Dolphin tending to not push GPUs out of their lower frequency power savings modes. Thanks to everyone that had contributed to the OpenCL texture decoder. --- CMakeLists.txt | 10 +- Data/Sys/OpenCL/TextureDecoder.cl | 348 ----- Externals/CLRun/CMakeLists.txt | 10 - Externals/CLRun/clrun/CLRun.vcxproj | 64 - Externals/CLRun/clrun/CLRun.vcxproj.filters | 54 - Externals/CLRun/clrun/Makefile | 21 - Externals/CLRun/clrun/clrun.c | 61 - Externals/CLRun/clrun/dynamiclib.c | 63 - Externals/CLRun/clrun/dynamiclib.h | 9 - Externals/CLRun/clrun/gencl.c | 546 ------- Externals/CLRun/clrun/genclext.c | 28 - Externals/CLRun/clrun/genclgl.c | 64 - Externals/CLRun/clrun/genclglext.c | 11 - Externals/CLRun/clrun/generateClRun.pl | 96 -- Externals/CLRun/include/CL/cl.h | 1214 ---------------- Externals/CLRun/include/CL/cl_d3d10.h | 126 -- Externals/CLRun/include/CL/cl_d3d11.h | 126 -- .../CLRun/include/CL/cl_dx9_media_sharing.h | 127 -- Externals/CLRun/include/CL/cl_ext.h | 251 ---- Externals/CLRun/include/CL/cl_gl.h | 162 --- Externals/CLRun/include/CL/cl_gl_ext.h | 69 - Externals/CLRun/include/CL/cl_platform.h | 1254 ----------------- Externals/CLRun/include/clrun.h | 25 - Source/Core/Common/Src/CommonPaths.h | 1 - Source/Core/Common/Src/FileUtil.cpp | 2 - Source/Core/Common/Src/FileUtil.h | 1 - Source/Core/DolphinWX/DolphinWX.vcxproj | 5 +- Source/Core/DolphinWX/Src/ConfigMain.h | 1 - Source/Core/DolphinWX/Src/Main.cpp | 1 - Source/Core/DolphinWX/Src/VideoConfigDiag.cpp | 2 - Source/Core/VideoBackends/OGL/CMakeLists.txt | 4 - .../OGL/Src/TextureConverter.cpp | 1 - .../VideoBackends/Software/CMakeLists.txt | 3 - Source/Core/VideoCommon/CMakeLists.txt | 2 - Source/Core/VideoCommon/OpenCL.rules | 18 - .../Core/VideoCommon/Src/OpcodeDecoding.cpp | 13 - Source/Core/VideoCommon/Src/OpenCL.cpp | 259 ---- Source/Core/VideoCommon/Src/OpenCL.h | 40 - .../Src/OpenCL/TextureDecoder_OpenCL.cpp | 307 ---- .../Src/OpenCL/TextureDecoder_OpenCL.h | 15 - .../Src/TextureDecoder_Generic.cpp | 15 +- .../VideoCommon/Src/TextureDecoder_x64.cpp | 15 +- Source/Core/VideoCommon/Src/VideoConfig.cpp | 3 - Source/Core/VideoCommon/Src/VideoConfig.h | 3 +- Source/Core/VideoCommon/VideoCommon.vcxproj | 7 - .../VideoCommon/VideoCommon.vcxproj.filters | 15 - Source/VSProps/Base.props | 3 +- Source/dolphin-emu.sln | 2 - 48 files changed, 14 insertions(+), 5463 deletions(-) delete mode 100644 Data/Sys/OpenCL/TextureDecoder.cl delete mode 100644 Externals/CLRun/CMakeLists.txt delete mode 100644 Externals/CLRun/clrun/CLRun.vcxproj delete mode 100644 Externals/CLRun/clrun/CLRun.vcxproj.filters delete mode 100644 Externals/CLRun/clrun/Makefile delete mode 100644 Externals/CLRun/clrun/clrun.c delete mode 100644 Externals/CLRun/clrun/dynamiclib.c delete mode 100644 Externals/CLRun/clrun/dynamiclib.h delete mode 100644 Externals/CLRun/clrun/gencl.c delete mode 100644 Externals/CLRun/clrun/genclext.c delete mode 100644 Externals/CLRun/clrun/genclgl.c delete mode 100644 Externals/CLRun/clrun/genclglext.c delete mode 100755 Externals/CLRun/clrun/generateClRun.pl delete mode 100644 Externals/CLRun/include/CL/cl.h delete mode 100644 Externals/CLRun/include/CL/cl_d3d10.h delete mode 100644 Externals/CLRun/include/CL/cl_d3d11.h delete mode 100644 Externals/CLRun/include/CL/cl_dx9_media_sharing.h delete mode 100644 Externals/CLRun/include/CL/cl_ext.h delete mode 100644 Externals/CLRun/include/CL/cl_gl.h delete mode 100644 Externals/CLRun/include/CL/cl_gl_ext.h delete mode 100644 Externals/CLRun/include/CL/cl_platform.h delete mode 100644 Externals/CLRun/include/clrun.h delete mode 100644 Source/Core/VideoCommon/OpenCL.rules delete mode 100644 Source/Core/VideoCommon/Src/OpenCL.cpp delete mode 100644 Source/Core/VideoCommon/Src/OpenCL.h delete mode 100644 Source/Core/VideoCommon/Src/OpenCL/TextureDecoder_OpenCL.cpp delete mode 100644 Source/Core/VideoCommon/Src/OpenCL/TextureDecoder_OpenCL.h diff --git a/CMakeLists.txt b/CMakeLists.txt index f9af7383bb..158d8dc60f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -510,7 +510,7 @@ include_directories(Source/Core/VideoUICommon/Src) # - make sure to tell cmake to link them statically or dynamically (most # should be linked statically) # - place the CMakeLists.txt in the first-level subdirectory, e.g. -# Externals/CLRun/CMakeLists.txt (that is: NOT in some Src/ subdirectory) +# Externals/zlib/CMakeLists.txt (that is: NOT in some Src/ subdirectory) # add_subdirectory(Externals/Bochs_disasm) include_directories(Externals/Bochs_disasm) @@ -673,14 +673,6 @@ if (ANDROID) add_subdirectory(Externals/libiconv-1.14) endif() -if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID) - find_library(CL OpenCL) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-weak_framework,OpenCL") -else() - include_directories(Externals/CLRun/include) - add_subdirectory(Externals/CLRun) -endif() - if(NOT DISABLE_WX AND NOT ANDROID) include(FindwxWidgets OPTIONAL) FIND_PACKAGE(wxWidgets COMPONENTS core aui adv) diff --git a/Data/Sys/OpenCL/TextureDecoder.cl b/Data/Sys/OpenCL/TextureDecoder.cl deleted file mode 100644 index 28ceda1012..0000000000 --- a/Data/Sys/OpenCL/TextureDecoder.cl +++ /dev/null @@ -1,348 +0,0 @@ -// Copyright 2013 Dolphin Emulator Project -// Licensed under GPLv2 -// Refer to the license.txt file included. - -kernel void DecodeI4(global uchar *dst, - const global uchar *src, int width) -{ - int x = get_global_id(0) * 8, y = get_global_id(1) * 8; - int srcOffset = x + y * width / 8; - for (int iy = 0; iy < 8; iy++) - { - uchar4 val = vload4(srcOffset, src); - uchar8 res; - res.even = (val >> (uchar4)4) & (uchar4)0x0F; - res.odd = val & (uchar4)0x0F; - res |= res << (uchar8)4; - vstore8(res, 0, dst + ((y + iy)*width + x)); - srcOffset++; - } -} - -kernel void DecodeI4_RGBA(global uint *dst, - const global uchar *src, int width) -{ - int x = get_global_id(0) * 8, y = get_global_id(1) * 8; - int srcOffset = x + y * width / 8; - for (int iy = 0; iy < 8; iy++) - { - uchar4 val = vload4(srcOffset, src); - uchar8 res; - res.even = (val >> (uchar4)4) & (uchar4)0x0F; - res.odd = val & (uchar4)0x0F; - res |= res << (uchar8)4; - vstore8(upsample(upsample(res,res),upsample(res,res)), 0, dst + ((y + iy)*width + x)); - srcOffset++; - } -} - -kernel void DecodeI8(global uchar *dst, - const global uchar *src, int width) -{ - int x = get_global_id(0) * 8, y = get_global_id(1) * 4; - int srcOffset = ((x * 4) + (y * width)) / 8; - for (int iy = 0; iy < 4; iy++) - { - vstore8(vload8(srcOffset++, src), - 0, dst + ((y + iy)*width + x)); - } -} - -kernel void DecodeI8_RGBA(global uint *dst, - const global uchar *src, int width) -{ - int x = get_global_id(0) * 8, y = get_global_id(1) * 4; - int srcOffset = ((x * 4) + (y * width)) / 8; - for (int iy = 0; iy < 4; iy++) - { - uchar8 val = vload8(srcOffset++, src); - vstore8(upsample(upsample(val,val),upsample(val,val)), - 0, dst + ((y + iy)*width + x)); - } -} - -kernel void DecodeIA8(global ushort *dst, - const global uchar *src, int width) -{ - int x = get_global_id(0) * 4, y = get_global_id(1) * 4; - int srcOffset = ((x * 4) + (y * width)) / 4; - for (int iy = 0; iy < 4; iy++) - { - uchar8 val = vload8(srcOffset++, src); - vstore4(upsample(val.even, val.odd), 0, dst + ((y + iy)*width + x)); - } -} - -kernel void DecodeIA8_RGBA(global uint *dst, - const global uchar *src, int width) -{ - int x = get_global_id(0) * 4, y = get_global_id(1) * 4; - int srcOffset = ((x * 4) + (y * width)) / 4; - for (int iy = 0; iy < 4; iy++) - { - uchar8 val = vload8(srcOffset++, src); - vstore4(upsample(upsample(val.even,val.odd),upsample(val.odd, val.odd)), 0, dst + ((y + iy)*width + x)); - } -} - -kernel void DecodeIA4(global ushort *dst, - const global uchar *src, int width) -{ - int x = get_global_id(0) * 8, y = get_global_id(1) * 4; - int srcOffset = ((x * 4) + (y * width)) / 8; - uchar8 val; - ushort8 res; - for (int iy = 0; iy < 4; iy++) - { - val = vload8(srcOffset++, src); - res = upsample(val >> (uchar8)4, val & (uchar8)0xF); - res |= res << (ushort8)4; - vstore8(res, 0, dst + y*width + x); - dst+=width; - } -} - -kernel void DecodeIA4_RGBA(global uint *dst, - const global uchar *src, int width) -{ - int x = get_global_id(0) * 8, y = get_global_id(1) * 4; - int srcOffset = ((x * 4) + (y * width)) / 8; - uchar8 val; - uint8 res; - for (int iy = 0; iy < 4; iy++) - { - val = vload8(srcOffset++, src); - uchar8 a = val >> (uchar8)4; - uchar8 l = val & (uchar8)0xF; - res = upsample(upsample(a, l), upsample(l,l)); - res |= res << (uint8)4; - vstore8(res, 0, dst + y*width + x); - dst+=width; - } -} - -kernel void DecodeRGBA8(global ushort *dst, - const global ushort *src, int width) -{ - int x = get_global_id(0) * 4, y = get_global_id(1) * 4; - int srcOffset = (x * 2) + (y * width) / 2; - for (int iy = 0; iy < 4; iy++) - { - ushort8 val = (ushort8)(vload4(srcOffset, src), vload4(srcOffset + 4, src)); - ushort8 temp = rotate(val, (ushort8)4); - ushort8 bgra = rotate(temp, (ushort8)4).s40516273; - vstore8(bgra, 0, dst + ((y + iy)*width + x) * 2); - srcOffset++; - } -} - -kernel void DecodeRGBA8_RGBA(global uchar *dst, - const global uchar *src, int width) -{ - int x = get_global_id(0) * 4, y = get_global_id(1) * 4; - int srcOffset = (x * 2) + (y * width) / 2; - for (int iy = 0; iy < 4; iy++) - { - uchar8 ar = vload8(srcOffset, src); - uchar8 gb = vload8(srcOffset + 4, src); - uchar16 res; - res.even.even = ar.odd; - res.even.odd = gb.odd; - res.odd.even = gb.even; - res.odd.odd = ar.even; - vstore16(res, 0, dst + ((y + iy)*width + x) * 4); - srcOffset++; - } -} - -kernel void DecodeRGB565(global ushort *dst, - const global ushort *src, int width) -{ - int x = get_global_id(0) * 4, y = get_global_id(1) * 4; - int srcOffset = x + (y * width) / 4; - dst += width*y + x; - for (int iy = 0; iy < 4; iy++) - { - ushort4 val = rotate(vload4(srcOffset++, src),(ushort4)4); - vstore4(rotate(val,(ushort4)4), 0, dst + iy*width); - } -} - -kernel void DecodeRGB565_RGBA(global uchar *dst, - const global uchar *src, int width) -{ - int x = get_global_id(0) * 4, y = get_global_id(1) * 4; - int srcOffset = x + (y * width) / 4; - for (int iy = 0; iy < 4; iy++) - { - uchar8 val = vload8(srcOffset++, src); - - uchar16 res; - res.even.even = bitselect(val.even, val.even >> (uchar4)5, (uchar4)7); - res.odd.even = bitselect((val.odd >> (uchar4)3) | (val.even << (uchar4)5), val.even >> (uchar4)1, (uchar4)3); - res.even.odd = bitselect(val.odd << (uchar4)3, val.odd >> (uchar4)2, (uchar4)7); - res.odd.odd = (uchar4)0xFF; - - vstore16(res, 0, dst + ((y + iy)*width + x) * 4); - } -} - -kernel void DecodeRGB5A3(global uchar *dst, - const global uchar *src, int width) -{ - int x = get_global_id(0) * 4, y = get_global_id(1) * 4; - int srcOffset = x + (y * width) / 4; - uchar8 val; - uchar16 resNoAlpha, resAlpha, choice; - #define iterateRGB5A3() \ - val = vload8(srcOffset++, src); \ - resNoAlpha.s26AE = val.even << (uchar4)1; \ - resNoAlpha.s159D = val.even << (uchar4)6 | val.odd >> (uchar4)2; \ - resNoAlpha.s048C = val.odd << (uchar4)3; \ - resNoAlpha = bitselect(resNoAlpha, resNoAlpha >> (uchar16)5, (uchar16)0x3); \ - resNoAlpha.s37BF = (uchar4)(0xFF); \ - resAlpha.s26AE = bitselect(val.even << (uchar4)4, val.even, (uchar4)0xF); \ - resAlpha.s159D = bitselect(val.odd, val.odd >> (uchar4)4, (uchar4)0xF); \ - resAlpha.s048C = bitselect(val.odd << (uchar4)4, val.odd, (uchar4)0xF); \ - resAlpha.s37BF = bitselect(val.even << (uchar4)1, val.even >> (uchar4)2, (uchar4)0x1C); \ - resAlpha.s37BF = bitselect(resAlpha.s37BF, val.even >> (uchar4)5, (uchar4)0x3); \ - choice = (uchar16)((uchar4)(val.even.s0), \ - (uchar4)(val.even.s1), \ - (uchar4)(val.even.s2), \ - (uchar4)(val.even.s3)); \ - vstore16(select(resAlpha, resNoAlpha, choice), 0, dst + (y * width + x) * 4); - iterateRGB5A3(); dst += width*4; - iterateRGB5A3(); dst += width*4; - iterateRGB5A3(); dst += width*4; - iterateRGB5A3(); -} - -kernel void DecodeRGB5A3_RGBA(global uchar *dst, - const global uchar *src, int width) -{ - int x = get_global_id(0) * 4, y = get_global_id(1) * 4; - int srcOffset = x + (y * width) / 4; - uchar8 val; - uchar16 resNoAlpha, resAlpha, choice; - #define iterateRGB5A3_RGBA() \ - val = vload8(srcOffset++, src); \ - resNoAlpha.s048C = val.even << (uchar4)1; \ - resNoAlpha.s159D = val.even << (uchar4)6 | val.odd >> (uchar4)2; \ - resNoAlpha.s26AE = val.odd << (uchar4)3; \ - resNoAlpha = bitselect(resNoAlpha, resNoAlpha >> (uchar16)5, (uchar16)0x3); \ - resNoAlpha.s37BF = (uchar4)(0xFF); \ - resAlpha.s048C = bitselect(val.even << (uchar4)4, val.even, (uchar4)0xF); \ - resAlpha.s159D = bitselect(val.odd, val.odd >> (uchar4)4, (uchar4)0xF); \ - resAlpha.s26AE = bitselect(val.odd << (uchar4)4, val.odd, (uchar4)0xF); \ - resAlpha.s37BF = bitselect(val.even << (uchar4)1, val.even >> (uchar4)2, (uchar4)0x1C); \ - resAlpha.s37BF = bitselect(resAlpha.s37BF, val.even >> (uchar4)5, (uchar4)0x3); \ - choice = (uchar16)((uchar4)(val.even.s0), \ - (uchar4)(val.even.s1), \ - (uchar4)(val.even.s2), \ - (uchar4)(val.even.s3)); \ - vstore16(select(resAlpha, resNoAlpha, choice), 0, dst + (y * width + x) * 4); - iterateRGB5A3_RGBA(); dst += width*4; - iterateRGB5A3_RGBA(); dst += width*4; - iterateRGB5A3_RGBA(); dst += width*4; - iterateRGB5A3_RGBA(); -} - -uint16 unpack(uchar b) -{ - return (uint16)((uint4)(b >> 3 & 0x18), - (uint4)(b >> 1 & 0x18), - (uint4)(b << 1 & 0x18), - (uint4)(b << 3 & 0x18)); -} - -kernel void decodeCMPRBlock(global uchar *dst, - const global uchar *src, int width) -{ - int x = get_global_id(0) * 4, y = get_global_id(1) * 4; - uchar8 val = vload8(0, src); - - uchar2 colora565 = (uchar2)(val.s1, val.s3); - uchar2 colorb565 = (uchar2)(val.s0, val.s2); - uchar8 color32 = (uchar8)(bitselect(colora565 << (uchar2)3, colora565 >> (uchar2)2, (uchar2)7), - bitselect((colora565 >> (uchar2)3) | (colorb565 << (uchar2)5), colorb565 >> (uchar2)1, (uchar2)3), - bitselect(colorb565, colorb565 >> (uchar2)5, (uchar2)7), - (uchar2)0xFF); - - ushort4 frac2 = convert_ushort4(color32.even) - convert_ushort4(color32.odd); - uchar4 frac = convert_uchar4((frac2 * (ushort4)3) / (ushort4)8); - - ushort4 colorAlpha = upsample((uchar4)(color32.even.s0,color32.even.s1,color32.even.s2,0), - rhadd(color32.odd, color32.even)); - colorAlpha.s3 = 0xFF; - ushort4 colorNoAlpha = upsample(color32.odd + frac, color32.even - frac); - - uint4 colors = upsample((upsample(val.s0,val.s1) > upsample(val.s2,val.s3))?colorNoAlpha:colorAlpha, - upsample(color32.odd, color32.even)); - - uint16 colorsFull = (uint16)(colors, colors, colors, colors); - - vstore16(convert_uchar16(colorsFull >> unpack(val.s4)), 0, dst); - vstore16(convert_uchar16(colorsFull >> unpack(val.s5)), 0, dst+=width*4); - vstore16(convert_uchar16(colorsFull >> unpack(val.s6)), 0, dst+=width*4); - vstore16(convert_uchar16(colorsFull >> unpack(val.s7)), 0, dst+=width*4); -} - -kernel void DecodeCMPR(global uchar *dst, - const global uchar *src, int width) -{ - int x = get_global_id(0) * 8, y = get_global_id(1) * 8; - - src += x * 4 + (y * width) / 2; - dst += (y * width + x) * 4; - - decodeCMPRBlock(dst, src, width); src += 8; - decodeCMPRBlock(dst + 16, src, width); src += 8; - decodeCMPRBlock(dst + 16 * width, src, width); src += 8; - decodeCMPRBlock(dst + 16 * (width + 1), src, width); -} - -kernel void decodeCMPRBlock_RGBA(global uchar *dst, - const global uchar *src, int width) -{ - int x = get_global_id(0) * 4, y = get_global_id(1) * 4; - uchar8 val = vload8(0, src); - - uchar2 colora565 = (uchar2)(val.s1, val.s3); - uchar2 colorb565 = (uchar2)(val.s0, val.s2); - uchar8 color32 = (uchar8)(bitselect(colorb565, colorb565 >> (uchar2)5, (uchar2)7), - bitselect((colora565 >> (uchar2)3) | (colorb565 << (uchar2)5), colorb565 >> (uchar2)1, (uchar2)3), - bitselect(colora565 << (uchar2)3, colora565 >> (uchar2)2, (uchar2)7), - (uchar2)0xFF); - - ushort4 frac2 = convert_ushort4(color32.even) - convert_ushort4(color32.odd); - uchar4 frac = convert_uchar4((frac2 * (ushort4)3) / (ushort4)8); - - ushort4 colorAlpha = upsample((uchar4)(color32.even.s0,color32.even.s1,color32.even.s2,0), - rhadd(color32.odd, color32.even)); - colorAlpha.s3 = 0xFF; - ushort4 colorNoAlpha = upsample(color32.odd + frac, color32.even - frac); - - uint4 colors = upsample((upsample(val.s0,val.s1) > upsample(val.s2,val.s3))?colorNoAlpha:colorAlpha, - upsample(color32.odd, color32.even)); - - uint16 colorsFull = (uint16)(colors, colors, colors, colors); - - vstore16(convert_uchar16(colorsFull >> unpack(val.s4)), 0, dst); - vstore16(convert_uchar16(colorsFull >> unpack(val.s5)), 0, dst+=width*4); - vstore16(convert_uchar16(colorsFull >> unpack(val.s6)), 0, dst+=width*4); - vstore16(convert_uchar16(colorsFull >> unpack(val.s7)), 0, dst+=width*4); -} - -kernel void DecodeCMPR_RGBA(global uchar *dst, - const global uchar *src, int width) -{ - int x = get_global_id(0) * 8, y = get_global_id(1) * 8; - - src += x * 4 + (y * width) / 2; - dst += (y * width + x) * 4; - - decodeCMPRBlock_RGBA(dst, src, width); src += 8; - decodeCMPRBlock_RGBA(dst + 16, src, width); src += 8; - decodeCMPRBlock_RGBA(dst + 16 * width, src, width); src += 8; - decodeCMPRBlock_RGBA(dst + 16 * (width + 1), src, width); -} diff --git a/Externals/CLRun/CMakeLists.txt b/Externals/CLRun/CMakeLists.txt deleted file mode 100644 index 3a57ae4563..0000000000 --- a/Externals/CLRun/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -set(SRCS clrun/clrun.c - clrun/dynamiclib.c - clrun/gencl.c - clrun/genclgl.c - clrun/genclext.c - clrun/genclglext.c - ) - -add_library(clrun STATIC ${SRCS}) -target_link_libraries(clrun ${CMAKE_DL_LIBS}) diff --git a/Externals/CLRun/clrun/CLRun.vcxproj b/Externals/CLRun/clrun/CLRun.vcxproj deleted file mode 100644 index 473e5c532a..0000000000 --- a/Externals/CLRun/clrun/CLRun.vcxproj +++ /dev/null @@ -1,64 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {AA862E5E-A993-497A-B6A0-0E8E94B10050} - - - - StaticLibrary - v120 - Unicode - - - true - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Externals/CLRun/clrun/CLRun.vcxproj.filters b/Externals/CLRun/clrun/CLRun.vcxproj.filters deleted file mode 100644 index 3f252a668b..0000000000 --- a/Externals/CLRun/clrun/CLRun.vcxproj.filters +++ /dev/null @@ -1,54 +0,0 @@ - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files\OpenCL - - - Header Files\OpenCL - - - Header Files\OpenCL - - - - - {106ccba4-ab19-42b5-b57a-e758dc5a2ed1} - - - {db71af5e-c0f4-4099-a280-11cd0039b790} - - - {a28bc4a7-a663-44a5-a120-6ca71a89b55c} - - - {17baf6ec-fbcb-4dfd-a963-5f9a091de41e} - - - - - - Resource Files - - - \ No newline at end of file diff --git a/Externals/CLRun/clrun/Makefile b/Externals/CLRun/clrun/Makefile deleted file mode 100644 index f4186ff741..0000000000 --- a/Externals/CLRun/clrun/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -all: compile - -compile: genclrun gencl.c genclgl.c - gcc -Wall -c gencl.c -o gencl.o - gcc -Wall -c genclgl.c -o genclgl.o - gcc -Wall -c clrun.c -o clrun.o -I../include - gcc -Wall --shared dynamiclib.c clrun.o gencl.o genclgl.o -o libclrun.so -ldl - strip libclrun.so - -genclrun: ../include/CL/cl.h ../include/CL/cl_gl.h - ./generateClRun.pl ../include/CL/cl.h > gencl.c - ./generateClRun.pl ../include/CL/cl_gl.h > genclgl.c - ./generateClRun.pl ../include/CL/cl_ext.h > genclext.c - ./generateClRun.pl ../include/CL/cl_gl_ext.h > genclglext.c - ./generateClRun.pl ../include/CL/cl_d3d10.h > gencld3d10.c - ./generateClRun.pl ../include/CL/cl_d3d11.h > gencld3d11.c - ./generateClRun.pl ../include/CL/cl_dx9_media_sharing.h > gencldx9.c - - -clean: - rm -rf *~ *.o diff --git a/Externals/CLRun/clrun/clrun.c b/Externals/CLRun/clrun/clrun.c deleted file mode 100644 index e121f80737..0000000000 --- a/Externals/CLRun/clrun/clrun.c +++ /dev/null @@ -1,61 +0,0 @@ -#include "clrun.h" -#include "dynamiclib.h" - -#ifdef _WIN32 -#include -#endif - -int isCL = 0; - -// 0 means no opencl, 1 means opencl -int clrInit() { - int ret = 0; - -#ifdef _WIN32 - const char *libname = "OpenCL.dll"; -#else - const char *libname = "libOpenCL.so"; -#endif - - if((ret = loadLib(libname))) { - if(ret == -3) // No OpenCL - return 0; - else - return ret; - } - - isCL = 1; - - // TODO: optimize by loading all functions here? - - return 0; -} - -int clrHasOpenCL() { - return isCL; -} - - -// Windows-specific DLL code -#if defined _WIN32 && defined CLRUN_DYNAMICLIB -HINSTANCE g_hInstance; - -BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle - DWORD dwReason, // reason called - LPVOID lpvReserved) // reserved -{ - switch (dwReason) - { - case DLL_PROCESS_ATTACH: - break; - - case DLL_PROCESS_DETACH: - break; - default: - break; - } - - g_hInstance = hinstDLL; - return TRUE; -} -#endif diff --git a/Externals/CLRun/clrun/dynamiclib.c b/Externals/CLRun/clrun/dynamiclib.c deleted file mode 100644 index 368d262ed1..0000000000 --- a/Externals/CLRun/clrun/dynamiclib.c +++ /dev/null @@ -1,63 +0,0 @@ -#ifdef _WIN32 -#include -HINSTANCE library = NULL; -#else -#include -#include -void *library = NULL; -#endif -#include - -int loadLib(const char *filename) { - if (library) - return -1; - - if (!filename || strlen(filename) == 0) - return -2; - -#ifdef _WIN32 - library = LoadLibraryA(filename); -#else - library = dlopen(filename, RTLD_NOW | RTLD_LOCAL); -#endif - - if (!library) - return -3; - - return 0; -} - -int unloadLib() -{ - int retval; - if (!library) - return -1; - -#ifdef _WIN32 - retval = FreeLibrary(library); -#else - retval = dlclose(library); -#endif - - library = NULL; - return retval; -} - -void *getFunction(const char *funcname) { - void* retval; - - if (!library) { - return NULL; - } - -#ifdef _WIN32 - retval = GetProcAddress(library, funcname); -#else - retval = dlsym(library, funcname); -#endif - - if (!retval) - return NULL; - - return retval; -} diff --git a/Externals/CLRun/clrun/dynamiclib.h b/Externals/CLRun/clrun/dynamiclib.h deleted file mode 100644 index 0d62d2dcc7..0000000000 --- a/Externals/CLRun/clrun/dynamiclib.h +++ /dev/null @@ -1,9 +0,0 @@ - -#ifndef __DYNAMIC_LIBRARY_H -#define __DYNAMIC_LIBRARY_H - -int loadLib(const char *filename); -int unloadLib(); -void *getFunction(const char *funcname); - -#endif diff --git a/Externals/CLRun/clrun/gencl.c b/Externals/CLRun/clrun/gencl.c deleted file mode 100644 index 649e3c67b7..0000000000 --- a/Externals/CLRun/clrun/gencl.c +++ /dev/null @@ -1,546 +0,0 @@ -// Automatically generated by generateClRun.pl -#include "dynamiclib.h" -#include "../include/CL/cl.h" - - -static cl_int (*clGetPlatformIDs_ptr)(cl_uint, cl_platform_id *, cl_uint *) = NULL; -cl_int CL_API_CALL clGetPlatformIDs (cl_uint num_entries,cl_platform_id * platforms,cl_uint * num_platforms) { - if(!clGetPlatformIDs_ptr) clGetPlatformIDs_ptr = getFunction("clGetPlatformIDs"); - return (*clGetPlatformIDs_ptr)(num_entries, platforms, num_platforms); -} - -static cl_int (*clGetPlatformInfo_ptr)(cl_platform_id, cl_platform_info, size_t, void *, size_t *) = NULL; -cl_int CL_API_CALL clGetPlatformInfo (cl_platform_id platform,cl_platform_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret) { - if(!clGetPlatformInfo_ptr) clGetPlatformInfo_ptr = getFunction("clGetPlatformInfo"); - return (*clGetPlatformInfo_ptr)(platform, param_name, param_value_size, param_value, param_value_size_ret); -} - -static cl_int (*clGetDeviceIDs_ptr)(cl_platform_id, cl_device_type, cl_uint, cl_device_id *, cl_uint *) = NULL; -cl_int CL_API_CALL clGetDeviceIDs (cl_platform_id platform,cl_device_type device_type,cl_uint num_entries,cl_device_id * devices,cl_uint * num_devices) { - if(!clGetDeviceIDs_ptr) clGetDeviceIDs_ptr = getFunction("clGetDeviceIDs"); - return (*clGetDeviceIDs_ptr)(platform, device_type, num_entries, devices, num_devices); -} - -static cl_int (*clGetDeviceInfo_ptr)(cl_device_id, cl_device_info, size_t, void *, size_t *) = NULL; -cl_int CL_API_CALL clGetDeviceInfo (cl_device_id device,cl_device_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret) { - if(!clGetDeviceInfo_ptr) clGetDeviceInfo_ptr = getFunction("clGetDeviceInfo"); - return (*clGetDeviceInfo_ptr)(device, param_name, param_value_size, param_value, param_value_size_ret); -} - -static cl_int (*clCreateSubDevices_ptr)(cl_device_id, const cl_device_partition_property *, cl_uint, cl_device_id *, cl_uint *) = NULL; -cl_int CL_API_CALL clCreateSubDevices (cl_device_id in_device,const cl_device_partition_property * properties,cl_uint num_devices,cl_device_id * out_devices,cl_uint * num_devices_ret) { - if(!clCreateSubDevices_ptr) clCreateSubDevices_ptr = getFunction("clCreateSubDevices"); - return (*clCreateSubDevices_ptr)(in_device, properties, num_devices, out_devices, num_devices_ret); -} - -static cl_int (*clRetainDevice_ptr)(cl_device_id) = NULL; -cl_int CL_API_CALL clRetainDevice (cl_device_id device) { - if(!clRetainDevice_ptr) clRetainDevice_ptr = getFunction("clRetainDevice"); - return (*clRetainDevice_ptr)(device); -} - -static cl_int (*clReleaseDevice_ptr)(cl_device_id) = NULL; -cl_int CL_API_CALL clReleaseDevice (cl_device_id device) { - if(!clReleaseDevice_ptr) clReleaseDevice_ptr = getFunction("clReleaseDevice"); - return (*clReleaseDevice_ptr)(device); -} - -static cl_context (*clCreateContext_ptr)(const cl_context_properties *, cl_uint, const cl_device_id *, void (CL_CALLBACK *pfn_notify)(const char *, const void *, size_t, void *), void*, cl_int*) = NULL; -cl_context CL_API_CALL clCreateContext(const cl_context_properties * properties, - cl_uint num_devices, - const cl_device_id * devices, - void (CL_CALLBACK *pfn_notify)(const char *, const void *, size_t, void *), - void * user_data, - cl_int * errcode_ret) { - if(!clCreateContext_ptr) clCreateContext_ptr = getFunction("clCreateContext"); - return (*clCreateContext_ptr)(properties, num_devices, devices, pfn_notify, user_data, errcode_ret); -} - -static cl_context (*clCreateContextFromType_ptr)(const cl_context_properties *, cl_device_type, void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *), void*, cl_int*) = NULL; -cl_context CL_API_CALL clCreateContextFromType(const cl_context_properties * properties, - cl_device_type device_type, - void (CL_CALLBACK * pfn_notify)(const char *, const void *, size_t, void *), - void * user_data, - cl_int * errcode_ret) { - if(!clCreateContextFromType_ptr) clCreateContextFromType_ptr = getFunction("clCreateContextFromType"); - return (*clCreateContextFromType_ptr)(properties, device_type, pfn_notify, user_data, errcode_ret); -} - -static cl_int (*clRetainContext_ptr)(cl_context) = NULL; -cl_int CL_API_CALL clRetainContext (cl_context context) { - if(!clRetainContext_ptr) clRetainContext_ptr = getFunction("clRetainContext"); - return (*clRetainContext_ptr)(context); -} - -static cl_int (*clReleaseContext_ptr)(cl_context) = NULL; -cl_int CL_API_CALL clReleaseContext (cl_context context) { - if(!clReleaseContext_ptr) clReleaseContext_ptr = getFunction("clReleaseContext"); - return (*clReleaseContext_ptr)(context); -} - -static cl_int (*clGetContextInfo_ptr)(cl_context, cl_context_info, size_t, void *, size_t *) = NULL; -cl_int CL_API_CALL clGetContextInfo (cl_context context,cl_context_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret) { - if(!clGetContextInfo_ptr) clGetContextInfo_ptr = getFunction("clGetContextInfo"); - return (*clGetContextInfo_ptr)(context, param_name, param_value_size, param_value, param_value_size_ret); -} - -static cl_command_queue (*clCreateCommandQueue_ptr)(cl_context, cl_device_id, cl_command_queue_properties, cl_int *) = NULL; -cl_command_queue CL_API_CALL clCreateCommandQueue (cl_context context,cl_device_id device,cl_command_queue_properties properties,cl_int * errcode_ret) { - if(!clCreateCommandQueue_ptr) clCreateCommandQueue_ptr = getFunction("clCreateCommandQueue"); - return (*clCreateCommandQueue_ptr)(context, device, properties, errcode_ret); -} - -static cl_int (*clRetainCommandQueue_ptr)(cl_command_queue) = NULL; -cl_int CL_API_CALL clRetainCommandQueue (cl_command_queue command_queue) { - if(!clRetainCommandQueue_ptr) clRetainCommandQueue_ptr = getFunction("clRetainCommandQueue"); - return (*clRetainCommandQueue_ptr)(command_queue); -} - -static cl_int (*clReleaseCommandQueue_ptr)(cl_command_queue) = NULL; -cl_int CL_API_CALL clReleaseCommandQueue (cl_command_queue command_queue) { - if(!clReleaseCommandQueue_ptr) clReleaseCommandQueue_ptr = getFunction("clReleaseCommandQueue"); - return (*clReleaseCommandQueue_ptr)(command_queue); -} - -static cl_int (*clGetCommandQueueInfo_ptr)(cl_command_queue, cl_command_queue_info, size_t, void *, size_t *) = NULL; -cl_int CL_API_CALL clGetCommandQueueInfo (cl_command_queue command_queue,cl_command_queue_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret) { - if(!clGetCommandQueueInfo_ptr) clGetCommandQueueInfo_ptr = getFunction("clGetCommandQueueInfo"); - return (*clGetCommandQueueInfo_ptr)(command_queue, param_name, param_value_size, param_value, param_value_size_ret); -} - -static cl_mem (*clCreateBuffer_ptr)(cl_context, cl_mem_flags, size_t, void *, cl_int *) = NULL; -cl_mem CL_API_CALL clCreateBuffer (cl_context context,cl_mem_flags flags,size_t size,void * host_ptr,cl_int * errcode_ret) { - if(!clCreateBuffer_ptr) clCreateBuffer_ptr = getFunction("clCreateBuffer"); - return (*clCreateBuffer_ptr)(context, flags, size, host_ptr, errcode_ret); -} - -static cl_mem (*clCreateSubBuffer_ptr)(cl_mem, cl_mem_flags, cl_buffer_create_type, const void *, cl_int *) = NULL; -cl_mem CL_API_CALL clCreateSubBuffer (cl_mem buffer,cl_mem_flags flags,cl_buffer_create_type buffer_create_type,const void * buffer_create_info,cl_int * errcode_ret) { - if(!clCreateSubBuffer_ptr) clCreateSubBuffer_ptr = getFunction("clCreateSubBuffer"); - return (*clCreateSubBuffer_ptr)(buffer, flags, buffer_create_type, buffer_create_info, errcode_ret); -} - -static cl_mem (*clCreateImage_ptr)(cl_context, cl_mem_flags, const cl_image_format *, const cl_image_desc *, void *, cl_int *) = NULL; -cl_mem CL_API_CALL clCreateImage (cl_context context,cl_mem_flags flags,const cl_image_format * image_format,const cl_image_desc * image_desc,void * host_ptr,cl_int * errcode_ret) { - if(!clCreateImage_ptr) clCreateImage_ptr = getFunction("clCreateImage"); - return (*clCreateImage_ptr)(context, flags, image_format, image_desc, host_ptr, errcode_ret); -} - -static cl_int (*clRetainMemObject_ptr)(cl_mem) = NULL; -cl_int CL_API_CALL clRetainMemObject (cl_mem memobj) { - if(!clRetainMemObject_ptr) clRetainMemObject_ptr = getFunction("clRetainMemObject"); - return (*clRetainMemObject_ptr)(memobj); -} - -static cl_int (*clReleaseMemObject_ptr)(cl_mem) = NULL; -cl_int CL_API_CALL clReleaseMemObject (cl_mem memobj) { - if(!clReleaseMemObject_ptr) clReleaseMemObject_ptr = getFunction("clReleaseMemObject"); - return (*clReleaseMemObject_ptr)(memobj); -} - -static cl_int (*clGetSupportedImageFormats_ptr)(cl_context, cl_mem_flags, cl_mem_object_type, cl_uint, cl_image_format *, cl_uint *) = NULL; -cl_int CL_API_CALL clGetSupportedImageFormats (cl_context context,cl_mem_flags flags,cl_mem_object_type image_type,cl_uint num_entries,cl_image_format * image_formats,cl_uint * num_image_formats) { - if(!clGetSupportedImageFormats_ptr) clGetSupportedImageFormats_ptr = getFunction("clGetSupportedImageFormats"); - return (*clGetSupportedImageFormats_ptr)(context, flags, image_type, num_entries, image_formats, num_image_formats); -} - -static cl_int (*clGetMemObjectInfo_ptr)(cl_mem, cl_mem_info, size_t, void *, size_t *) = NULL; -cl_int CL_API_CALL clGetMemObjectInfo (cl_mem memobj,cl_mem_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret) { - if(!clGetMemObjectInfo_ptr) clGetMemObjectInfo_ptr = getFunction("clGetMemObjectInfo"); - return (*clGetMemObjectInfo_ptr)(memobj, param_name, param_value_size, param_value, param_value_size_ret); -} - -static cl_int (*clGetImageInfo_ptr)(cl_mem, cl_image_info, size_t, void *, size_t *) = NULL; -cl_int CL_API_CALL clGetImageInfo (cl_mem image,cl_image_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret) { - if(!clGetImageInfo_ptr) clGetImageInfo_ptr = getFunction("clGetImageInfo"); - return (*clGetImageInfo_ptr)(image, param_name, param_value_size, param_value, param_value_size_ret); -} - -/* Sampler APIs */ -static cl_int (*clSetMemObjectDestructorCallback_ptr)(cl_mem memobj,void (CL_CALLBACK *pfn_notify)( cl_mem memobj, void*) ,void *user_data ) = NULL; -cl_int CL_API_CALL clSetMemObjectDestructorCallback (cl_mem memobj,void (CL_CALLBACK *pfn_notify)( cl_mem memobj, void*) ,void *user_data ) -{ - if(!clSetMemObjectDestructorCallback_ptr) clSetMemObjectDestructorCallback_ptr = getFunction("clSetMemObjectDestructorCallback"); - return (*clSetMemObjectDestructorCallback_ptr)(memobj, pfn_notify, user_data); -} - -/* Sampler APIs */ -static cl_sampler (*clCreateSampler_ptr)(cl_context, cl_bool, cl_addressing_mode, cl_filter_mode, cl_int *) = NULL; -cl_sampler CL_API_CALL clCreateSampler(cl_context context,cl_bool normalized_coords,cl_addressing_mode addressing_mode,cl_filter_mode filter_mode,cl_int * errcode_ret) { - if(!clCreateSampler_ptr) clCreateSampler_ptr = getFunction("clCreateSampler"); - return (*clCreateSampler_ptr)(context, normalized_coords, addressing_mode, filter_mode, errcode_ret); -} - -static cl_int (*clRetainSampler_ptr)(cl_sampler) = NULL; -cl_int CL_API_CALL clRetainSampler (cl_sampler sampler) { - if(!clRetainSampler_ptr) clRetainSampler_ptr = getFunction("clRetainSampler"); - return (*clRetainSampler_ptr)(sampler); -} - -static cl_int (*clReleaseSampler_ptr)(cl_sampler) = NULL; -cl_int CL_API_CALL clReleaseSampler (cl_sampler sampler) { - if(!clReleaseSampler_ptr) clReleaseSampler_ptr = getFunction("clReleaseSampler"); - return (*clReleaseSampler_ptr)(sampler); -} - -static cl_int (*clGetSamplerInfo_ptr)(cl_sampler, cl_sampler_info, size_t, void *, size_t *) = NULL; -cl_int CL_API_CALL clGetSamplerInfo (cl_sampler sampler,cl_sampler_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret) { - if(!clGetSamplerInfo_ptr) clGetSamplerInfo_ptr = getFunction("clGetSamplerInfo"); - return (*clGetSamplerInfo_ptr)(sampler, param_name, param_value_size, param_value, param_value_size_ret); -} - -static cl_program (*clCreateProgramWithSource_ptr)(cl_context, cl_uint, const char **, const size_t *, cl_int *) = NULL; -cl_program CL_API_CALL clCreateProgramWithSource (cl_context context,cl_uint count,const char ** strings,const size_t * lengths,cl_int * errcode_ret) { - if(!clCreateProgramWithSource_ptr) clCreateProgramWithSource_ptr = getFunction("clCreateProgramWithSource"); - return (*clCreateProgramWithSource_ptr)(context, count, strings, lengths, errcode_ret); -} - -static cl_program (*clCreateProgramWithBinary_ptr)(cl_context, cl_uint, const cl_device_id *, const size_t *, const unsigned char **, cl_int *, cl_int *) = NULL; -cl_program CL_API_CALL clCreateProgramWithBinary (cl_context context,cl_uint num_devices,const cl_device_id * device_list,const size_t * lengths,const unsigned char ** binaries,cl_int * binary_status,cl_int * errcode_ret) { - if(!clCreateProgramWithBinary_ptr) clCreateProgramWithBinary_ptr = getFunction("clCreateProgramWithBinary"); - return (*clCreateProgramWithBinary_ptr)(context, num_devices, device_list, lengths, binaries, binary_status, errcode_ret); -} - -static cl_program (*clCreateProgramWithBuiltInKernels_ptr)(cl_context, cl_uint, const cl_device_id *, const char *, cl_int *) = NULL; -cl_program CL_API_CALL clCreateProgramWithBuiltInKernels (cl_context context,cl_uint num_devices,const cl_device_id * device_list,const char * kernel_names,cl_int * errcode_ret) { - if(!clCreateProgramWithBuiltInKernels_ptr) clCreateProgramWithBuiltInKernels_ptr = getFunction("clCreateProgramWithBuiltInKernels"); - return (*clCreateProgramWithBuiltInKernels_ptr)(context, num_devices, device_list, kernel_names, errcode_ret); -} - -static cl_int (*clRetainProgram_ptr)(cl_program) = NULL; -cl_int CL_API_CALL clRetainProgram (cl_program program) { - if(!clRetainProgram_ptr) clRetainProgram_ptr = getFunction("clRetainProgram"); - return (*clRetainProgram_ptr)(program); -} - -static cl_int (*clReleaseProgram_ptr)(cl_program) = NULL; -cl_int CL_API_CALL clReleaseProgram (cl_program program) { - if(!clReleaseProgram_ptr) clReleaseProgram_ptr = getFunction("clReleaseProgram"); - return (*clReleaseProgram_ptr)(program); -} - -static cl_int (*clBuildProgram_ptr)(cl_program, cl_uint, const cl_device_id *, const char *, void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */), void *) = NULL; -cl_int CL_API_CALL clBuildProgram (cl_program program,cl_uint num_devices,const cl_device_id * device_list,const char * options, void (CL_CALLBACK * pfn_notify)(cl_program /* program */, void * /* user_data */),void * user_data) { - if(!clBuildProgram_ptr) clBuildProgram_ptr = getFunction("clBuildProgram"); - return (*clBuildProgram_ptr)(program, num_devices, device_list, options, user_data, user_data); -} - -static cl_int (*clCompileProgram_ptr)(cl_program, cl_uint, const cl_device_id *, const char *, cl_uint, const cl_program *, const char **, void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */), void *) = NULL; -cl_int CL_API_CALL clCompileProgram (cl_program program,cl_uint num_devices,const cl_device_id * device_list,const char * options,cl_uint num_input_headers,const cl_program * input_headers,const char ** header_include_names,void (CL_CALLBACK * pfn_notify)(cl_program /* program */, void * /* user_data */),void * user_data) { - if(!clCompileProgram_ptr) clCompileProgram_ptr = getFunction("clCompileProgram"); - return (*clCompileProgram_ptr)(program, num_devices, device_list, options, num_input_headers, input_headers, header_include_names, user_data, user_data); -} - -static cl_program (*clLinkProgram_ptr)(cl_context, cl_uint, const cl_device_id *, const char *, cl_uint, const cl_program *, void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */), void *, cl_int *) = NULL; -cl_program CL_API_CALL clLinkProgram (cl_context context,cl_uint num_devices,const cl_device_id * device_list,const char * options,cl_uint num_input_programs,const cl_program * input_programs,void (CL_CALLBACK * pfn_notify)(cl_program /* program */, void * /* user_data */),void * user_data,cl_int * errcode_ret) { - if(!clLinkProgram_ptr) clLinkProgram_ptr = getFunction("clLinkProgram"); - return (*clLinkProgram_ptr)(context, num_devices, device_list, options, num_input_programs, input_programs, user_data, user_data, errcode_ret); -} - -static cl_int (*clUnloadPlatformCompiler_ptr)(cl_platform_id) = NULL; -cl_int CL_API_CALL clUnloadPlatformCompiler (cl_platform_id platform) { - if(!clUnloadPlatformCompiler_ptr) clUnloadPlatformCompiler_ptr = getFunction("clUnloadPlatformCompiler"); - return (*clUnloadPlatformCompiler_ptr)(platform); -} - -static cl_int (*clGetProgramInfo_ptr)(cl_program, cl_program_info, size_t, void *, size_t *) = NULL; -cl_int CL_API_CALL clGetProgramInfo (cl_program program,cl_program_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret) { - if(!clGetProgramInfo_ptr) clGetProgramInfo_ptr = getFunction("clGetProgramInfo"); - return (*clGetProgramInfo_ptr)(program, param_name, param_value_size, param_value, param_value_size_ret); -} - -static cl_int (*clGetProgramBuildInfo_ptr)(cl_program, cl_device_id, cl_program_build_info, size_t, void *, size_t *) = NULL; -cl_int CL_API_CALL clGetProgramBuildInfo (cl_program program,cl_device_id device,cl_program_build_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret) { - if(!clGetProgramBuildInfo_ptr) clGetProgramBuildInfo_ptr = getFunction("clGetProgramBuildInfo"); - return (*clGetProgramBuildInfo_ptr)(program, device, param_name, param_value_size, param_value, param_value_size_ret); -} - -static cl_kernel (*clCreateKernel_ptr)(cl_program, const char *, cl_int *) = NULL; -cl_kernel CL_API_CALL clCreateKernel (cl_program program,const char * kernel_name,cl_int * errcode_ret) { - if(!clCreateKernel_ptr) clCreateKernel_ptr = getFunction("clCreateKernel"); - return (*clCreateKernel_ptr)(program, kernel_name, errcode_ret); -} - -static cl_int (*clCreateKernelsInProgram_ptr)(cl_program, cl_uint, cl_kernel *, cl_uint *) = NULL; -cl_int CL_API_CALL clCreateKernelsInProgram (cl_program program,cl_uint num_kernels,cl_kernel * kernels,cl_uint * num_kernels_ret) { - if(!clCreateKernelsInProgram_ptr) clCreateKernelsInProgram_ptr = getFunction("clCreateKernelsInProgram"); - return (*clCreateKernelsInProgram_ptr)(program, num_kernels, kernels, num_kernels_ret); -} - -static cl_int (*clRetainKernel_ptr)(cl_kernel) = NULL; -cl_int CL_API_CALL clRetainKernel (cl_kernel kernel) { - if(!clRetainKernel_ptr) clRetainKernel_ptr = getFunction("clRetainKernel"); - return (*clRetainKernel_ptr)(kernel); -} - -static cl_int (*clReleaseKernel_ptr)(cl_kernel) = NULL; -cl_int CL_API_CALL clReleaseKernel (cl_kernel kernel) { - if(!clReleaseKernel_ptr) clReleaseKernel_ptr = getFunction("clReleaseKernel"); - return (*clReleaseKernel_ptr)(kernel); -} - -static cl_int (*clSetKernelArg_ptr)(cl_kernel, cl_uint, size_t, const void *) = NULL; -cl_int CL_API_CALL clSetKernelArg (cl_kernel kernel,cl_uint arg_index,size_t arg_size,const void * arg_value) { - if(!clSetKernelArg_ptr) clSetKernelArg_ptr = getFunction("clSetKernelArg"); - return (*clSetKernelArg_ptr)(kernel, arg_index, arg_size, arg_value); -} - -static cl_int (*clGetKernelInfo_ptr)(cl_kernel, cl_kernel_info, size_t, void *, size_t *) = NULL; -cl_int CL_API_CALL clGetKernelInfo (cl_kernel kernel,cl_kernel_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret) { - if(!clGetKernelInfo_ptr) clGetKernelInfo_ptr = getFunction("clGetKernelInfo"); - return (*clGetKernelInfo_ptr)(kernel, param_name, param_value_size, param_value, param_value_size_ret); -} - -static cl_int (*clGetKernelArgInfo_ptr)(cl_kernel, cl_uint, cl_kernel_arg_info, size_t, void *, size_t *) = NULL; -cl_int CL_API_CALL clGetKernelArgInfo (cl_kernel kernel,cl_uint arg_indx,cl_kernel_arg_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret) { - if(!clGetKernelArgInfo_ptr) clGetKernelArgInfo_ptr = getFunction("clGetKernelArgInfo"); - return (*clGetKernelArgInfo_ptr)(kernel, arg_indx, param_name, param_value_size, param_value, param_value_size_ret); -} - -static cl_int (*clGetKernelWorkGroupInfo_ptr)(cl_kernel, cl_device_id, cl_kernel_work_group_info, size_t, void *, size_t *) = NULL; -cl_int CL_API_CALL clGetKernelWorkGroupInfo (cl_kernel kernel,cl_device_id device,cl_kernel_work_group_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret) { - if(!clGetKernelWorkGroupInfo_ptr) clGetKernelWorkGroupInfo_ptr = getFunction("clGetKernelWorkGroupInfo"); - return (*clGetKernelWorkGroupInfo_ptr)(kernel, device, param_name, param_value_size, param_value, param_value_size_ret); -} - -static cl_int (*clWaitForEvents_ptr)(cl_uint, const cl_event *) = NULL; -cl_int CL_API_CALL clWaitForEvents (cl_uint num_events,const cl_event * event_list) { - if(!clWaitForEvents_ptr) clWaitForEvents_ptr = getFunction("clWaitForEvents"); - return (*clWaitForEvents_ptr)(num_events, event_list); -} - -static cl_int (*clGetEventInfo_ptr)(cl_event, cl_event_info, size_t, void *, size_t *) = NULL; -cl_int CL_API_CALL clGetEventInfo (cl_event event,cl_event_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret) { - if(!clGetEventInfo_ptr) clGetEventInfo_ptr = getFunction("clGetEventInfo"); - return (*clGetEventInfo_ptr)(event, param_name, param_value_size, param_value, param_value_size_ret); -} - -static cl_event (*clCreateUserEvent_ptr)(cl_context, cl_int * /* errcode_ret */) = NULL; -cl_event CL_API_CALL clCreateUserEvent (cl_context context,cl_int * errcode_ret) -{ - if(!clCreateUserEvent_ptr) clCreateUserEvent_ptr = getFunction("clCreateUserEvent"); - return (*clCreateUserEvent_ptr)(context,errcode_ret); -} - -static cl_int (*clRetainEvent_ptr)(cl_event) = NULL; -cl_int CL_API_CALL clRetainEvent(cl_event event) { - if(!clRetainEvent_ptr) clRetainEvent_ptr = getFunction("clRetainEvent"); - return (*clRetainEvent_ptr)(event); -} - -static cl_int (*clReleaseEvent_ptr)(cl_event) = NULL; -cl_int CL_API_CALL clReleaseEvent (cl_event event) { - if(!clReleaseEvent_ptr) clReleaseEvent_ptr = getFunction("clReleaseEvent"); - return (*clReleaseEvent_ptr)(event); -} - -static cl_int (*clSetUserEventStatus_ptr)(cl_event, cl_int) = NULL; -cl_int CL_API_CALL clSetUserEventStatus (cl_event event,cl_int execution_status) { - if(!clSetUserEventStatus_ptr) clSetUserEventStatus_ptr = getFunction("clSetUserEventStatus"); - return (*clSetUserEventStatus_ptr)(event, execution_status); -} - -static cl_int (*clSetEventCallback_ptr)(cl_event, cl_int, void (CL_CALLBACK * /* pfn_notify */)(cl_event, cl_int, void *), void*) = NULL; -cl_int CL_API_CALL clSetEventCallback (cl_event event,cl_int command_exec_callback_type, void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *), void* user_data) { - if(!clSetEventCallback_ptr) clSetEventCallback_ptr = getFunction("clSetEventCallback"); - return (*clSetEventCallback_ptr)(event, command_exec_callback_type, pfn_notify, user_data); -} - -static cl_int (*clGetEventProfilingInfo_ptr)(cl_event, cl_profiling_info, size_t, void *, size_t *) = NULL; -cl_int CL_API_CALL clGetEventProfilingInfo (cl_event event,cl_profiling_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret) { - if(!clGetEventProfilingInfo_ptr) clGetEventProfilingInfo_ptr = getFunction("clGetEventProfilingInfo"); - return (*clGetEventProfilingInfo_ptr)(event, param_name, param_value_size, param_value, param_value_size_ret); -} - -static cl_int (*clFlush_ptr)(cl_command_queue) = NULL; -cl_int CL_API_CALL clFlush (cl_command_queue command_queue) { - if(!clFlush_ptr) clFlush_ptr = getFunction("clFlush"); - return (*clFlush_ptr)(command_queue); -} - -static cl_int (*clFinish_ptr)(cl_command_queue) = NULL; -cl_int CL_API_CALL clFinish (cl_command_queue command_queue) { - if(!clFinish_ptr) clFinish_ptr = getFunction("clFinish"); - return (*clFinish_ptr)(command_queue); -} - -static cl_int (*clEnqueueReadBuffer_ptr)(cl_command_queue, cl_mem, cl_bool, size_t, size_t, void *, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueReadBuffer (cl_command_queue command_queue,cl_mem buffer,cl_bool blocking_read,size_t offset,size_t size,void * ptr,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueReadBuffer_ptr) clEnqueueReadBuffer_ptr = getFunction("clEnqueueReadBuffer"); - return (*clEnqueueReadBuffer_ptr)(command_queue, buffer, blocking_read, offset, size, ptr, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueReadBufferRect_ptr)(cl_command_queue, cl_mem, cl_bool, const size_t *, const size_t *, const size_t *, size_t, size_t, size_t, size_t, void *, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueReadBufferRect (cl_command_queue command_queue,cl_mem buffer,cl_bool blocking_read,const size_t * buffer_offset,const size_t * host_offset,const size_t * region,size_t buffer_row_pitch,size_t buffer_slice_pitch,size_t host_row_pitch,size_t host_slice_pitch,void * ptr,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueReadBufferRect_ptr) clEnqueueReadBufferRect_ptr = getFunction("clEnqueueReadBufferRect"); - return (*clEnqueueReadBufferRect_ptr)(command_queue, buffer, blocking_read, buffer_offset, host_offset, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueWriteBuffer_ptr)(cl_command_queue, cl_mem, cl_bool, size_t, size_t, const void *, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueWriteBuffer (cl_command_queue command_queue,cl_mem buffer,cl_bool blocking_write,size_t offset,size_t size,const void * ptr,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueWriteBuffer_ptr) clEnqueueWriteBuffer_ptr = getFunction("clEnqueueWriteBuffer"); - return (*clEnqueueWriteBuffer_ptr)(command_queue, buffer, blocking_write, offset, size, ptr, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueWriteBufferRect_ptr)(cl_command_queue, cl_mem, cl_bool, const size_t *, const size_t *, const size_t *, size_t, size_t, size_t, size_t, const void *, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueWriteBufferRect (cl_command_queue command_queue,cl_mem buffer,cl_bool blocking_write,const size_t * buffer_offset,const size_t * host_offset,const size_t * region,size_t buffer_row_pitch,size_t buffer_slice_pitch,size_t host_row_pitch,size_t host_slice_pitch,const void * ptr,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueWriteBufferRect_ptr) clEnqueueWriteBufferRect_ptr = getFunction("clEnqueueWriteBufferRect"); - return (*clEnqueueWriteBufferRect_ptr)(command_queue, buffer, blocking_write, buffer_offset, host_offset, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueFillBuffer_ptr)(cl_command_queue, cl_mem, const void *, size_t, size_t, size_t, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueFillBuffer (cl_command_queue command_queue,cl_mem buffer,const void * pattern,size_t pattern_size,size_t offset,size_t size,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueFillBuffer_ptr) clEnqueueFillBuffer_ptr = getFunction("clEnqueueFillBuffer"); - return (*clEnqueueFillBuffer_ptr)(command_queue, buffer, pattern, pattern_size, offset, size, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueCopyBuffer_ptr)(cl_command_queue, cl_mem, cl_mem, size_t, size_t, size_t, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueCopyBuffer (cl_command_queue command_queue,cl_mem src_buffer,cl_mem dst_buffer,size_t src_offset,size_t dst_offset,size_t size,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueCopyBuffer_ptr) clEnqueueCopyBuffer_ptr = getFunction("clEnqueueCopyBuffer"); - return (*clEnqueueCopyBuffer_ptr)(command_queue, src_buffer, dst_buffer, src_offset, dst_offset, size, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueCopyBufferRect_ptr)(cl_command_queue, cl_mem, cl_mem, const size_t *, const size_t *, const size_t *, size_t, size_t, size_t, size_t, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueCopyBufferRect (cl_command_queue command_queue,cl_mem src_buffer,cl_mem dst_buffer,const size_t * src_origin,const size_t * dst_origin,const size_t * region,size_t src_row_pitch,size_t src_slice_pitch,size_t dst_row_pitch,size_t dst_slice_pitch,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueCopyBufferRect_ptr) clEnqueueCopyBufferRect_ptr = getFunction("clEnqueueCopyBufferRect"); - return (*clEnqueueCopyBufferRect_ptr)(command_queue, src_buffer, dst_buffer, src_origin, dst_origin, region, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueReadImage_ptr)(cl_command_queue, cl_mem, cl_bool, const size_t *, const size_t *, size_t, size_t, void *, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueReadImage (cl_command_queue command_queue,cl_mem image,cl_bool blocking_read,const size_t * origin,const size_t * region,size_t row_pitch,size_t slice_pitch,void * ptr,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueReadImage_ptr) clEnqueueReadImage_ptr = getFunction("clEnqueueReadImage"); - return (*clEnqueueReadImage_ptr)(command_queue, image, blocking_read, origin, region, row_pitch, slice_pitch, ptr, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueWriteImage_ptr)(cl_command_queue, cl_mem, cl_bool, const size_t *, const size_t *, size_t, size_t, const void *, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueWriteImage (cl_command_queue command_queue,cl_mem image,cl_bool blocking_write,const size_t * origin,const size_t * region,size_t input_row_pitch,size_t input_slice_pitch,const void * ptr,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueWriteImage_ptr) clEnqueueWriteImage_ptr = getFunction("clEnqueueWriteImage"); - return (*clEnqueueWriteImage_ptr)(command_queue, image, blocking_write, origin, region, input_row_pitch, input_slice_pitch, ptr, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueFillImage_ptr)(cl_command_queue, cl_mem, const void *, const size_t *, const size_t *, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueFillImage (cl_command_queue command_queue,cl_mem image,const void * fill_color,const size_t * origin,const size_t * region,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueFillImage_ptr) clEnqueueFillImage_ptr = getFunction("clEnqueueFillImage"); - return (*clEnqueueFillImage_ptr)(command_queue, image, fill_color, origin, region, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueCopyImage_ptr)(cl_command_queue, cl_mem, cl_mem, const size_t *, const size_t *, const size_t *, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueCopyImage (cl_command_queue command_queue,cl_mem src_image,cl_mem dst_image,const size_t * src_origin,const size_t * dst_origin,const size_t * region,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueCopyImage_ptr) clEnqueueCopyImage_ptr = getFunction("clEnqueueCopyImage"); - return (*clEnqueueCopyImage_ptr)(command_queue, src_image, dst_image, src_origin, dst_origin, region, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueCopyImageToBuffer_ptr)(cl_command_queue, cl_mem, cl_mem, const size_t *, const size_t *, size_t, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueCopyImageToBuffer (cl_command_queue command_queue,cl_mem src_image,cl_mem dst_buffer,const size_t * src_origin,const size_t * region,size_t dst_offset,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueCopyImageToBuffer_ptr) clEnqueueCopyImageToBuffer_ptr = getFunction("clEnqueueCopyImageToBuffer"); - return (*clEnqueueCopyImageToBuffer_ptr)(command_queue, src_image, dst_buffer, src_origin, region, dst_offset, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueCopyBufferToImage_ptr)(cl_command_queue, cl_mem, cl_mem, size_t, const size_t *, const size_t *, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueCopyBufferToImage (cl_command_queue command_queue,cl_mem src_buffer,cl_mem dst_image,size_t src_offset,const size_t * dst_origin,const size_t * region,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueCopyBufferToImage_ptr) clEnqueueCopyBufferToImage_ptr = getFunction("clEnqueueCopyBufferToImage"); - return (*clEnqueueCopyBufferToImage_ptr)(command_queue, src_buffer, dst_image, src_offset, dst_origin, region, num_events_in_wait_list, event_wait_list, event); -} - -static void * (*clEnqueueMapBuffer_ptr)(cl_command_queue, cl_mem, cl_bool, cl_map_flags, size_t, size_t, cl_uint, const cl_event *, cl_event *, cl_int *) = NULL; -void * CL_API_CALL clEnqueueMapBuffer (cl_command_queue command_queue,cl_mem buffer,cl_bool blocking_map,cl_map_flags map_flags,size_t offset,size_t size,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event,cl_int * errcode_ret) { - if(!clEnqueueMapBuffer_ptr) clEnqueueMapBuffer_ptr = getFunction("clEnqueueMapBuffer"); - return (*clEnqueueMapBuffer_ptr)(command_queue, buffer, blocking_map, map_flags, offset, size, num_events_in_wait_list, event_wait_list, event, errcode_ret); -} - -static void * (*clEnqueueMapImage_ptr)(cl_command_queue, cl_mem, cl_bool, cl_map_flags, const size_t *, const size_t *, size_t *, size_t *, cl_uint, const cl_event *, cl_event *, cl_int *) = NULL; -void * CL_API_CALL clEnqueueMapImage (cl_command_queue command_queue,cl_mem image,cl_bool blocking_map,cl_map_flags map_flags,const size_t * origin,const size_t * region,size_t * image_row_pitch,size_t * image_slice_pitch,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event,cl_int * errcode_ret) { - if(!clEnqueueMapImage_ptr) clEnqueueMapImage_ptr = getFunction("clEnqueueMapImage"); - return (*clEnqueueMapImage_ptr)(command_queue, image, blocking_map, map_flags, origin, region, image_row_pitch, image_slice_pitch, num_events_in_wait_list, event_wait_list, event, errcode_ret); -} - -static cl_int (*clEnqueueUnmapMemObject_ptr)(cl_command_queue, cl_mem, void *, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueUnmapMemObject (cl_command_queue command_queue,cl_mem memobj,void * mapped_ptr,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueUnmapMemObject_ptr) clEnqueueUnmapMemObject_ptr = getFunction("clEnqueueUnmapMemObject"); - return (*clEnqueueUnmapMemObject_ptr)(command_queue, memobj, mapped_ptr, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueMigrateMemObjects_ptr)(cl_command_queue, cl_uint, const cl_mem *, cl_mem_migration_flags, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueMigrateMemObjects (cl_command_queue command_queue,cl_uint num_mem_objects,const cl_mem * mem_objects,cl_mem_migration_flags flags,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueMigrateMemObjects_ptr) clEnqueueMigrateMemObjects_ptr = getFunction("clEnqueueMigrateMemObjects"); - return (*clEnqueueMigrateMemObjects_ptr)(command_queue, num_mem_objects, mem_objects, flags, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueNDRangeKernel_ptr)(cl_command_queue, cl_kernel, cl_uint, const size_t *, const size_t *, const size_t *, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueNDRangeKernel (cl_command_queue command_queue,cl_kernel kernel,cl_uint work_dim,const size_t * global_work_offset,const size_t * global_work_size,const size_t * local_work_size,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueNDRangeKernel_ptr) clEnqueueNDRangeKernel_ptr = getFunction("clEnqueueNDRangeKernel"); - return (*clEnqueueNDRangeKernel_ptr)(command_queue, kernel, work_dim, global_work_offset, global_work_size, local_work_size, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueTask_ptr)(cl_command_queue, cl_kernel, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueTask (cl_command_queue command_queue,cl_kernel kernel,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueTask_ptr) clEnqueueTask_ptr = getFunction("clEnqueueTask"); - return (*clEnqueueTask_ptr)(command_queue, kernel, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueNativeKernel_ptr)(cl_command_queue, void (CL_CALLBACK * /*user_func*/)(void *), void *, size_t, cl_uint, const cl_mem *, const void **, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueNativeKernel (cl_command_queue command_queue,void (CL_CALLBACK *user_func)(void *) ,void * args,size_t cb_args,cl_uint num_mem_objects,const cl_mem * mem_list,const void ** args_mem_loc,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueNativeKernel_ptr) clEnqueueNativeKernel_ptr = getFunction("clEnqueueNativeKernel"); - return (*clEnqueueNativeKernel_ptr)(command_queue, user_func, args, cb_args, num_mem_objects, mem_list, args_mem_loc, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueMarkerWithWaitList_ptr)(cl_command_queue, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueMarkerWithWaitList (cl_command_queue command_queue,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueMarkerWithWaitList_ptr) clEnqueueMarkerWithWaitList_ptr = getFunction("clEnqueueMarkerWithWaitList"); - return (*clEnqueueMarkerWithWaitList_ptr)(command_queue, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueBarrierWithWaitList_ptr)(cl_command_queue, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueBarrierWithWaitList (cl_command_queue command_queue,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueBarrierWithWaitList_ptr) clEnqueueBarrierWithWaitList_ptr = getFunction("clEnqueueBarrierWithWaitList"); - return (*clEnqueueBarrierWithWaitList_ptr)(command_queue, num_events_in_wait_list, event_wait_list, event); -} - -static void * (*clGetExtensionFunctionAddressForPlatform_ptr)(cl_platform_id, const char *) = NULL; -void * CL_API_CALL clGetExtensionFunctionAddressForPlatform (cl_platform_id platform,const char * func_name) { - if(!clGetExtensionFunctionAddressForPlatform_ptr) clGetExtensionFunctionAddressForPlatform_ptr = getFunction("clGetExtensionFunctionAddressForPlatform"); - return (*clGetExtensionFunctionAddressForPlatform_ptr)(platform, func_name); -} - -static CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem (*clCreateImage2D_ptr)(cl_context, cl_mem_flags, const cl_image_format *, size_t, size_t, size_t, void *, cl_int *) = NULL; -CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL clCreateImage2D (cl_context context,cl_mem_flags flags,const cl_image_format * image_format,size_t image_width,size_t image_height,size_t image_row_pitch,void * host_ptr,cl_int * errcode_ret) { - if(!clCreateImage2D_ptr) clCreateImage2D_ptr = getFunction("clCreateImage2D"); - return (*clCreateImage2D_ptr)(context, flags, image_format, image_width, image_height, image_row_pitch, host_ptr, errcode_ret); -} - -static CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem (*clCreateImage3D_ptr)(cl_context, cl_mem_flags, const cl_image_format *, size_t, size_t, size_t, size_t, size_t, void *, cl_int *) = NULL; -CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL clCreateImage3D (cl_context context,cl_mem_flags flags,const cl_image_format * image_format,size_t image_width,size_t image_height,size_t image_depth,size_t image_row_pitch,size_t image_slice_pitch,void * host_ptr,cl_int * errcode_ret) { - if(!clCreateImage3D_ptr) clCreateImage3D_ptr = getFunction("clCreateImage3D"); - return (*clCreateImage3D_ptr)(context, flags, image_format, image_width, image_height, image_depth, image_row_pitch, image_slice_pitch, host_ptr, errcode_ret); -} - -static CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int (*clEnqueueMarker_ptr)(cl_command_queue, cl_event *) = NULL; -CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL clEnqueueMarker (cl_command_queue command_queue,cl_event * event) { - if(!clEnqueueMarker_ptr) clEnqueueMarker_ptr = getFunction("clEnqueueMarker"); - return (*clEnqueueMarker_ptr)(command_queue, event); -} - -static CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int (*clEnqueueWaitForEvents_ptr)(cl_command_queue, cl_uint, const cl_event *) = NULL; -CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL clEnqueueWaitForEvents (cl_command_queue command_queue,cl_uint num_events,const cl_event * event_list) { - if(!clEnqueueWaitForEvents_ptr) clEnqueueWaitForEvents_ptr = getFunction("clEnqueueWaitForEvents"); - return (*clEnqueueWaitForEvents_ptr)(command_queue, num_events, event_list); -} - -static CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int (*clEnqueueBarrier_ptr)(cl_command_queue) = NULL; -CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL clEnqueueBarrier (cl_command_queue command_queue) { - if(!clEnqueueBarrier_ptr) clEnqueueBarrier_ptr = getFunction("clEnqueueBarrier"); - return (*clEnqueueBarrier_ptr)(command_queue); -} - -static CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int (*clUnloadCompiler_ptr)(void) = NULL; -CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL clUnloadCompiler (void) { - if(!clUnloadCompiler_ptr) clUnloadCompiler_ptr = getFunction("clUnloadCompiler"); - return (*clUnloadCompiler_ptr)(); -} - -static CL_EXT_PREFIX__VERSION_1_1_DEPRECATED void * (*clGetExtensionFunctionAddress_ptr)(const char *) = NULL; -CL_EXT_PREFIX__VERSION_1_1_DEPRECATED void * CL_API_CALL clGetExtensionFunctionAddress (const char * func_name) { - if(!clGetExtensionFunctionAddress_ptr) clGetExtensionFunctionAddress_ptr = getFunction("clGetExtensionFunctionAddress"); - return (*clGetExtensionFunctionAddress_ptr)(func_name); -} - diff --git a/Externals/CLRun/clrun/genclext.c b/Externals/CLRun/clrun/genclext.c deleted file mode 100644 index e6a73afabf..0000000000 --- a/Externals/CLRun/clrun/genclext.c +++ /dev/null @@ -1,28 +0,0 @@ -// Automatically generated by generateClRun.pl -#include "dynamiclib.h" -#include "../include/CL/cl_ext.h" - - -static cl_int (*clIcdGetPlatformIDsKHR_ptr)(cl_uint, cl_platform_id *, cl_uint *) = NULL; -cl_int CL_API_CALL clIcdGetPlatformIDsKHR (cl_uint num_entries,cl_platform_id * platforms,cl_uint * num_platforms) { - if(!clIcdGetPlatformIDsKHR_ptr) clIcdGetPlatformIDsKHR_ptr = getFunction("clIcdGetPlatformIDsKHR"); - return (*clIcdGetPlatformIDsKHR_ptr)(num_entries, platforms, num_platforms); -} -static cl_int (* clReleaseDeviceEXT_ptr)(cl_device_id) = NULL; -cl_int CL_API_CALL clReleaseDeviceEXT (cl_device_id device) { - if(! clReleaseDeviceEXT_ptr) clReleaseDeviceEXT_ptr = getFunction(" clReleaseDeviceEXT"); - return (* clReleaseDeviceEXT_ptr)(device); -} - -static cl_int (* clRetainDeviceEXT_ptr)(cl_device_id) = NULL; -cl_int CL_API_CALL clRetainDeviceEXT (cl_device_id device) { - if(! clRetainDeviceEXT_ptr) clRetainDeviceEXT_ptr = getFunction(" clRetainDeviceEXT"); - return (* clRetainDeviceEXT_ptr)(device); -} - -static cl_int (* clCreateSubDevicesEXT_ptr)(cl_device_id, const cl_device_partition_property_ext *, cl_uint, cl_device_id *, cl_uint *) = NULL; -cl_int CL_API_CALL clCreateSubDevicesEXT (cl_device_id in_device,const cl_device_partition_property_ext * properties,cl_uint num_entries,cl_device_id * out_devices,cl_uint * num_devices) { - if(! clCreateSubDevicesEXT_ptr) clCreateSubDevicesEXT_ptr = getFunction(" clCreateSubDevicesEXT"); - return (* clCreateSubDevicesEXT_ptr)(in_device, properties, num_entries, out_devices, num_devices); -} - diff --git a/Externals/CLRun/clrun/genclgl.c b/Externals/CLRun/clrun/genclgl.c deleted file mode 100644 index acb06a1ff7..0000000000 --- a/Externals/CLRun/clrun/genclgl.c +++ /dev/null @@ -1,64 +0,0 @@ -// Automatically generated by generateClRun.pl -#include "dynamiclib.h" -#include "../include/CL/cl_gl.h" - - -static cl_mem (*clCreateFromGLBuffer_ptr)(cl_context, cl_mem_flags, cl_GLuint, int *) = NULL; -cl_mem CL_API_CALL clCreateFromGLBuffer (cl_context context,cl_mem_flags flags,cl_GLuint bufobj,int * errcode_ret) { - if(!clCreateFromGLBuffer_ptr) clCreateFromGLBuffer_ptr = getFunction("clCreateFromGLBuffer"); - return (*clCreateFromGLBuffer_ptr)(context, flags, bufobj, errcode_ret); -} - -static cl_mem (*clCreateFromGLTexture_ptr)(cl_context, cl_mem_flags, cl_GLenum, cl_GLint, cl_GLuint, cl_int *) = NULL; -cl_mem CL_API_CALL clCreateFromGLTexture (cl_context context,cl_mem_flags flags,cl_GLenum target,cl_GLint miplevel,cl_GLuint texture,cl_int * errcode_ret) { - if(!clCreateFromGLTexture_ptr) clCreateFromGLTexture_ptr = getFunction("clCreateFromGLTexture"); - return (*clCreateFromGLTexture_ptr)(context, flags, target, miplevel, texture, errcode_ret); -} - -static cl_mem (*clCreateFromGLRenderbuffer_ptr)(cl_context, cl_mem_flags, cl_GLuint, cl_int *) = NULL; -cl_mem CL_API_CALL clCreateFromGLRenderbuffer (cl_context context,cl_mem_flags flags,cl_GLuint renderbuffer,cl_int * errcode_ret) { - if(!clCreateFromGLRenderbuffer_ptr) clCreateFromGLRenderbuffer_ptr = getFunction("clCreateFromGLRenderbuffer"); - return (*clCreateFromGLRenderbuffer_ptr)(context, flags, renderbuffer, errcode_ret); -} - -static cl_int (*clGetGLObjectInfo_ptr)(cl_mem, cl_gl_object_type *, cl_GLuint *) = NULL; -cl_int CL_API_CALL clGetGLObjectInfo (cl_mem memobj,cl_gl_object_type * gl_object_type,cl_GLuint * gl_object_name) { - if(!clGetGLObjectInfo_ptr) clGetGLObjectInfo_ptr = getFunction("clGetGLObjectInfo"); - return (*clGetGLObjectInfo_ptr)(memobj, gl_object_type, gl_object_name); -} - -static cl_int (*clGetGLTextureInfo_ptr)(cl_mem, cl_gl_texture_info, size_t, void *, size_t *) = NULL; -cl_int CL_API_CALL clGetGLTextureInfo (cl_mem memobj,cl_gl_texture_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret) { - if(!clGetGLTextureInfo_ptr) clGetGLTextureInfo_ptr = getFunction("clGetGLTextureInfo"); - return (*clGetGLTextureInfo_ptr)(memobj, param_name, param_value_size, param_value, param_value_size_ret); -} - -static cl_int (*clEnqueueAcquireGLObjects_ptr)(cl_command_queue, cl_uint, const cl_mem *, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueAcquireGLObjects (cl_command_queue command_queue,cl_uint num_objects,const cl_mem * mem_objects,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueAcquireGLObjects_ptr) clEnqueueAcquireGLObjects_ptr = getFunction("clEnqueueAcquireGLObjects"); - return (*clEnqueueAcquireGLObjects_ptr)(command_queue, num_objects, mem_objects, num_events_in_wait_list, event_wait_list, event); -} - -static cl_int (*clEnqueueReleaseGLObjects_ptr)(cl_command_queue, cl_uint, const cl_mem *, cl_uint, const cl_event *, cl_event *) = NULL; -cl_int CL_API_CALL clEnqueueReleaseGLObjects (cl_command_queue command_queue,cl_uint num_objects,const cl_mem * mem_objects,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event) { - if(!clEnqueueReleaseGLObjects_ptr) clEnqueueReleaseGLObjects_ptr = getFunction("clEnqueueReleaseGLObjects"); - return (*clEnqueueReleaseGLObjects_ptr)(command_queue, num_objects, mem_objects, num_events_in_wait_list, event_wait_list, event); -} - -static CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem (*clCreateFromGLTexture2D_ptr)(cl_context, cl_mem_flags, cl_GLenum, cl_GLint, cl_GLuint, cl_int *) = NULL; -CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL clCreateFromGLTexture2D (cl_context context,cl_mem_flags flags,cl_GLenum target,cl_GLint miplevel,cl_GLuint texture,cl_int * errcode_ret) { - if(!clCreateFromGLTexture2D_ptr) clCreateFromGLTexture2D_ptr = getFunction("clCreateFromGLTexture2D"); - return (*clCreateFromGLTexture2D_ptr)(context, flags, target, miplevel, texture, errcode_ret); -} - -static CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem (*clCreateFromGLTexture3D_ptr)(cl_context, cl_mem_flags, cl_GLenum, cl_GLint, cl_GLuint, cl_int *) = NULL; -CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL clCreateFromGLTexture3D (cl_context context,cl_mem_flags flags,cl_GLenum target,cl_GLint miplevel,cl_GLuint texture,cl_int * errcode_ret) { - if(!clCreateFromGLTexture3D_ptr) clCreateFromGLTexture3D_ptr = getFunction("clCreateFromGLTexture3D"); - return (*clCreateFromGLTexture3D_ptr)(context, flags, target, miplevel, texture, errcode_ret); -} - -static cl_int (*clGetGLContextInfoKHR_ptr)(const cl_context_properties *, cl_gl_context_info, size_t, void *, size_t *) = NULL; -cl_int CL_API_CALL clGetGLContextInfoKHR (const cl_context_properties * properties,cl_gl_context_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret) { - if(!clGetGLContextInfoKHR_ptr) clGetGLContextInfoKHR_ptr = getFunction("clGetGLContextInfoKHR"); - return (*clGetGLContextInfoKHR_ptr)(properties, param_name, param_value_size, param_value, param_value_size_ret); -} diff --git a/Externals/CLRun/clrun/genclglext.c b/Externals/CLRun/clrun/genclglext.c deleted file mode 100644 index 333103ea85..0000000000 --- a/Externals/CLRun/clrun/genclglext.c +++ /dev/null @@ -1,11 +0,0 @@ -// Automatically generated by generateClRun.pl -#include "dynamiclib.h" -#include "../include/CL/cl_gl_ext.h" - - -static cl_event (*clCreateEventFromGLsyncKHR_ptr)(cl_context, cl_GLsync, cl_int *) = NULL; -cl_event CL_API_CALL clCreateEventFromGLsyncKHR (cl_context context,cl_GLsync cl_GLsync,cl_int * errcode_ret) { - if(!clCreateEventFromGLsyncKHR_ptr) clCreateEventFromGLsyncKHR_ptr = getFunction("clCreateEventFromGLsyncKHR"); - return (*clCreateEventFromGLsyncKHR_ptr)(context, cl_GLsync, errcode_ret); -} - diff --git a/Externals/CLRun/clrun/generateClRun.pl b/Externals/CLRun/clrun/generateClRun.pl deleted file mode 100755 index e1571c2012..0000000000 --- a/Externals/CLRun/clrun/generateClRun.pl +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/perl -w -use strict; - -sub trim($) -{ - my $string = shift; - $string =~ s/^\s+//; - $string =~ s/\s+$//; - return $string; -} - -my $filename = shift; - -open(CL, "<$filename") or die "Can't open cl.h"; - -my ($funcRet, $funcName, $args); - -print "// Automatically generated by generateClRun.pl\n"; -print "#include \"dynamiclib.h\"\n"; -print "#include \"$filename\"\n\n\n"; - -while() { - chomp; - next unless $_ =~ /CL_API_ENTRY\s*(.*)\s*CL_API_CALL/; - $funcRet = $1; - my $fa = ""; - my $noArgs = 0; - while() { - $fa .= $_; - last if $_ =~ /;$/; - } - - chomp $fa; - $fa =~ s/\s*\).*;\s*$/\)/g; # remove api - $fa =~ /([^(]*)\((.*)\)/s; - $funcName = $1; - $args = $2; - - # split params by , (ignoring function pointers) - (my @args) = $args =~ m/([^(,]*(?:\([^)]+\)[^(),]*)*[^),]*),?/g; - - my (@argsTypes, @argsNames); - - my $funcArgSig = ""; - my $tmp; - foreach my $arg (@args) { - - next if ($arg eq ""); - my ($type, $name) = $arg =~ m|\s*(.*)\s*/\*\s*(.*)\s*\*/|s; - - # Strip [] - if(defined $name) { - $name =~ s/\[.*\]//g; - } - - if ($arg =~ /\(.*\)/) { - $tmp = $type; - $type =~ s/\(\*.*?\)/\(\*\)/g - } - - push @argsTypes, trim($type); - push @argsNames, trim($name); - - if ($arg =~ /\(.*\)/) { - $funcArgSig .= "$tmp,"; - } elsif(defined $type) { - $funcArgSig .= trim($type)." ".trim($name).","; - } else { # Functions with no arguments (i.e. "void" only) - $funcArgSig = "void,"; - $noArgs = 1; - last; - } - } - - chop($funcArgSig); #last , - - my ($funcArgsNames, $funcArgsTypes); - - if($noArgs eq 0) { - $funcArgsNames = ($#argsNames != -1)? join ', ',@argsNames : ""; - $funcArgsTypes = ($#argsTypes != -1)? join ', ',@argsTypes : ""; - } else { - $funcArgsNames = ""; - $funcArgsTypes = "void"; - } - - my $func = "${funcName}_ptr"; - $args =~ s$(/\*|\*/)$$g; # uncomment names - print "static ".trim($funcRet)." (*$func)($funcArgsTypes) = NULL;\n"; - print trim($funcRet)." CL_API_CALL $funcName ($funcArgSig) {\n"; - print "\tif(!$func) $func = getFunction(\"$funcName\");\n"; - print "\treturn (*$func)($funcArgsNames);\n"; - print "}\n\n"; -} - -close(CL); diff --git a/Externals/CLRun/include/CL/cl.h b/Externals/CLRun/include/CL/cl.h deleted file mode 100644 index 203c65974f..0000000000 --- a/Externals/CLRun/include/CL/cl.h +++ /dev/null @@ -1,1214 +0,0 @@ -/******************************************************************************* - * 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 - * "Materials"), to deal in the Materials without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Materials, and to - * permit persons to whom the Materials are furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Materials. - * - * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. - ******************************************************************************/ - -#ifndef __OPENCL_CL_H -#define __OPENCL_CL_H - -#ifdef __APPLE__ -#include -#else -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/******************************************************************************/ - -typedef struct _cl_platform_id * cl_platform_id; -typedef struct _cl_device_id * cl_device_id; -typedef struct _cl_context * cl_context; -typedef struct _cl_command_queue * cl_command_queue; -typedef struct _cl_mem * cl_mem; -typedef struct _cl_program * cl_program; -typedef struct _cl_kernel * cl_kernel; -typedef struct _cl_event * cl_event; -typedef struct _cl_sampler * cl_sampler; - -typedef cl_uint cl_bool; /* WARNING! Unlike cl_ types in cl_platform.h, cl_bool is not guaranteed to be the same size as the bool in kernels. */ -typedef cl_ulong cl_bitfield; -typedef cl_bitfield cl_device_type; -typedef cl_uint cl_platform_info; -typedef cl_uint cl_device_info; -typedef cl_bitfield cl_device_fp_config; -typedef cl_uint cl_device_mem_cache_type; -typedef cl_uint cl_device_local_mem_type; -typedef cl_bitfield cl_device_exec_capabilities; -typedef cl_bitfield cl_command_queue_properties; -typedef intptr_t cl_device_partition_property; -typedef cl_bitfield cl_device_affinity_domain; - -typedef intptr_t cl_context_properties; -typedef cl_uint cl_context_info; -typedef cl_uint cl_command_queue_info; -typedef cl_uint cl_channel_order; -typedef cl_uint cl_channel_type; -typedef cl_bitfield cl_mem_flags; -typedef cl_uint cl_mem_object_type; -typedef cl_uint cl_mem_info; -typedef cl_bitfield cl_mem_migration_flags; -typedef cl_uint cl_image_info; -typedef cl_uint cl_buffer_create_type; -typedef cl_uint cl_addressing_mode; -typedef cl_uint cl_filter_mode; -typedef cl_uint cl_sampler_info; -typedef cl_bitfield cl_map_flags; -typedef cl_uint cl_program_info; -typedef cl_uint cl_program_build_info; -typedef cl_uint cl_program_binary_type; -typedef cl_int cl_build_status; -typedef cl_uint cl_kernel_info; -typedef cl_uint cl_kernel_arg_info; -typedef cl_uint cl_kernel_arg_address_qualifier; -typedef cl_uint cl_kernel_arg_access_qualifier; -typedef cl_bitfield cl_kernel_arg_type_qualifier; -typedef cl_uint cl_kernel_work_group_info; -typedef cl_uint cl_event_info; -typedef cl_uint cl_command_type; -typedef cl_uint cl_profiling_info; - - -typedef struct _cl_image_format { - cl_channel_order image_channel_order; - cl_channel_type image_channel_data_type; -} cl_image_format; - -typedef struct _cl_image_desc { - cl_mem_object_type image_type; - size_t image_width; - size_t image_height; - size_t image_depth; - size_t image_array_size; - size_t image_row_pitch; - size_t image_slice_pitch; - cl_uint num_mip_levels; - cl_uint num_samples; - cl_mem buffer; -} cl_image_desc; - -typedef struct _cl_buffer_region { - size_t origin; - size_t size; -} cl_buffer_region; - - -/******************************************************************************/ - -/* Error Codes */ -#define CL_SUCCESS 0 -#define CL_DEVICE_NOT_FOUND -1 -#define CL_DEVICE_NOT_AVAILABLE -2 -#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 -#define CL_PROFILING_INFO_NOT_AVAILABLE -7 -#define CL_MEM_COPY_OVERLAP -8 -#define CL_IMAGE_FORMAT_MISMATCH -9 -#define CL_IMAGE_FORMAT_NOT_SUPPORTED -10 -#define CL_BUILD_PROGRAM_FAILURE -11 -#define CL_MAP_FAILURE -12 -#define CL_MISALIGNED_SUB_BUFFER_OFFSET -13 -#define CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST -14 -#define CL_COMPILE_PROGRAM_FAILURE -15 -#define CL_LINKER_NOT_AVAILABLE -16 -#define CL_LINK_PROGRAM_FAILURE -17 -#define CL_DEVICE_PARTITION_FAILED -18 -#define CL_KERNEL_ARG_INFO_NOT_AVAILABLE -19 - -#define CL_INVALID_VALUE -30 -#define CL_INVALID_DEVICE_TYPE -31 -#define CL_INVALID_PLATFORM -32 -#define CL_INVALID_DEVICE -33 -#define CL_INVALID_CONTEXT -34 -#define CL_INVALID_QUEUE_PROPERTIES -35 -#define CL_INVALID_COMMAND_QUEUE -36 -#define CL_INVALID_HOST_PTR -37 -#define CL_INVALID_MEM_OBJECT -38 -#define CL_INVALID_IMAGE_FORMAT_DESCRIPTOR -39 -#define CL_INVALID_IMAGE_SIZE -40 -#define CL_INVALID_SAMPLER -41 -#define CL_INVALID_BINARY -42 -#define CL_INVALID_BUILD_OPTIONS -43 -#define CL_INVALID_PROGRAM -44 -#define CL_INVALID_PROGRAM_EXECUTABLE -45 -#define CL_INVALID_KERNEL_NAME -46 -#define CL_INVALID_KERNEL_DEFINITION -47 -#define CL_INVALID_KERNEL -48 -#define CL_INVALID_ARG_INDEX -49 -#define CL_INVALID_ARG_VALUE -50 -#define CL_INVALID_ARG_SIZE -51 -#define CL_INVALID_KERNEL_ARGS -52 -#define CL_INVALID_WORK_DIMENSION -53 -#define CL_INVALID_WORK_GROUP_SIZE -54 -#define CL_INVALID_WORK_ITEM_SIZE -55 -#define CL_INVALID_GLOBAL_OFFSET -56 -#define CL_INVALID_EVENT_WAIT_LIST -57 -#define CL_INVALID_EVENT -58 -#define CL_INVALID_OPERATION -59 -#define CL_INVALID_GL_OBJECT -60 -#define CL_INVALID_BUFFER_SIZE -61 -#define CL_INVALID_MIP_LEVEL -62 -#define CL_INVALID_GLOBAL_WORK_SIZE -63 -#define CL_INVALID_PROPERTY -64 -#define CL_INVALID_IMAGE_DESCRIPTOR -65 -#define CL_INVALID_COMPILER_OPTIONS -66 -#define CL_INVALID_LINKER_OPTIONS -67 -#define CL_INVALID_DEVICE_PARTITION_COUNT -68 - -/* OpenCL Version */ -#define CL_VERSION_1_0 1 -#define CL_VERSION_1_1 1 -#define CL_VERSION_1_2 1 - -/* cl_bool */ -#define CL_FALSE 0 -#define CL_TRUE 1 -#define CL_BLOCKING CL_TRUE -#define CL_NON_BLOCKING CL_FALSE - -/* cl_platform_info */ -#define CL_PLATFORM_PROFILE 0x0900 -#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) -#define CL_DEVICE_TYPE_CPU (1 << 1) -#define CL_DEVICE_TYPE_GPU (1 << 2) -#define CL_DEVICE_TYPE_ACCELERATOR (1 << 3) -#define CL_DEVICE_TYPE_CUSTOM (1 << 4) -#define CL_DEVICE_TYPE_ALL 0xFFFFFFFF - -/* cl_device_info */ -#define CL_DEVICE_TYPE 0x1000 -#define CL_DEVICE_VENDOR_ID 0x1001 -#define CL_DEVICE_MAX_COMPUTE_UNITS 0x1002 -#define CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS 0x1003 -#define CL_DEVICE_MAX_WORK_GROUP_SIZE 0x1004 -#define CL_DEVICE_MAX_WORK_ITEM_SIZES 0x1005 -#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR 0x1006 -#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT 0x1007 -#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT 0x1008 -#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG 0x1009 -#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT 0x100A -#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE 0x100B -#define CL_DEVICE_MAX_CLOCK_FREQUENCY 0x100C -#define CL_DEVICE_ADDRESS_BITS 0x100D -#define CL_DEVICE_MAX_READ_IMAGE_ARGS 0x100E -#define CL_DEVICE_MAX_WRITE_IMAGE_ARGS 0x100F -#define CL_DEVICE_MAX_MEM_ALLOC_SIZE 0x1010 -#define CL_DEVICE_IMAGE2D_MAX_WIDTH 0x1011 -#define CL_DEVICE_IMAGE2D_MAX_HEIGHT 0x1012 -#define CL_DEVICE_IMAGE3D_MAX_WIDTH 0x1013 -#define CL_DEVICE_IMAGE3D_MAX_HEIGHT 0x1014 -#define CL_DEVICE_IMAGE3D_MAX_DEPTH 0x1015 -#define CL_DEVICE_IMAGE_SUPPORT 0x1016 -#define CL_DEVICE_MAX_PARAMETER_SIZE 0x1017 -#define CL_DEVICE_MAX_SAMPLERS 0x1018 -#define CL_DEVICE_MEM_BASE_ADDR_ALIGN 0x1019 -#define CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE 0x101A -#define CL_DEVICE_SINGLE_FP_CONFIG 0x101B -#define CL_DEVICE_GLOBAL_MEM_CACHE_TYPE 0x101C -#define CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE 0x101D -#define CL_DEVICE_GLOBAL_MEM_CACHE_SIZE 0x101E -#define CL_DEVICE_GLOBAL_MEM_SIZE 0x101F -#define CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE 0x1020 -#define CL_DEVICE_MAX_CONSTANT_ARGS 0x1021 -#define CL_DEVICE_LOCAL_MEM_TYPE 0x1022 -#define CL_DEVICE_LOCAL_MEM_SIZE 0x1023 -#define CL_DEVICE_ERROR_CORRECTION_SUPPORT 0x1024 -#define CL_DEVICE_PROFILING_TIMER_RESOLUTION 0x1025 -#define CL_DEVICE_ENDIAN_LITTLE 0x1026 -#define CL_DEVICE_AVAILABLE 0x1027 -#define CL_DEVICE_COMPILER_AVAILABLE 0x1028 -#define CL_DEVICE_EXECUTION_CAPABILITIES 0x1029 -#define CL_DEVICE_QUEUE_PROPERTIES 0x102A -#define CL_DEVICE_NAME 0x102B -#define CL_DEVICE_VENDOR 0x102C -#define CL_DRIVER_VERSION 0x102D -#define CL_DEVICE_PROFILE 0x102E -#define CL_DEVICE_VERSION 0x102F -#define CL_DEVICE_EXTENSIONS 0x1030 -#define CL_DEVICE_PLATFORM 0x1031 -#define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032 -/* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG */ -#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF 0x1034 -#define CL_DEVICE_HOST_UNIFIED_MEMORY 0x1035 -#define CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR 0x1036 -#define CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT 0x1037 -#define CL_DEVICE_NATIVE_VECTOR_WIDTH_INT 0x1038 -#define CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG 0x1039 -#define CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT 0x103A -#define CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE 0x103B -#define CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF 0x103C -#define CL_DEVICE_OPENCL_C_VERSION 0x103D -#define CL_DEVICE_LINKER_AVAILABLE 0x103E -#define CL_DEVICE_BUILT_IN_KERNELS 0x103F -#define CL_DEVICE_IMAGE_MAX_BUFFER_SIZE 0x1040 -#define CL_DEVICE_IMAGE_MAX_ARRAY_SIZE 0x1041 -#define CL_DEVICE_PARENT_DEVICE 0x1042 -#define CL_DEVICE_PARTITION_MAX_SUB_DEVICES 0x1043 -#define CL_DEVICE_PARTITION_PROPERTIES 0x1044 -#define CL_DEVICE_PARTITION_AFFINITY_DOMAIN 0x1045 -#define CL_DEVICE_PARTITION_TYPE 0x1046 -#define CL_DEVICE_REFERENCE_COUNT 0x1047 -#define CL_DEVICE_PREFERRED_INTEROP_USER_SYNC 0x1048 -#define CL_DEVICE_PRINTF_BUFFER_SIZE 0x1049 -#define CL_DEVICE_IMAGE_PITCH_ALIGNMENT 0x104A -#define CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT 0x104B - -/* cl_device_fp_config - bitfield */ -#define CL_FP_DENORM (1 << 0) -#define CL_FP_INF_NAN (1 << 1) -#define CL_FP_ROUND_TO_NEAREST (1 << 2) -#define CL_FP_ROUND_TO_ZERO (1 << 3) -#define CL_FP_ROUND_TO_INF (1 << 4) -#define CL_FP_FMA (1 << 5) -#define CL_FP_SOFT_FLOAT (1 << 6) -#define CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT (1 << 7) - -/* cl_device_mem_cache_type */ -#define CL_NONE 0x0 -#define CL_READ_ONLY_CACHE 0x1 -#define CL_READ_WRITE_CACHE 0x2 - -/* cl_device_local_mem_type */ -#define CL_LOCAL 0x1 -#define CL_GLOBAL 0x2 - -/* cl_device_exec_capabilities - bitfield */ -#define CL_EXEC_KERNEL (1 << 0) -#define CL_EXEC_NATIVE_KERNEL (1 << 1) - -/* cl_command_queue_properties - bitfield */ -#define CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE (1 << 0) -#define CL_QUEUE_PROFILING_ENABLE (1 << 1) - -/* cl_context_info */ -#define CL_CONTEXT_REFERENCE_COUNT 0x1080 -#define CL_CONTEXT_DEVICES 0x1081 -#define CL_CONTEXT_PROPERTIES 0x1082 -#define CL_CONTEXT_NUM_DEVICES 0x1083 - -/* cl_context_properties */ -#define CL_CONTEXT_PLATFORM 0x1084 -#define CL_CONTEXT_INTEROP_USER_SYNC 0x1085 - -/* cl_device_partition_property */ -#define CL_DEVICE_PARTITION_EQUALLY 0x1086 -#define CL_DEVICE_PARTITION_BY_COUNTS 0x1087 -#define CL_DEVICE_PARTITION_BY_COUNTS_LIST_END 0x0 -#define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN 0x1088 - -/* cl_device_affinity_domain */ -#define CL_DEVICE_AFFINITY_DOMAIN_NUMA (1 << 0) -#define CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE (1 << 1) -#define CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE (1 << 2) -#define CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE (1 << 3) -#define CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE (1 << 4) -#define CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE (1 << 5) - -/* cl_command_queue_info */ -#define CL_QUEUE_CONTEXT 0x1090 -#define CL_QUEUE_DEVICE 0x1091 -#define CL_QUEUE_REFERENCE_COUNT 0x1092 -#define CL_QUEUE_PROPERTIES 0x1093 - -/* cl_mem_flags - bitfield */ -#define CL_MEM_READ_WRITE (1 << 0) -#define CL_MEM_WRITE_ONLY (1 << 1) -#define CL_MEM_READ_ONLY (1 << 2) -#define CL_MEM_USE_HOST_PTR (1 << 3) -#define CL_MEM_ALLOC_HOST_PTR (1 << 4) -#define CL_MEM_COPY_HOST_PTR (1 << 5) -// reserved (1 << 6) -#define CL_MEM_HOST_WRITE_ONLY (1 << 7) -#define CL_MEM_HOST_READ_ONLY (1 << 8) -#define CL_MEM_HOST_NO_ACCESS (1 << 9) - -/* cl_mem_migration_flags - bitfield */ -#define CL_MIGRATE_MEM_OBJECT_HOST (1 << 0) -#define CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED (1 << 1) - -/* cl_channel_order */ -#define CL_R 0x10B0 -#define CL_A 0x10B1 -#define CL_RG 0x10B2 -#define CL_RA 0x10B3 -#define CL_RGB 0x10B4 -#define CL_RGBA 0x10B5 -#define CL_BGRA 0x10B6 -#define CL_ARGB 0x10B7 -#define CL_INTENSITY 0x10B8 -#define CL_LUMINANCE 0x10B9 -#define CL_Rx 0x10BA -#define CL_RGx 0x10BB -#define CL_RGBx 0x10BC -#define CL_DEPTH 0x10BD -#define CL_DEPTH_STENCIL 0x10BE - -/* cl_channel_type */ -#define CL_SNORM_INT8 0x10D0 -#define CL_SNORM_INT16 0x10D1 -#define CL_UNORM_INT8 0x10D2 -#define CL_UNORM_INT16 0x10D3 -#define CL_UNORM_SHORT_565 0x10D4 -#define CL_UNORM_SHORT_555 0x10D5 -#define CL_UNORM_INT_101010 0x10D6 -#define CL_SIGNED_INT8 0x10D7 -#define CL_SIGNED_INT16 0x10D8 -#define CL_SIGNED_INT32 0x10D9 -#define CL_UNSIGNED_INT8 0x10DA -#define CL_UNSIGNED_INT16 0x10DB -#define CL_UNSIGNED_INT32 0x10DC -#define CL_HALF_FLOAT 0x10DD -#define CL_FLOAT 0x10DE -#define CL_UNORM_INT24 0x10DF - -/* cl_mem_object_type */ -#define CL_MEM_OBJECT_BUFFER 0x10F0 -#define CL_MEM_OBJECT_IMAGE2D 0x10F1 -#define CL_MEM_OBJECT_IMAGE3D 0x10F2 -#define CL_MEM_OBJECT_IMAGE2D_ARRAY 0x10F3 -#define CL_MEM_OBJECT_IMAGE1D 0x10F4 -#define CL_MEM_OBJECT_IMAGE1D_ARRAY 0x10F5 -#define CL_MEM_OBJECT_IMAGE1D_BUFFER 0x10F6 - -/* cl_mem_info */ -#define CL_MEM_TYPE 0x1100 -#define CL_MEM_FLAGS 0x1101 -#define CL_MEM_SIZE 0x1102 -#define CL_MEM_HOST_PTR 0x1103 -#define CL_MEM_MAP_COUNT 0x1104 -#define CL_MEM_REFERENCE_COUNT 0x1105 -#define CL_MEM_CONTEXT 0x1106 -#define CL_MEM_ASSOCIATED_MEMOBJECT 0x1107 -#define CL_MEM_OFFSET 0x1108 - -/* cl_image_info */ -#define CL_IMAGE_FORMAT 0x1110 -#define CL_IMAGE_ELEMENT_SIZE 0x1111 -#define CL_IMAGE_ROW_PITCH 0x1112 -#define CL_IMAGE_SLICE_PITCH 0x1113 -#define CL_IMAGE_WIDTH 0x1114 -#define CL_IMAGE_HEIGHT 0x1115 -#define CL_IMAGE_DEPTH 0x1116 -#define CL_IMAGE_ARRAY_SIZE 0x1117 -#define CL_IMAGE_BUFFER 0x1118 -#define CL_IMAGE_NUM_MIP_LEVELS 0x1119 -#define CL_IMAGE_NUM_SAMPLES 0x111A - -/* cl_addressing_mode */ -#define CL_ADDRESS_NONE 0x1130 -#define CL_ADDRESS_CLAMP_TO_EDGE 0x1131 -#define CL_ADDRESS_CLAMP 0x1132 -#define CL_ADDRESS_REPEAT 0x1133 -#define CL_ADDRESS_MIRRORED_REPEAT 0x1134 - -/* cl_filter_mode */ -#define CL_FILTER_NEAREST 0x1140 -#define CL_FILTER_LINEAR 0x1141 - -/* cl_sampler_info */ -#define CL_SAMPLER_REFERENCE_COUNT 0x1150 -#define CL_SAMPLER_CONTEXT 0x1151 -#define CL_SAMPLER_NORMALIZED_COORDS 0x1152 -#define CL_SAMPLER_ADDRESSING_MODE 0x1153 -#define CL_SAMPLER_FILTER_MODE 0x1154 - -/* cl_map_flags - bitfield */ -#define CL_MAP_READ (1 << 0) -#define CL_MAP_WRITE (1 << 1) -#define CL_MAP_WRITE_INVALIDATE_REGION (1 << 2) - -/* cl_program_info */ -#define CL_PROGRAM_REFERENCE_COUNT 0x1160 -#define CL_PROGRAM_CONTEXT 0x1161 -#define CL_PROGRAM_NUM_DEVICES 0x1162 -#define CL_PROGRAM_DEVICES 0x1163 -#define CL_PROGRAM_SOURCE 0x1164 -#define CL_PROGRAM_BINARY_SIZES 0x1165 -#define CL_PROGRAM_BINARIES 0x1166 -#define CL_PROGRAM_NUM_KERNELS 0x1167 -#define CL_PROGRAM_KERNEL_NAMES 0x1168 - -/* cl_program_build_info */ -#define CL_PROGRAM_BUILD_STATUS 0x1181 -#define CL_PROGRAM_BUILD_OPTIONS 0x1182 -#define CL_PROGRAM_BUILD_LOG 0x1183 -#define CL_PROGRAM_BINARY_TYPE 0x1184 - -/* cl_program_binary_type */ -#define CL_PROGRAM_BINARY_TYPE_NONE 0x0 -#define CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT 0x1 -#define CL_PROGRAM_BINARY_TYPE_LIBRARY 0x2 -#define CL_PROGRAM_BINARY_TYPE_EXECUTABLE 0x4 - -/* cl_build_status */ -#define CL_BUILD_SUCCESS 0 -#define CL_BUILD_NONE -1 -#define CL_BUILD_ERROR -2 -#define CL_BUILD_IN_PROGRESS -3 - -/* cl_kernel_info */ -#define CL_KERNEL_FUNCTION_NAME 0x1190 -#define CL_KERNEL_NUM_ARGS 0x1191 -#define CL_KERNEL_REFERENCE_COUNT 0x1192 -#define CL_KERNEL_CONTEXT 0x1193 -#define CL_KERNEL_PROGRAM 0x1194 -#define CL_KERNEL_ATTRIBUTES 0x1195 - -/* cl_kernel_arg_info */ -#define CL_KERNEL_ARG_ADDRESS_QUALIFIER 0x1196 -#define CL_KERNEL_ARG_ACCESS_QUALIFIER 0x1197 -#define CL_KERNEL_ARG_TYPE_NAME 0x1198 -#define CL_KERNEL_ARG_TYPE_QUALIFIER 0x1199 -#define CL_KERNEL_ARG_NAME 0x119A - -/* cl_kernel_arg_address_qualifier */ -#define CL_KERNEL_ARG_ADDRESS_GLOBAL 0x119B -#define CL_KERNEL_ARG_ADDRESS_LOCAL 0x119C -#define CL_KERNEL_ARG_ADDRESS_CONSTANT 0x119D -#define CL_KERNEL_ARG_ADDRESS_PRIVATE 0x119E - -/* cl_kernel_arg_access_qualifier */ -#define CL_KERNEL_ARG_ACCESS_READ_ONLY 0x11A0 -#define CL_KERNEL_ARG_ACCESS_WRITE_ONLY 0x11A1 -#define CL_KERNEL_ARG_ACCESS_READ_WRITE 0x11A2 -#define CL_KERNEL_ARG_ACCESS_NONE 0x11A3 - -/* cl_kernel_arg_type_qualifer */ -#define CL_KERNEL_ARG_TYPE_NONE 0 -#define CL_KERNEL_ARG_TYPE_CONST (1 << 0) -#define CL_KERNEL_ARG_TYPE_RESTRICT (1 << 1) -#define CL_KERNEL_ARG_TYPE_VOLATILE (1 << 2) - -/* cl_kernel_work_group_info */ -#define CL_KERNEL_WORK_GROUP_SIZE 0x11B0 -#define CL_KERNEL_COMPILE_WORK_GROUP_SIZE 0x11B1 -#define CL_KERNEL_LOCAL_MEM_SIZE 0x11B2 -#define CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE 0x11B3 -#define CL_KERNEL_PRIVATE_MEM_SIZE 0x11B4 -#define CL_KERNEL_GLOBAL_WORK_SIZE 0x11B5 - -/* cl_event_info */ -#define CL_EVENT_COMMAND_QUEUE 0x11D0 -#define CL_EVENT_COMMAND_TYPE 0x11D1 -#define CL_EVENT_REFERENCE_COUNT 0x11D2 -#define CL_EVENT_COMMAND_EXECUTION_STATUS 0x11D3 -#define CL_EVENT_CONTEXT 0x11D4 - -/* cl_command_type */ -#define CL_COMMAND_NDRANGE_KERNEL 0x11F0 -#define CL_COMMAND_TASK 0x11F1 -#define CL_COMMAND_NATIVE_KERNEL 0x11F2 -#define CL_COMMAND_READ_BUFFER 0x11F3 -#define CL_COMMAND_WRITE_BUFFER 0x11F4 -#define CL_COMMAND_COPY_BUFFER 0x11F5 -#define CL_COMMAND_READ_IMAGE 0x11F6 -#define CL_COMMAND_WRITE_IMAGE 0x11F7 -#define CL_COMMAND_COPY_IMAGE 0x11F8 -#define CL_COMMAND_COPY_IMAGE_TO_BUFFER 0x11F9 -#define CL_COMMAND_COPY_BUFFER_TO_IMAGE 0x11FA -#define CL_COMMAND_MAP_BUFFER 0x11FB -#define CL_COMMAND_MAP_IMAGE 0x11FC -#define CL_COMMAND_UNMAP_MEM_OBJECT 0x11FD -#define CL_COMMAND_MARKER 0x11FE -#define CL_COMMAND_ACQUIRE_GL_OBJECTS 0x11FF -#define CL_COMMAND_RELEASE_GL_OBJECTS 0x1200 -#define CL_COMMAND_READ_BUFFER_RECT 0x1201 -#define CL_COMMAND_WRITE_BUFFER_RECT 0x1202 -#define CL_COMMAND_COPY_BUFFER_RECT 0x1203 -#define CL_COMMAND_USER 0x1204 -#define CL_COMMAND_BARRIER 0x1205 -#define CL_COMMAND_MIGRATE_MEM_OBJECTS 0x1206 -#define CL_COMMAND_FILL_BUFFER 0x1207 -#define CL_COMMAND_FILL_IMAGE 0x1208 - -/* command execution status */ -#define CL_COMPLETE 0x0 -#define CL_RUNNING 0x1 -#define CL_SUBMITTED 0x2 -#define CL_QUEUED 0x3 - -/* cl_buffer_create_type */ -#define CL_BUFFER_CREATE_TYPE_REGION 0x1220 - -/* cl_profiling_info */ -#define CL_PROFILING_COMMAND_QUEUED 0x1280 -#define CL_PROFILING_COMMAND_SUBMIT 0x1281 -#define CL_PROFILING_COMMAND_START 0x1282 -#define CL_PROFILING_COMMAND_END 0x1283 - -/********************************************************************************************************/ - -/* Platform API */ -extern CL_API_ENTRY cl_int CL_API_CALL -clGetPlatformIDs(cl_uint /* num_entries */, - cl_platform_id * /* platforms */, - cl_uint * /* num_platforms */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clGetPlatformInfo(cl_platform_id /* platform */, - cl_platform_info /* param_name */, - size_t /* param_value_size */, - void * /* param_value */, - size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; - -/* Device APIs */ -extern CL_API_ENTRY cl_int CL_API_CALL -clGetDeviceIDs(cl_platform_id /* platform */, - cl_device_type /* device_type */, - cl_uint /* num_entries */, - cl_device_id * /* devices */, - cl_uint * /* num_devices */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clGetDeviceInfo(cl_device_id /* device */, - cl_device_info /* param_name */, - size_t /* param_value_size */, - void * /* param_value */, - size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clCreateSubDevices(cl_device_id /* in_device */, - const cl_device_partition_property * /* properties */, - cl_uint /* num_devices */, - cl_device_id * /* out_devices */, - cl_uint * /* num_devices_ret */) CL_API_SUFFIX__VERSION_1_2; - -extern CL_API_ENTRY cl_int CL_API_CALL -clRetainDevice(cl_device_id /* device */) CL_API_SUFFIX__VERSION_1_2; - -extern CL_API_ENTRY cl_int CL_API_CALL -clReleaseDevice(cl_device_id /* device */) CL_API_SUFFIX__VERSION_1_2; - -/* Context APIs */ -extern CL_API_ENTRY cl_context CL_API_CALL -clCreateContext(const cl_context_properties * /* properties */, - cl_uint /* num_devices */, - const cl_device_id * /* devices */, - void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *), - void * /* user_data */, - cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_context CL_API_CALL -clCreateContextFromType(const cl_context_properties * /* properties */, - cl_device_type /* device_type */, - void (CL_CALLBACK * /* pfn_notify*/ )(const char *, const void *, size_t, void *), - void * /* user_data */, - cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clRetainContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clReleaseContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clGetContextInfo(cl_context /* context */, - cl_context_info /* param_name */, - size_t /* param_value_size */, - void * /* param_value */, - size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; - -/* Command Queue APIs */ -extern CL_API_ENTRY cl_command_queue CL_API_CALL -clCreateCommandQueue(cl_context /* context */, - cl_device_id /* device */, - cl_command_queue_properties /* properties */, - cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clRetainCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clReleaseCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clGetCommandQueueInfo(cl_command_queue /* command_queue */, - cl_command_queue_info /* param_name */, - size_t /* param_value_size */, - void * /* param_value */, - size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; - -/* Memory Object APIs */ -extern CL_API_ENTRY cl_mem CL_API_CALL -clCreateBuffer(cl_context /* context */, - cl_mem_flags /* flags */, - size_t /* size */, - void * /* host_ptr */, - cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_mem CL_API_CALL -clCreateSubBuffer(cl_mem /* buffer */, - cl_mem_flags /* flags */, - cl_buffer_create_type /* buffer_create_type */, - const void * /* buffer_create_info */, - cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1; - -extern CL_API_ENTRY cl_mem CL_API_CALL -clCreateImage(cl_context /* context */, - cl_mem_flags /* flags */, - const cl_image_format * /* image_format */, - const cl_image_desc * /* image_desc */, - void * /* host_ptr */, - cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2; - -extern CL_API_ENTRY cl_int CL_API_CALL -clRetainMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clReleaseMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clGetSupportedImageFormats(cl_context /* context */, - cl_mem_flags /* flags */, - cl_mem_object_type /* image_type */, - cl_uint /* num_entries */, - cl_image_format * /* image_formats */, - cl_uint * /* num_image_formats */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clGetMemObjectInfo(cl_mem /* memobj */, - cl_mem_info /* param_name */, - size_t /* param_value_size */, - void * /* param_value */, - size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clGetImageInfo(cl_mem /* image */, - cl_image_info /* param_name */, - size_t /* param_value_size */, - void * /* param_value */, - size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clSetMemObjectDestructorCallback( cl_mem /* memobj */, - void (CL_CALLBACK * /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/), - void * /*user_data */ ) CL_API_SUFFIX__VERSION_1_1; - -/* Sampler APIs */ -extern CL_API_ENTRY cl_sampler CL_API_CALL -clCreateSampler(cl_context /* context */, - cl_bool /* normalized_coords */, - cl_addressing_mode /* addressing_mode */, - cl_filter_mode /* filter_mode */, - cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clRetainSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clReleaseSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clGetSamplerInfo(cl_sampler /* sampler */, - cl_sampler_info /* param_name */, - size_t /* param_value_size */, - void * /* param_value */, - size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; - -/* Program Object APIs */ -extern CL_API_ENTRY cl_program CL_API_CALL -clCreateProgramWithSource(cl_context /* context */, - cl_uint /* count */, - const char ** /* strings */, - const size_t * /* lengths */, - cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_program CL_API_CALL -clCreateProgramWithBinary(cl_context /* context */, - cl_uint /* num_devices */, - const cl_device_id * /* device_list */, - const size_t * /* lengths */, - const unsigned char ** /* binaries */, - cl_int * /* binary_status */, - cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_program CL_API_CALL -clCreateProgramWithBuiltInKernels(cl_context /* context */, - cl_uint /* num_devices */, - const cl_device_id * /* device_list */, - const char * /* kernel_names */, - cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2; - -extern CL_API_ENTRY cl_int CL_API_CALL -clRetainProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clReleaseProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clBuildProgram(cl_program /* program */, - cl_uint /* num_devices */, - const cl_device_id * /* device_list */, - const char * /* options */, - void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */), - void * /* user_data */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clCompileProgram(cl_program /* program */, - cl_uint /* num_devices */, - const cl_device_id * /* device_list */, - const char * /* options */, - cl_uint /* num_input_headers */, - const cl_program * /* input_headers */, - const char ** /* header_include_names */, - void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */), - void * /* user_data */) CL_API_SUFFIX__VERSION_1_2; - -extern CL_API_ENTRY cl_program CL_API_CALL -clLinkProgram(cl_context /* context */, - cl_uint /* num_devices */, - const cl_device_id * /* device_list */, - const char * /* options */, - cl_uint /* num_input_programs */, - const cl_program * /* input_programs */, - void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */), - void * /* user_data */, - cl_int * /* errcode_ret */ ) CL_API_SUFFIX__VERSION_1_2; - - -extern CL_API_ENTRY cl_int CL_API_CALL -clUnloadPlatformCompiler(cl_platform_id /* platform */) CL_API_SUFFIX__VERSION_1_2; - -extern CL_API_ENTRY cl_int CL_API_CALL -clGetProgramInfo(cl_program /* program */, - cl_program_info /* param_name */, - size_t /* param_value_size */, - void * /* param_value */, - size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clGetProgramBuildInfo(cl_program /* program */, - cl_device_id /* device */, - cl_program_build_info /* param_name */, - size_t /* param_value_size */, - void * /* param_value */, - size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; - -/* Kernel Object APIs */ -extern CL_API_ENTRY cl_kernel CL_API_CALL -clCreateKernel(cl_program /* program */, - const char * /* kernel_name */, - cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clCreateKernelsInProgram(cl_program /* program */, - cl_uint /* num_kernels */, - cl_kernel * /* kernels */, - cl_uint * /* num_kernels_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clRetainKernel(cl_kernel /* kernel */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clReleaseKernel(cl_kernel /* kernel */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clSetKernelArg(cl_kernel /* kernel */, - cl_uint /* arg_index */, - size_t /* arg_size */, - const void * /* arg_value */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clGetKernelInfo(cl_kernel /* kernel */, - cl_kernel_info /* param_name */, - size_t /* param_value_size */, - void * /* param_value */, - size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clGetKernelArgInfo(cl_kernel /* kernel */, - cl_uint /* arg_indx */, - cl_kernel_arg_info /* param_name */, - size_t /* param_value_size */, - void * /* param_value */, - size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_2; - -extern CL_API_ENTRY cl_int CL_API_CALL -clGetKernelWorkGroupInfo(cl_kernel /* kernel */, - cl_device_id /* device */, - cl_kernel_work_group_info /* param_name */, - size_t /* param_value_size */, - void * /* param_value */, - size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; - -/* Event Object APIs */ -extern CL_API_ENTRY cl_int CL_API_CALL -clWaitForEvents(cl_uint /* num_events */, - const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clGetEventInfo(cl_event /* event */, - cl_event_info /* param_name */, - size_t /* param_value_size */, - void * /* param_value */, - size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_event CL_API_CALL -clCreateUserEvent(cl_context /* context */, - cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1; - -extern CL_API_ENTRY cl_int CL_API_CALL -clRetainEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clReleaseEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clSetUserEventStatus(cl_event /* event */, - cl_int /* execution_status */) CL_API_SUFFIX__VERSION_1_1; - -extern CL_API_ENTRY cl_int CL_API_CALL -clSetEventCallback( cl_event /* event */, - cl_int /* command_exec_callback_type */, - void (CL_CALLBACK * /* pfn_notify */)(cl_event, cl_int, void *), - void * /* user_data */) CL_API_SUFFIX__VERSION_1_1; - -/* Profiling APIs */ -extern CL_API_ENTRY cl_int CL_API_CALL -clGetEventProfilingInfo(cl_event /* event */, - cl_profiling_info /* param_name */, - size_t /* param_value_size */, - void * /* param_value */, - size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; - -/* Flush and Finish APIs */ -extern CL_API_ENTRY cl_int CL_API_CALL -clFlush(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clFinish(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0; - -/* Enqueued Commands APIs */ -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueReadBuffer(cl_command_queue /* command_queue */, - cl_mem /* buffer */, - cl_bool /* blocking_read */, - size_t /* offset */, - size_t /* size */, - void * /* ptr */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueReadBufferRect(cl_command_queue /* command_queue */, - cl_mem /* buffer */, - cl_bool /* blocking_read */, - const size_t * /* buffer_offset */, - const size_t * /* host_offset */, - const size_t * /* region */, - size_t /* buffer_row_pitch */, - size_t /* buffer_slice_pitch */, - size_t /* host_row_pitch */, - size_t /* host_slice_pitch */, - void * /* ptr */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueWriteBuffer(cl_command_queue /* command_queue */, - cl_mem /* buffer */, - cl_bool /* blocking_write */, - size_t /* offset */, - size_t /* size */, - const void * /* ptr */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueWriteBufferRect(cl_command_queue /* command_queue */, - cl_mem /* buffer */, - cl_bool /* blocking_write */, - const size_t * /* buffer_offset */, - const size_t * /* host_offset */, - const size_t * /* region */, - size_t /* buffer_row_pitch */, - size_t /* buffer_slice_pitch */, - size_t /* host_row_pitch */, - size_t /* host_slice_pitch */, - const void * /* ptr */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueFillBuffer(cl_command_queue /* command_queue */, - cl_mem /* buffer */, - const void * /* pattern */, - size_t /* pattern_size */, - size_t /* offset */, - size_t /* size */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueCopyBuffer(cl_command_queue /* command_queue */, - cl_mem /* src_buffer */, - cl_mem /* dst_buffer */, - size_t /* src_offset */, - size_t /* dst_offset */, - size_t /* size */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueCopyBufferRect(cl_command_queue /* command_queue */, - cl_mem /* src_buffer */, - cl_mem /* dst_buffer */, - const size_t * /* src_origin */, - const size_t * /* dst_origin */, - const size_t * /* region */, - size_t /* src_row_pitch */, - size_t /* src_slice_pitch */, - size_t /* dst_row_pitch */, - size_t /* dst_slice_pitch */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueReadImage(cl_command_queue /* command_queue */, - cl_mem /* image */, - cl_bool /* blocking_read */, - const size_t * /* origin[3] */, - const size_t * /* region[3] */, - size_t /* row_pitch */, - size_t /* slice_pitch */, - void * /* ptr */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueWriteImage(cl_command_queue /* command_queue */, - cl_mem /* image */, - cl_bool /* blocking_write */, - const size_t * /* origin[3] */, - const size_t * /* region[3] */, - size_t /* input_row_pitch */, - size_t /* input_slice_pitch */, - const void * /* ptr */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueFillImage(cl_command_queue /* command_queue */, - cl_mem /* image */, - const void * /* fill_color */, - const size_t * /* origin[3] */, - const size_t * /* region[3] */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueCopyImage(cl_command_queue /* command_queue */, - cl_mem /* src_image */, - cl_mem /* dst_image */, - const size_t * /* src_origin[3] */, - const size_t * /* dst_origin[3] */, - const size_t * /* region[3] */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueCopyImageToBuffer(cl_command_queue /* command_queue */, - cl_mem /* src_image */, - cl_mem /* dst_buffer */, - const size_t * /* src_origin[3] */, - const size_t * /* region[3] */, - size_t /* dst_offset */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueCopyBufferToImage(cl_command_queue /* command_queue */, - cl_mem /* src_buffer */, - cl_mem /* dst_image */, - size_t /* src_offset */, - const size_t * /* dst_origin[3] */, - const size_t * /* region[3] */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY void * CL_API_CALL -clEnqueueMapBuffer(cl_command_queue /* command_queue */, - cl_mem /* buffer */, - cl_bool /* blocking_map */, - cl_map_flags /* map_flags */, - size_t /* offset */, - size_t /* size */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */, - cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY void * CL_API_CALL -clEnqueueMapImage(cl_command_queue /* command_queue */, - cl_mem /* image */, - cl_bool /* blocking_map */, - cl_map_flags /* map_flags */, - const size_t * /* origin[3] */, - const size_t * /* region[3] */, - size_t * /* image_row_pitch */, - size_t * /* image_slice_pitch */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */, - cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueUnmapMemObject(cl_command_queue /* command_queue */, - cl_mem /* memobj */, - void * /* mapped_ptr */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueMigrateMemObjects(cl_command_queue /* command_queue */, - cl_uint /* num_mem_objects */, - const cl_mem * /* mem_objects */, - cl_mem_migration_flags /* flags */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueNDRangeKernel(cl_command_queue /* command_queue */, - cl_kernel /* kernel */, - cl_uint /* work_dim */, - const size_t * /* global_work_offset */, - const size_t * /* global_work_size */, - const size_t * /* local_work_size */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueTask(cl_command_queue /* command_queue */, - cl_kernel /* kernel */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueNativeKernel(cl_command_queue /* command_queue */, - void (CL_CALLBACK * /*user_func*/)(void *), - void * /* args */, - size_t /* cb_args */, - cl_uint /* num_mem_objects */, - const cl_mem * /* mem_list */, - const void ** /* args_mem_loc */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueMarkerWithWaitList(cl_command_queue /* command_queue */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueBarrierWithWaitList(cl_command_queue /* command_queue */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2; - - -/* 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. - */ -extern CL_API_ENTRY void * CL_API_CALL -clGetExtensionFunctionAddressForPlatform(cl_platform_id /* platform */, - const char * /* func_name */) CL_API_SUFFIX__VERSION_1_2; - - -// Deprecated OpenCL 1.1 APIs -extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL -clCreateImage2D(cl_context /* context */, - cl_mem_flags /* flags */, - const cl_image_format * /* image_format */, - size_t /* image_width */, - size_t /* image_height */, - size_t /* image_row_pitch */, - void * /* host_ptr */, - cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; - -extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL -clCreateImage3D(cl_context /* context */, - cl_mem_flags /* flags */, - const cl_image_format * /* image_format */, - size_t /* image_width */, - size_t /* image_height */, - size_t /* image_depth */, - size_t /* image_row_pitch */, - size_t /* image_slice_pitch */, - void * /* host_ptr */, - cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; - -extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL -clEnqueueMarker(cl_command_queue /* command_queue */, - cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; - -extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL -clEnqueueWaitForEvents(cl_command_queue /* command_queue */, - cl_uint /* num_events */, - const cl_event * /* event_list */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; - -extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL -clEnqueueBarrier(cl_command_queue /* command_queue */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; - -extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL -clUnloadCompiler(void) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; - -extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED void * CL_API_CALL -clGetExtensionFunctionAddress(const char * /* func_name */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; - -#ifdef __cplusplus -} -#endif - -#endif /* __OPENCL_CL_H */ - diff --git a/Externals/CLRun/include/CL/cl_d3d10.h b/Externals/CLRun/include/CL/cl_d3d10.h deleted file mode 100644 index 81b0d37214..0000000000 --- a/Externals/CLRun/include/CL/cl_d3d10.h +++ /dev/null @@ -1,126 +0,0 @@ -/********************************************************************************** - * 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 - * "Materials"), to deal in the Materials without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Materials, and to - * permit persons to whom the Materials are furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Materials. - * - * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. - **********************************************************************************/ - -/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ - -#ifndef __OPENCL_CL_D3D10_H -#define __OPENCL_CL_D3D10_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/****************************************************************************** - * cl_khr_d3d10_sharing */ -#define cl_khr_d3d10_sharing 1 - -typedef cl_uint cl_d3d10_device_source_khr; -typedef cl_uint cl_d3d10_device_set_khr; - -/******************************************************************************/ - -// Error Codes -#define CL_INVALID_D3D10_DEVICE_KHR -1002 -#define CL_INVALID_D3D10_RESOURCE_KHR -1003 -#define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR -1004 -#define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR -1005 - -// cl_d3d10_device_source_nv -#define CL_D3D10_DEVICE_KHR 0x4010 -#define CL_D3D10_DXGI_ADAPTER_KHR 0x4011 - -// cl_d3d10_device_set_nv -#define CL_PREFERRED_DEVICES_FOR_D3D10_KHR 0x4012 -#define CL_ALL_DEVICES_FOR_D3D10_KHR 0x4013 - -// cl_context_info -#define CL_CONTEXT_D3D10_DEVICE_KHR 0x4014 -#define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C - -// cl_mem_info -#define CL_MEM_D3D10_RESOURCE_KHR 0x4015 - -// cl_image_info -#define CL_IMAGE_D3D10_SUBRESOURCE_KHR 0x4016 - -// cl_command_type -#define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR 0x4017 -#define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018 - -/******************************************************************************/ - -typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)( - cl_platform_id platform, - cl_d3d10_device_source_khr d3d_device_source, - void * d3d_object, - cl_d3d10_device_set_khr d3d_device_set, - cl_uint num_entries, - cl_device_id * devices, - cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0; - -typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)( - cl_context context, - cl_mem_flags flags, - ID3D10Buffer * resource, - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; - -typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)( - cl_context context, - cl_mem_flags flags, - ID3D10Texture2D * resource, - UINT subresource, - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; - -typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)( - cl_context context, - cl_mem_flags flags, - ID3D10Texture3D * resource, - UINT subresource, - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; - -typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)( - cl_command_queue command_queue, - cl_uint num_objects, - const cl_mem * mem_objects, - cl_uint num_events_in_wait_list, - const cl_event * event_wait_list, - cl_event * event) CL_API_SUFFIX__VERSION_1_0; - -typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)( - cl_command_queue command_queue, - cl_uint num_objects, - const cl_mem * mem_objects, - cl_uint num_events_in_wait_list, - const cl_event * event_wait_list, - cl_event * event) CL_API_SUFFIX__VERSION_1_0; - -#ifdef __cplusplus -} -#endif - -#endif // __OPENCL_CL_D3D10_H - diff --git a/Externals/CLRun/include/CL/cl_d3d11.h b/Externals/CLRun/include/CL/cl_d3d11.h deleted file mode 100644 index d3c8bdc2b1..0000000000 --- a/Externals/CLRun/include/CL/cl_d3d11.h +++ /dev/null @@ -1,126 +0,0 @@ -/********************************************************************************** - * 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 - * "Materials"), to deal in the Materials without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Materials, and to - * permit persons to whom the Materials are furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Materials. - * - * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. - **********************************************************************************/ - -/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ - -#ifndef __OPENCL_CL_D3D11_H -#define __OPENCL_CL_D3D11_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/****************************************************************************** - * cl_khr_d3d11_sharing */ -#define cl_khr_d3d11_sharing 1 - -typedef cl_uint cl_d3d11_device_source_khr; -typedef cl_uint cl_d3d11_device_set_khr; - -/******************************************************************************/ - -// Error Codes -#define CL_INVALID_D3D11_DEVICE_KHR -1006 -#define CL_INVALID_D3D11_RESOURCE_KHR -1007 -#define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR -1008 -#define CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR -1009 - -// cl_d3d11_device_source -#define CL_D3D11_DEVICE_KHR 0x4019 -#define CL_D3D11_DXGI_ADAPTER_KHR 0x401A - -// cl_d3d11_device_set -#define CL_PREFERRED_DEVICES_FOR_D3D11_KHR 0x401B -#define CL_ALL_DEVICES_FOR_D3D11_KHR 0x401C - -// cl_context_info -#define CL_CONTEXT_D3D11_DEVICE_KHR 0x401D -#define CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR 0x402D - -// cl_mem_info -#define CL_MEM_D3D11_RESOURCE_KHR 0x401E - -// cl_image_info -#define CL_IMAGE_D3D11_SUBRESOURCE_KHR 0x401F - -// cl_command_type -#define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR 0x4020 -#define CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR 0x4021 - -/******************************************************************************/ - -typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11KHR_fn)( - cl_platform_id platform, - cl_d3d11_device_source_khr d3d_device_source, - void * d3d_object, - cl_d3d11_device_set_khr d3d_device_set, - cl_uint num_entries, - cl_device_id * devices, - cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2; - -typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11BufferKHR_fn)( - cl_context context, - cl_mem_flags flags, - ID3D11Buffer * resource, - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; - -typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture2DKHR_fn)( - cl_context context, - cl_mem_flags flags, - ID3D11Texture2D * resource, - UINT subresource, - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; - -typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture3DKHR_fn)( - cl_context context, - cl_mem_flags flags, - ID3D11Texture3D * resource, - UINT subresource, - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; - -typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsKHR_fn)( - cl_command_queue command_queue, - cl_uint num_objects, - const cl_mem * mem_objects, - cl_uint num_events_in_wait_list, - const cl_event * event_wait_list, - cl_event * event) CL_API_SUFFIX__VERSION_1_2; - -typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D11ObjectsKHR_fn)( - cl_command_queue command_queue, - cl_uint num_objects, - const cl_mem * mem_objects, - cl_uint num_events_in_wait_list, - const cl_event * event_wait_list, - cl_event * event) CL_API_SUFFIX__VERSION_1_2; - -#ifdef __cplusplus -} -#endif - -#endif // __OPENCL_CL_D3D11_H - diff --git a/Externals/CLRun/include/CL/cl_dx9_media_sharing.h b/Externals/CLRun/include/CL/cl_dx9_media_sharing.h deleted file mode 100644 index 1ef543a5af..0000000000 --- a/Externals/CLRun/include/CL/cl_dx9_media_sharing.h +++ /dev/null @@ -1,127 +0,0 @@ -/********************************************************************************** - * 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 - * "Materials"), to deal in the Materials without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Materials, and to - * permit persons to whom the Materials are furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Materials. - * - * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. - **********************************************************************************/ - -/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ - -#ifndef __OPENCL_CL_DX9_MEDIA_SHARING_H -#define __OPENCL_CL_DX9_MEDIA_SHARING_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/****************************************************************************** -/* cl_khr_dx9_media_sharing */ -#define cl_khr_dx9_media_sharing 1 - -typedef cl_uint cl_dx9_media_adapter_type_khr; -typedef cl_uint cl_dx9_media_adapter_set_khr; - -#if defined(_WIN32) -#include -typedef struct _cl_dx9_surface_info_khr -{ - IDirect3DSurface9 *resource; - HANDLE shared_handle; -} cl_dx9_surface_info_khr; -#endif - - -/******************************************************************************/ - -// Error Codes -#define CL_INVALID_DX9_MEDIA_ADAPTER_KHR -1010 -#define CL_INVALID_DX9_MEDIA_SURFACE_KHR -1011 -#define CL_DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR -1012 -#define CL_DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR -1013 - -// cl_media_adapter_type_khr -#define CL_ADAPTER_D3D9_KHR 0x2020 -#define CL_ADAPTER_D3D9EX_KHR 0x2021 -#define CL_ADAPTER_DXVA_KHR 0x2022 - -// cl_media_adapter_set_khr -#define CL_PREFERRED_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2023 -#define CL_ALL_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2024 - -// cl_context_info -#define CL_CONTEXT_ADAPTER_D3D9_KHR 0x2025 -#define CL_CONTEXT_ADAPTER_D3D9EX_KHR 0x2026 -#define CL_CONTEXT_ADAPTER_DXVA_KHR 0x2027 - -// cl_mem_info -#define CL_MEM_DX9_MEDIA_ADAPTER_TYPE_KHR 0x2028 -#define CL_MEM_DX9_MEDIA_SURFACE_INFO_KHR 0x2029 - -// cl_image_info -#define CL_IMAGE_DX9_MEDIA_PLANE_KHR 0x202A - -// cl_command_type -#define CL_COMMAND_ACQUIRE_DX9_MEDIA_SURFACES_KHR 0x202B -#define CL_COMMAND_RELEASE_DX9_MEDIA_SURFACES_KHR 0x202C - -/******************************************************************************/ - -typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromDX9MediaAdapterKHR_fn)( - cl_platform_id platform, - cl_uint num_media_adapters, - cl_dx9_media_adapter_type_khr * media_adapter_type, - void * media_adapters, - cl_dx9_media_adapter_set_khr media_adapter_set, - cl_uint num_entries, - cl_device_id * devices, - cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2; - -typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceKHR_fn)( - cl_context context, - cl_mem_flags flags, - cl_dx9_media_adapter_type_khr adapter_type, - void * surface_info, - cl_uint plane, - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; - -typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireDX9MediaSurfacesKHR_fn)( - cl_command_queue command_queue, - cl_uint num_objects, - const cl_mem * mem_objects, - cl_uint num_events_in_wait_list, - const cl_event * event_wait_list, - cl_event * event) CL_API_SUFFIX__VERSION_1_2; - -typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseDX9MediaSurfacesKHR_fn)( - cl_command_queue command_queue, - cl_uint num_objects, - const cl_mem * mem_objects, - cl_uint num_events_in_wait_list, - const cl_event * event_wait_list, - cl_event * event) CL_API_SUFFIX__VERSION_1_2; - -#ifdef __cplusplus -} -#endif - -#endif // __OPENCL_CL_DX9_MEDIA_SHARING_H - diff --git a/Externals/CLRun/include/CL/cl_ext.h b/Externals/CLRun/include/CL/cl_ext.h deleted file mode 100644 index 632cb216b3..0000000000 --- a/Externals/CLRun/include/CL/cl_ext.h +++ /dev/null @@ -1,251 +0,0 @@ -/******************************************************************************* - * 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 - * "Materials"), to deal in the Materials without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Materials, and to - * permit persons to whom the Materials are furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Materials. - * - * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. - ******************************************************************************/ - -/* $Revision: 11928 $ on $Date: 2010-07-13 09:04:56 -0700 (Tue, 13 Jul 2010) $ */ - -/* cl_ext.h contains OpenCL extensions which don't have external */ -/* (OpenGL, D3D) dependencies. */ - -#ifndef __CL_EXT_H -#define __CL_EXT_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __APPLE__ - #include - #include -#else - #include -#endif - -/* cl_khr_fp16 extension - no extension #define since it has no functions */ -#define CL_DEVICE_HALF_FP_CONFIG 0x1033 - -/* Memory object destruction - * - * Apple extension for use to manage externally allocated buffers used with cl_mem objects with CL_MEM_USE_HOST_PTR - * - * Registers a user callback function that will be called when the memory object is deleted and its resources - * freed. Each call to clSetMemObjectCallbackFn registers the specified user callback function on a callback - * stack associated with memobj. The registered user callback functions are called in the reverse order in - * which they were registered. The user callback functions are called and then the memory object is deleted - * and its resources freed. This provides a mechanism for the application (and libraries) using memobj to be - * notified when the memory referenced by host_ptr, specified when the memory object is created and used as - * the storage bits for the memory object, can be reused or freed. - * - * The application may not call CL api's with the cl_mem object passed to the pfn_notify. - * - * Please check for the "cl_APPLE_SetMemObjectDestructor" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS) - * before using. - */ -#define cl_APPLE_SetMemObjectDestructor 1 -cl_int CL_API_ENTRY clSetMemObjectDestructorAPPLE( cl_mem /* memobj */, - void (* /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/), - void * /*user_data */ ) CL_EXT_SUFFIX__VERSION_1_0; - - -/* Context Logging Functions - * - * The next three convenience functions are intended to be used as the pfn_notify parameter to clCreateContext(). - * Please check for the "cl_APPLE_ContextLoggingFunctions" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS) - * before using. - * - * clLogMessagesToSystemLog fowards on all log messages to the Apple System Logger - */ -#define cl_APPLE_ContextLoggingFunctions 1 -extern void CL_API_ENTRY clLogMessagesToSystemLogAPPLE( const char * /* errstr */, - const void * /* private_info */, - size_t /* cb */, - void * /* user_data */ ) CL_EXT_SUFFIX__VERSION_1_0; - -/* clLogMessagesToStdout sends all log messages to the file descriptor stdout */ -extern void CL_API_ENTRY clLogMessagesToStdoutAPPLE( const char * /* errstr */, - const void * /* private_info */, - size_t /* cb */, - void * /* user_data */ ) CL_EXT_SUFFIX__VERSION_1_0; - -/* clLogMessagesToStderr sends all log messages to the file descriptor stderr */ -extern void CL_API_ENTRY clLogMessagesToStderrAPPLE( const char * /* errstr */, - const void * /* private_info */, - size_t /* cb */, - void * /* user_data */ ) CL_EXT_SUFFIX__VERSION_1_0; - - -/************************ -* cl_khr_icd extension * -************************/ -#define cl_khr_icd 1 - -/* cl_platform_info */ -#define CL_PLATFORM_ICD_SUFFIX_KHR 0x0920 - -/* Additional Error Codes */ -#define CL_PLATFORM_NOT_FOUND_KHR -1001 - -extern CL_API_ENTRY cl_int CL_API_CALL -clIcdGetPlatformIDsKHR(cl_uint /* num_entries */, - cl_platform_id * /* platforms */, - cl_uint * /* num_platforms */); - -typedef CL_API_ENTRY cl_int (CL_API_CALL *clIcdGetPlatformIDsKHR_fn)( - cl_uint /* num_entries */, - cl_platform_id * /* platforms */, - cl_uint * /* num_platforms */); - - -/* Extension: cl_khr_image2D_buffer - * - * This extension allows a 2D image to be created from a cl_mem buffer without a copy. - * The type associated with a 2D image created from a buffer in an OpenCL program is image2d_t. - * Both the sampler and sampler-less read_image built-in functions are supported for 2D images - * and 2D images created from a buffer. Similarly, the write_image built-ins are also supported - * for 2D images created from a buffer. - * - * When the 2D image from buffer is created, the client must specify the width, - * height, image format (i.e. channel order and channel data type) and optionally the row pitch - * - * The pitch specified must be a multiple of CL_DEVICE_IMAGE_PITCH_ALIGNMENT pixels. - * The base address of the buffer must be aligned to CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT pixels. - */ - -/************************************* - * cl_khr_initalize_memory extension * - *************************************/ - -#define CL_CONTEXT_MEMORY_INITIALIZE_KHR 0x200E - - -/************************************** - * cl_khr_terminate_context extension * - **************************************/ - -#define CL_DEVICE_TERMINATE_CAPABILITY_KHR 0x200F -#define CL_CONTEXT_TERMINATE_KHR 0x2010 - -#define cl_khr_terminate_context 1 -extern CL_API_ENTRY cl_int CL_API_CALL clTerminateContextKHR(cl_context /* context */) CL_EXT_SUFFIX__VERSION_1_2; - -typedef CL_API_ENTRY cl_int (CL_API_CALL *clTerminateContextKHR_fn)(cl_context /* context */) CL_EXT_SUFFIX__VERSION_1_2; - - -/* - * Extension: cl_khr_spir - * - * This extension adds support to create an OpenCL program object from a - * Standard Portable Intermediate Representation (SPIR) instance - */ - -/****************************************** -* cl_nv_device_attribute_query extension * -******************************************/ -/* cl_nv_device_attribute_query extension - no extension #define since it has no functions */ -#define CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV 0x4000 -#define CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV 0x4001 -#define CL_DEVICE_REGISTERS_PER_BLOCK_NV 0x4002 -#define CL_DEVICE_WARP_SIZE_NV 0x4003 -#define CL_DEVICE_GPU_OVERLAP_NV 0x4004 -#define CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV 0x4005 -#define CL_DEVICE_INTEGRATED_MEMORY_NV 0x4006 - - -/********************************* -* cl_amd_device_attribute_query * -*********************************/ -#define CL_DEVICE_PROFILING_TIMER_OFFSET_AMD 0x4036 - -#ifdef CL_VERSION_1_1 - /*********************************** - * cl_ext_device_fission extension * - ***********************************/ - #define cl_ext_device_fission 1 - - extern CL_API_ENTRY cl_int CL_API_CALL - clReleaseDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1; - - typedef CL_API_ENTRY cl_int - (CL_API_CALL *clReleaseDeviceEXT_fn)( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1; - - extern CL_API_ENTRY cl_int CL_API_CALL - clRetainDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1; - - typedef CL_API_ENTRY cl_int - (CL_API_CALL *clRetainDeviceEXT_fn)( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1; - - typedef cl_ulong cl_device_partition_property_ext; - extern CL_API_ENTRY cl_int CL_API_CALL - clCreateSubDevicesEXT( cl_device_id /*in_device*/, - const cl_device_partition_property_ext * /* properties */, - cl_uint /*num_entries*/, - cl_device_id * /*out_devices*/, - cl_uint * /*num_devices*/ ) CL_EXT_SUFFIX__VERSION_1_1; - - typedef CL_API_ENTRY cl_int - ( CL_API_CALL * clCreateSubDevicesEXT_fn)( cl_device_id /*in_device*/, - const cl_device_partition_property_ext * /* properties */, - cl_uint /*num_entries*/, - cl_device_id * /*out_devices*/, - cl_uint * /*num_devices*/ ) CL_EXT_SUFFIX__VERSION_1_1; - - /* cl_device_partition_property_ext */ - #define CL_DEVICE_PARTITION_EQUALLY_EXT 0x4050 - #define CL_DEVICE_PARTITION_BY_COUNTS_EXT 0x4051 - #define CL_DEVICE_PARTITION_BY_NAMES_EXT 0x4052 - #define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN_EXT 0x4053 - - /* clDeviceGetInfo selectors */ - #define CL_DEVICE_PARENT_DEVICE_EXT 0x4054 - #define CL_DEVICE_PARTITION_TYPES_EXT 0x4055 - #define CL_DEVICE_AFFINITY_DOMAINS_EXT 0x4056 - #define CL_DEVICE_REFERENCE_COUNT_EXT 0x4057 - #define CL_DEVICE_PARTITION_STYLE_EXT 0x4058 - - /* error codes */ - #define CL_DEVICE_PARTITION_FAILED_EXT -1057 - #define CL_INVALID_PARTITION_COUNT_EXT -1058 - #define CL_INVALID_PARTITION_NAME_EXT -1059 - - /* CL_AFFINITY_DOMAINs */ - #define CL_AFFINITY_DOMAIN_L1_CACHE_EXT 0x1 - #define CL_AFFINITY_DOMAIN_L2_CACHE_EXT 0x2 - #define CL_AFFINITY_DOMAIN_L3_CACHE_EXT 0x3 - #define CL_AFFINITY_DOMAIN_L4_CACHE_EXT 0x4 - #define CL_AFFINITY_DOMAIN_NUMA_EXT 0x10 - #define CL_AFFINITY_DOMAIN_NEXT_FISSIONABLE_EXT 0x100 - - /* cl_device_partition_property_ext list terminators */ - #define CL_PROPERTIES_LIST_END_EXT ((cl_device_partition_property_ext) 0) - #define CL_PARTITION_BY_COUNTS_LIST_END_EXT ((cl_device_partition_property_ext) 0) - #define CL_PARTITION_BY_NAMES_LIST_END_EXT ((cl_device_partition_property_ext) 0 - 1) - - - -#endif /* CL_VERSION_1_1 */ - -#ifdef __cplusplus -} -#endif - - -#endif /* __CL_EXT_H */ diff --git a/Externals/CLRun/include/CL/cl_gl.h b/Externals/CLRun/include/CL/cl_gl.h deleted file mode 100644 index af2036cc99..0000000000 --- a/Externals/CLRun/include/CL/cl_gl.h +++ /dev/null @@ -1,162 +0,0 @@ -/********************************************************************************** - * 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 - * "Materials"), to deal in the Materials without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Materials, and to - * permit persons to whom the Materials are furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Materials. - * - * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. - **********************************************************************************/ - -#ifndef __OPENCL_CL_GL_H -#define __OPENCL_CL_GL_H - -#ifdef __APPLE__ -#include -#else -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef cl_uint cl_gl_object_type; -typedef cl_uint cl_gl_texture_info; -typedef cl_uint cl_gl_platform_info; -typedef struct __GLsync *cl_GLsync; - -/* cl_gl_object_type = 0x2000 - 0x200F enum values are currently taken */ -#define CL_GL_OBJECT_BUFFER 0x2000 -#define CL_GL_OBJECT_TEXTURE2D 0x2001 -#define CL_GL_OBJECT_TEXTURE3D 0x2002 -#define CL_GL_OBJECT_RENDERBUFFER 0x2003 -#define CL_GL_OBJECT_TEXTURE2D_ARRAY 0x200E -#define CL_GL_OBJECT_TEXTURE1D 0x200F -#define CL_GL_OBJECT_TEXTURE1D_ARRAY 0x2010 -#define CL_GL_OBJECT_TEXTURE_BUFFER 0x2011 - -/* cl_gl_texture_info */ -#define CL_GL_TEXTURE_TARGET 0x2004 -#define CL_GL_MIPMAP_LEVEL 0x2005 -#define CL_GL_NUM_SAMPLES 0x2012 - - -extern CL_API_ENTRY cl_mem CL_API_CALL -clCreateFromGLBuffer(cl_context /* context */, - cl_mem_flags /* flags */, - cl_GLuint /* bufobj */, - int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_mem CL_API_CALL -clCreateFromGLTexture(cl_context /* context */, - cl_mem_flags /* flags */, - cl_GLenum /* target */, - cl_GLint /* miplevel */, - cl_GLuint /* texture */, - cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2; - -extern CL_API_ENTRY cl_mem CL_API_CALL -clCreateFromGLRenderbuffer(cl_context /* context */, - cl_mem_flags /* flags */, - cl_GLuint /* renderbuffer */, - cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clGetGLObjectInfo(cl_mem /* memobj */, - cl_gl_object_type * /* gl_object_type */, - cl_GLuint * /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clGetGLTextureInfo(cl_mem /* memobj */, - cl_gl_texture_info /* param_name */, - size_t /* param_value_size */, - void * /* param_value */, - size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueAcquireGLObjects(cl_command_queue /* command_queue */, - cl_uint /* num_objects */, - const cl_mem * /* mem_objects */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueReleaseGLObjects(cl_command_queue /* command_queue */, - cl_uint /* num_objects */, - const cl_mem * /* mem_objects */, - cl_uint /* num_events_in_wait_list */, - const cl_event * /* event_wait_list */, - cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; - - -// Deprecated OpenCL 1.1 APIs -extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL -clCreateFromGLTexture2D(cl_context /* context */, - cl_mem_flags /* flags */, - cl_GLenum /* target */, - cl_GLint /* miplevel */, - cl_GLuint /* texture */, - cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; - -extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL -clCreateFromGLTexture3D(cl_context /* context */, - cl_mem_flags /* flags */, - cl_GLenum /* target */, - cl_GLint /* miplevel */, - cl_GLuint /* texture */, - cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; - -/* cl_khr_gl_sharing extension */ - -#define cl_khr_gl_sharing 1 - -typedef cl_uint cl_gl_context_info; - -/* Additional Error Codes */ -#define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000 - -/* cl_gl_context_info */ -#define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006 -#define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007 - -/* Additional cl_context_properties */ -#define CL_GL_CONTEXT_KHR 0x2008 -#define CL_EGL_DISPLAY_KHR 0x2009 -#define CL_GLX_DISPLAY_KHR 0x200A -#define CL_WGL_HDC_KHR 0x200B -#define CL_CGL_SHAREGROUP_KHR 0x200C - -extern CL_API_ENTRY cl_int CL_API_CALL -clGetGLContextInfoKHR(const cl_context_properties * /* properties */, - cl_gl_context_info /* param_name */, - size_t /* param_value_size */, - void * /* param_value */, - size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; - -typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)( - const cl_context_properties * properties, - cl_gl_context_info param_name, - size_t param_value_size, - void * param_value, - size_t * param_value_size_ret); - -#ifdef __cplusplus -} -#endif - -#endif /* __OPENCL_CL_GL_H */ diff --git a/Externals/CLRun/include/CL/cl_gl_ext.h b/Externals/CLRun/include/CL/cl_gl_ext.h deleted file mode 100644 index 77d53536f6..0000000000 --- a/Externals/CLRun/include/CL/cl_gl_ext.h +++ /dev/null @@ -1,69 +0,0 @@ -/********************************************************************************** - * 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 - * "Materials"), to deal in the Materials without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Materials, and to - * permit persons to whom the Materials are furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Materials. - * - * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. - **********************************************************************************/ - -/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ - -/* cl_gl_ext.h contains vendor (non-KHR) OpenCL extensions which have */ -/* OpenGL dependencies. */ - -#ifndef __OPENCL_CL_GL_EXT_H -#define __OPENCL_CL_GL_EXT_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __APPLE__ - #include -#else - #include -#endif - -/* - * For each extension, follow this template - * cl_VEN_extname extension */ -/* #define cl_VEN_extname 1 - * ... define new types, if any - * ... define new tokens, if any - * ... define new APIs, if any - * - * If you need GLtypes here, mirror them with a cl_GLtype, rather than including a GL header - * This allows us to avoid having to decide whether to include GL headers or GLES here. - */ - -/* - * cl_khr_gl_event extension - * See section 9.9 in the OpenCL 1.1 spec for more information - */ -#define CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR 0x200D - -extern CL_API_ENTRY cl_event CL_API_CALL -clCreateEventFromGLsyncKHR(cl_context /* context */, - cl_GLsync /* cl_GLsync */, - cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1; - -#ifdef __cplusplus -} -#endif - -#endif /* __OPENCL_CL_GL_EXT_H */ diff --git a/Externals/CLRun/include/CL/cl_platform.h b/Externals/CLRun/include/CL/cl_platform.h deleted file mode 100644 index cf2b7210ac..0000000000 --- a/Externals/CLRun/include/CL/cl_platform.h +++ /dev/null @@ -1,1254 +0,0 @@ -/********************************************************************************** - * 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 - * "Materials"), to deal in the Materials without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Materials, and to - * permit persons to whom the Materials are furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Materials. - * - * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. - **********************************************************************************/ - -/* $Revision: 11803 $ on $Date: 2010-06-25 10:02:12 -0700 (Fri, 25 Jun 2010) $ */ - -#ifndef __CL_PLATFORM_H -#define __CL_PLATFORM_H - -#ifdef __APPLE__ - /* Contains #defines for AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER below */ - #include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(_WIN32) - #define CL_API_ENTRY - #define CL_API_CALL __stdcall - #define CL_CALLBACK __stdcall -#else - #define CL_API_ENTRY - #define CL_API_CALL - #define CL_CALLBACK -#endif - -#ifdef __APPLE__ - #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_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)) - -/* 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; - -/* 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 340282346638528859811704183484516925440.0f -#define CL_FLT_MIN 1.175494350822287507969e-38f -#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 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0 -#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 - -#else - -#include - -/* scalar types */ -typedef int8_t cl_char; -typedef uint8_t cl_uchar; -typedef int16_t cl_short __attribute__((aligned(2))); -typedef uint16_t cl_ushort __attribute__((aligned(2))); -typedef int32_t cl_int __attribute__((aligned(4))); -typedef uint32_t cl_uint __attribute__((aligned(4))); -typedef int64_t cl_long __attribute__((aligned(8))); -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))); - -/* 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 - -#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() - #define CL_NAN __builtin_nanf( "" ) -#else - #define CL_HUGE_VALF ((cl_float) 1e50) - #define CL_HUGE_VAL ((cl_double) 1e500) - float nanf( const char * ); - #define CL_NAN nanf( "" ) -#endif -#define CL_MAXFLOAT CL_FLT_MAX -#define CL_INFINITY CL_HUGE_VALF - -#endif - -#include - -/* 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; - -/* - * 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. - */ - -/* Define basic vector types */ -#if defined( __VEC__ ) - #include /* may be omitted depending on compiler. AltiVec spec provides no way to detect whether the header is required. */ - typedef vector unsigned char __cl_uchar16; - typedef vector signed char __cl_char16; - typedef vector unsigned short __cl_ushort8; - typedef vector signed short __cl_short8; - typedef vector unsigned int __cl_uint4; - typedef vector signed int __cl_int4; - typedef vector float __cl_float4; - #define __CL_UCHAR16__ 1 - #define __CL_CHAR16__ 1 - #define __CL_USHORT8__ 1 - #define __CL_SHORT8__ 1 - #define __CL_UINT4__ 1 - #define __CL_INT4__ 1 - #define __CL_FLOAT4__ 1 -#endif - -#if defined( __SSE__ ) - #if defined( __MINGW64__ ) - #include - #else - #include - #endif - #if defined( __GNUC__ ) - typedef float __cl_float4 __attribute__((vector_size(16))); - #else - typedef __m128 __cl_float4; - #endif - #define __CL_FLOAT4__ 1 -#endif - -#if defined( __SSE2__ ) - #if defined( __MINGW64__ ) - #include - #else - #include - #endif - #if defined( __GNUC__ ) - typedef cl_uchar __cl_uchar16 __attribute__((vector_size(16))); - typedef cl_char __cl_char16 __attribute__((vector_size(16))); - typedef cl_ushort __cl_ushort8 __attribute__((vector_size(16))); - typedef cl_short __cl_short8 __attribute__((vector_size(16))); - typedef cl_uint __cl_uint4 __attribute__((vector_size(16))); - typedef cl_int __cl_int4 __attribute__((vector_size(16))); - typedef cl_ulong __cl_ulong2 __attribute__((vector_size(16))); - typedef cl_long __cl_long2 __attribute__((vector_size(16))); - typedef cl_double __cl_double2 __attribute__((vector_size(16))); - #else - typedef __m128i __cl_uchar16; - typedef __m128i __cl_char16; - typedef __m128i __cl_ushort8; - typedef __m128i __cl_short8; - typedef __m128i __cl_uint4; - typedef __m128i __cl_int4; - typedef __m128i __cl_ulong2; - typedef __m128i __cl_long2; - typedef __m128d __cl_double2; - #endif - #define __CL_UCHAR16__ 1 - #define __CL_CHAR16__ 1 - #define __CL_USHORT8__ 1 - #define __CL_SHORT8__ 1 - #define __CL_INT4__ 1 - #define __CL_UINT4__ 1 - #define __CL_ULONG2__ 1 - #define __CL_LONG2__ 1 - #define __CL_DOUBLE2__ 1 -#endif - -#if defined( __MMX__ ) - #include - #if defined( __GNUC__ ) - typedef cl_uchar __cl_uchar8 __attribute__((vector_size(8))); - typedef cl_char __cl_char8 __attribute__((vector_size(8))); - typedef cl_ushort __cl_ushort4 __attribute__((vector_size(8))); - typedef cl_short __cl_short4 __attribute__((vector_size(8))); - typedef cl_uint __cl_uint2 __attribute__((vector_size(8))); - typedef cl_int __cl_int2 __attribute__((vector_size(8))); - typedef cl_ulong __cl_ulong1 __attribute__((vector_size(8))); - typedef cl_long __cl_long1 __attribute__((vector_size(8))); - typedef cl_float __cl_float2 __attribute__((vector_size(8))); - #else - typedef __m64 __cl_uchar8; - typedef __m64 __cl_char8; - typedef __m64 __cl_ushort4; - typedef __m64 __cl_short4; - typedef __m64 __cl_uint2; - typedef __m64 __cl_int2; - typedef __m64 __cl_ulong1; - typedef __m64 __cl_long1; - typedef __m64 __cl_float2; - #endif - #define __CL_UCHAR8__ 1 - #define __CL_CHAR8__ 1 - #define __CL_USHORT4__ 1 - #define __CL_SHORT4__ 1 - #define __CL_INT2__ 1 - #define __CL_UINT2__ 1 - #define __CL_ULONG1__ 1 - #define __CL_LONG1__ 1 - #define __CL_FLOAT2__ 1 -#endif - -#if defined( __AVX__ ) - #if defined( __MINGW64__ ) - #include - #else - #include - #endif - #if defined( __GNUC__ ) - typedef cl_float __cl_float8 __attribute__((vector_size(32))); - typedef cl_double __cl_double4 __attribute__((vector_size(32))); - #else - typedef __m256 __cl_float8; - typedef __m256d __cl_double4; - #endif - #define __CL_FLOAT8__ 1 - #define __CL_DOUBLE4__ 1 -#endif - -/* Define alignment keys */ -#if defined( __GNUC__ ) - #define CL_ALIGNED(_x) __attribute__ ((aligned(_x))) -#elif defined( _WIN32) && (_MSC_VER) - /* Alignment keys neutered on windows because MSVC can't swallow function arguments with alignment requirements */ - /* http://msdn.microsoft.com/en-us/library/373ak2y1%28VS.71%29.aspx */ - /* #include */ - /* #define CL_ALIGNED(_x) _CRT_ALIGN(_x) */ - #define CL_ALIGNED(_x) -#else - #warning Need to implement some method to align data here - #define CL_ALIGNED(_x) -#endif - -/* Indicate whether .xyzw, .s0123 and .hi.lo are supported */ -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - /* .xyzw and .s0123...{f|F} are supported */ - #define CL_HAS_NAMED_VECTOR_FIELDS 1 - /* .hi and .lo are supported */ - #define CL_HAS_HI_LO_VECTOR_FIELDS 1 -#endif - -/* Define cl_vector types */ - -/* ---- cl_charn ---- */ -typedef union -{ - cl_char CL_ALIGNED(2) s[2]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_char x, y; }; - __extension__ struct{ cl_char s0, s1; }; - __extension__ struct{ cl_char lo, hi; }; -#endif -#if defined( __CL_CHAR2__) - __cl_char2 v2; -#endif -}cl_char2; - -typedef union -{ - cl_char CL_ALIGNED(4) s[4]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_char x, y, z, w; }; - __extension__ struct{ cl_char s0, s1, s2, s3; }; - __extension__ struct{ cl_char2 lo, hi; }; -#endif -#if defined( __CL_CHAR2__) - __cl_char2 v2[2]; -#endif -#if defined( __CL_CHAR4__) - __cl_char4 v4; -#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]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_char x, y, z, w; }; - __extension__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7; }; - __extension__ struct{ cl_char4 lo, hi; }; -#endif -#if defined( __CL_CHAR2__) - __cl_char2 v2[4]; -#endif -#if defined( __CL_CHAR4__) - __cl_char4 v4[2]; -#endif -#if defined( __CL_CHAR8__ ) - __cl_char8 v8; -#endif -}cl_char8; - -typedef union -{ - cl_char CL_ALIGNED(16) s[16]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_char x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; - __extension__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; - __extension__ struct{ cl_char8 lo, hi; }; -#endif -#if defined( __CL_CHAR2__) - __cl_char2 v2[8]; -#endif -#if defined( __CL_CHAR4__) - __cl_char4 v4[4]; -#endif -#if defined( __CL_CHAR8__ ) - __cl_char8 v8[2]; -#endif -#if defined( __CL_CHAR16__ ) - __cl_char16 v16; -#endif -}cl_char16; - - -/* ---- cl_ucharn ---- */ -typedef union -{ - cl_uchar CL_ALIGNED(2) s[2]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_uchar x, y; }; - __extension__ struct{ cl_uchar s0, s1; }; - __extension__ struct{ cl_uchar lo, hi; }; -#endif -#if defined( __cl_uchar2__) - __cl_uchar2 v2; -#endif -}cl_uchar2; - -typedef union -{ - cl_uchar CL_ALIGNED(4) s[4]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_uchar x, y, z, w; }; - __extension__ struct{ cl_uchar s0, s1, s2, s3; }; - __extension__ struct{ cl_uchar2 lo, hi; }; -#endif -#if defined( __CL_UCHAR2__) - __cl_uchar2 v2[2]; -#endif -#if defined( __CL_UCHAR4__) - __cl_uchar4 v4; -#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]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_uchar x, y, z, w; }; - __extension__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7; }; - __extension__ struct{ cl_uchar4 lo, hi; }; -#endif -#if defined( __CL_UCHAR2__) - __cl_uchar2 v2[4]; -#endif -#if defined( __CL_UCHAR4__) - __cl_uchar4 v4[2]; -#endif -#if defined( __CL_UCHAR8__ ) - __cl_uchar8 v8; -#endif -}cl_uchar8; - -typedef union -{ - cl_uchar CL_ALIGNED(16) s[16]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_uchar x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; - __extension__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; - __extension__ struct{ cl_uchar8 lo, hi; }; -#endif -#if defined( __CL_UCHAR2__) - __cl_uchar2 v2[8]; -#endif -#if defined( __CL_UCHAR4__) - __cl_uchar4 v4[4]; -#endif -#if defined( __CL_UCHAR8__ ) - __cl_uchar8 v8[2]; -#endif -#if defined( __CL_UCHAR16__ ) - __cl_uchar16 v16; -#endif -}cl_uchar16; - - -/* ---- cl_shortn ---- */ -typedef union -{ - cl_short CL_ALIGNED(4) s[2]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_short x, y; }; - __extension__ struct{ cl_short s0, s1; }; - __extension__ struct{ cl_short lo, hi; }; -#endif -#if defined( __CL_SHORT2__) - __cl_short2 v2; -#endif -}cl_short2; - -typedef union -{ - cl_short CL_ALIGNED(8) s[4]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_short x, y, z, w; }; - __extension__ struct{ cl_short s0, s1, s2, s3; }; - __extension__ struct{ cl_short2 lo, hi; }; -#endif -#if defined( __CL_SHORT2__) - __cl_short2 v2[2]; -#endif -#if defined( __CL_SHORT4__) - __cl_short4 v4; -#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]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_short x, y, z, w; }; - __extension__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7; }; - __extension__ struct{ cl_short4 lo, hi; }; -#endif -#if defined( __CL_SHORT2__) - __cl_short2 v2[4]; -#endif -#if defined( __CL_SHORT4__) - __cl_short4 v4[2]; -#endif -#if defined( __CL_SHORT8__ ) - __cl_short8 v8; -#endif -}cl_short8; - -typedef union -{ - cl_short CL_ALIGNED(32) s[16]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_short x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; - __extension__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; - __extension__ struct{ cl_short8 lo, hi; }; -#endif -#if defined( __CL_SHORT2__) - __cl_short2 v2[8]; -#endif -#if defined( __CL_SHORT4__) - __cl_short4 v4[4]; -#endif -#if defined( __CL_SHORT8__ ) - __cl_short8 v8[2]; -#endif -#if defined( __CL_SHORT16__ ) - __cl_short16 v16; -#endif -}cl_short16; - - -/* ---- cl_ushortn ---- */ -typedef union -{ - cl_ushort CL_ALIGNED(4) s[2]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_ushort x, y; }; - __extension__ struct{ cl_ushort s0, s1; }; - __extension__ struct{ cl_ushort lo, hi; }; -#endif -#if defined( __CL_USHORT2__) - __cl_ushort2 v2; -#endif -}cl_ushort2; - -typedef union -{ - cl_ushort CL_ALIGNED(8) s[4]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_ushort x, y, z, w; }; - __extension__ struct{ cl_ushort s0, s1, s2, s3; }; - __extension__ struct{ cl_ushort2 lo, hi; }; -#endif -#if defined( __CL_USHORT2__) - __cl_ushort2 v2[2]; -#endif -#if defined( __CL_USHORT4__) - __cl_ushort4 v4; -#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]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_ushort x, y, z, w; }; - __extension__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7; }; - __extension__ struct{ cl_ushort4 lo, hi; }; -#endif -#if defined( __CL_USHORT2__) - __cl_ushort2 v2[4]; -#endif -#if defined( __CL_USHORT4__) - __cl_ushort4 v4[2]; -#endif -#if defined( __CL_USHORT8__ ) - __cl_ushort8 v8; -#endif -}cl_ushort8; - -typedef union -{ - cl_ushort CL_ALIGNED(32) s[16]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_ushort x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; - __extension__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; - __extension__ struct{ cl_ushort8 lo, hi; }; -#endif -#if defined( __CL_USHORT2__) - __cl_ushort2 v2[8]; -#endif -#if defined( __CL_USHORT4__) - __cl_ushort4 v4[4]; -#endif -#if defined( __CL_USHORT8__ ) - __cl_ushort8 v8[2]; -#endif -#if defined( __CL_USHORT16__ ) - __cl_ushort16 v16; -#endif -}cl_ushort16; - -/* ---- cl_intn ---- */ -typedef union -{ - cl_int CL_ALIGNED(8) s[2]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_int x, y; }; - __extension__ struct{ cl_int s0, s1; }; - __extension__ struct{ cl_int lo, hi; }; -#endif -#if defined( __CL_INT2__) - __cl_int2 v2; -#endif -}cl_int2; - -typedef union -{ - cl_int CL_ALIGNED(16) s[4]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_int x, y, z, w; }; - __extension__ struct{ cl_int s0, s1, s2, s3; }; - __extension__ struct{ cl_int2 lo, hi; }; -#endif -#if defined( __CL_INT2__) - __cl_int2 v2[2]; -#endif -#if defined( __CL_INT4__) - __cl_int4 v4; -#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]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_int x, y, z, w; }; - __extension__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7; }; - __extension__ struct{ cl_int4 lo, hi; }; -#endif -#if defined( __CL_INT2__) - __cl_int2 v2[4]; -#endif -#if defined( __CL_INT4__) - __cl_int4 v4[2]; -#endif -#if defined( __CL_INT8__ ) - __cl_int8 v8; -#endif -}cl_int8; - -typedef union -{ - cl_int CL_ALIGNED(64) s[16]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_int x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; - __extension__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; - __extension__ struct{ cl_int8 lo, hi; }; -#endif -#if defined( __CL_INT2__) - __cl_int2 v2[8]; -#endif -#if defined( __CL_INT4__) - __cl_int4 v4[4]; -#endif -#if defined( __CL_INT8__ ) - __cl_int8 v8[2]; -#endif -#if defined( __CL_INT16__ ) - __cl_int16 v16; -#endif -}cl_int16; - - -/* ---- cl_uintn ---- */ -typedef union -{ - cl_uint CL_ALIGNED(8) s[2]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_uint x, y; }; - __extension__ struct{ cl_uint s0, s1; }; - __extension__ struct{ cl_uint lo, hi; }; -#endif -#if defined( __CL_UINT2__) - __cl_uint2 v2; -#endif -}cl_uint2; - -typedef union -{ - cl_uint CL_ALIGNED(16) s[4]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_uint x, y, z, w; }; - __extension__ struct{ cl_uint s0, s1, s2, s3; }; - __extension__ struct{ cl_uint2 lo, hi; }; -#endif -#if defined( __CL_UINT2__) - __cl_uint2 v2[2]; -#endif -#if defined( __CL_UINT4__) - __cl_uint4 v4; -#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]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_uint x, y, z, w; }; - __extension__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7; }; - __extension__ struct{ cl_uint4 lo, hi; }; -#endif -#if defined( __CL_UINT2__) - __cl_uint2 v2[4]; -#endif -#if defined( __CL_UINT4__) - __cl_uint4 v4[2]; -#endif -#if defined( __CL_UINT8__ ) - __cl_uint8 v8; -#endif -}cl_uint8; - -typedef union -{ - cl_uint CL_ALIGNED(64) s[16]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_uint x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; - __extension__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; - __extension__ struct{ cl_uint8 lo, hi; }; -#endif -#if defined( __CL_UINT2__) - __cl_uint2 v2[8]; -#endif -#if defined( __CL_UINT4__) - __cl_uint4 v4[4]; -#endif -#if defined( __CL_UINT8__ ) - __cl_uint8 v8[2]; -#endif -#if defined( __CL_UINT16__ ) - __cl_uint16 v16; -#endif -}cl_uint16; - -/* ---- cl_longn ---- */ -typedef union -{ - cl_long CL_ALIGNED(16) s[2]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_long x, y; }; - __extension__ struct{ cl_long s0, s1; }; - __extension__ struct{ cl_long lo, hi; }; -#endif -#if defined( __CL_LONG2__) - __cl_long2 v2; -#endif -}cl_long2; - -typedef union -{ - cl_long CL_ALIGNED(32) s[4]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_long x, y, z, w; }; - __extension__ struct{ cl_long s0, s1, s2, s3; }; - __extension__ struct{ cl_long2 lo, hi; }; -#endif -#if defined( __CL_LONG2__) - __cl_long2 v2[2]; -#endif -#if defined( __CL_LONG4__) - __cl_long4 v4; -#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]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_long x, y, z, w; }; - __extension__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7; }; - __extension__ struct{ cl_long4 lo, hi; }; -#endif -#if defined( __CL_LONG2__) - __cl_long2 v2[4]; -#endif -#if defined( __CL_LONG4__) - __cl_long4 v4[2]; -#endif -#if defined( __CL_LONG8__ ) - __cl_long8 v8; -#endif -}cl_long8; - -typedef union -{ - cl_long CL_ALIGNED(128) s[16]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_long x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; - __extension__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; - __extension__ struct{ cl_long8 lo, hi; }; -#endif -#if defined( __CL_LONG2__) - __cl_long2 v2[8]; -#endif -#if defined( __CL_LONG4__) - __cl_long4 v4[4]; -#endif -#if defined( __CL_LONG8__ ) - __cl_long8 v8[2]; -#endif -#if defined( __CL_LONG16__ ) - __cl_long16 v16; -#endif -}cl_long16; - - -/* ---- cl_ulongn ---- */ -typedef union -{ - cl_ulong CL_ALIGNED(16) s[2]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_ulong x, y; }; - __extension__ struct{ cl_ulong s0, s1; }; - __extension__ struct{ cl_ulong lo, hi; }; -#endif -#if defined( __CL_ULONG2__) - __cl_ulong2 v2; -#endif -}cl_ulong2; - -typedef union -{ - cl_ulong CL_ALIGNED(32) s[4]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_ulong x, y, z, w; }; - __extension__ struct{ cl_ulong s0, s1, s2, s3; }; - __extension__ struct{ cl_ulong2 lo, hi; }; -#endif -#if defined( __CL_ULONG2__) - __cl_ulong2 v2[2]; -#endif -#if defined( __CL_ULONG4__) - __cl_ulong4 v4; -#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]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_ulong x, y, z, w; }; - __extension__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7; }; - __extension__ struct{ cl_ulong4 lo, hi; }; -#endif -#if defined( __CL_ULONG2__) - __cl_ulong2 v2[4]; -#endif -#if defined( __CL_ULONG4__) - __cl_ulong4 v4[2]; -#endif -#if defined( __CL_ULONG8__ ) - __cl_ulong8 v8; -#endif -}cl_ulong8; - -typedef union -{ - cl_ulong CL_ALIGNED(128) s[16]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_ulong x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; - __extension__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; - __extension__ struct{ cl_ulong8 lo, hi; }; -#endif -#if defined( __CL_ULONG2__) - __cl_ulong2 v2[8]; -#endif -#if defined( __CL_ULONG4__) - __cl_ulong4 v4[4]; -#endif -#if defined( __CL_ULONG8__ ) - __cl_ulong8 v8[2]; -#endif -#if defined( __CL_ULONG16__ ) - __cl_ulong16 v16; -#endif -}cl_ulong16; - - -/* --- cl_floatn ---- */ - -typedef union -{ - cl_float CL_ALIGNED(8) s[2]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_float x, y; }; - __extension__ struct{ cl_float s0, s1; }; - __extension__ struct{ cl_float lo, hi; }; -#endif -#if defined( __CL_FLOAT2__) - __cl_float2 v2; -#endif -}cl_float2; - -typedef union -{ - cl_float CL_ALIGNED(16) s[4]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_float x, y, z, w; }; - __extension__ struct{ cl_float s0, s1, s2, s3; }; - __extension__ struct{ cl_float2 lo, hi; }; -#endif -#if defined( __CL_FLOAT2__) - __cl_float2 v2[2]; -#endif -#if defined( __CL_FLOAT4__) - __cl_float4 v4; -#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]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_float x, y, z, w; }; - __extension__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7; }; - __extension__ struct{ cl_float4 lo, hi; }; -#endif -#if defined( __CL_FLOAT2__) - __cl_float2 v2[4]; -#endif -#if defined( __CL_FLOAT4__) - __cl_float4 v4[2]; -#endif -#if defined( __CL_FLOAT8__ ) - __cl_float8 v8; -#endif -}cl_float8; - -typedef union -{ - cl_float CL_ALIGNED(64) s[16]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_float x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; - __extension__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; - __extension__ struct{ cl_float8 lo, hi; }; -#endif -#if defined( __CL_FLOAT2__) - __cl_float2 v2[8]; -#endif -#if defined( __CL_FLOAT4__) - __cl_float4 v4[4]; -#endif -#if defined( __CL_FLOAT8__ ) - __cl_float8 v8[2]; -#endif -#if defined( __CL_FLOAT16__ ) - __cl_float16 v16; -#endif -}cl_float16; - -/* --- cl_doublen ---- */ - -typedef union -{ - cl_double CL_ALIGNED(16) s[2]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_double x, y; }; - __extension__ struct{ cl_double s0, s1; }; - __extension__ struct{ cl_double lo, hi; }; -#endif -#if defined( __CL_DOUBLE2__) - __cl_double2 v2; -#endif -}cl_double2; - -typedef union -{ - cl_double CL_ALIGNED(32) s[4]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_double x, y, z, w; }; - __extension__ struct{ cl_double s0, s1, s2, s3; }; - __extension__ struct{ cl_double2 lo, hi; }; -#endif -#if defined( __CL_DOUBLE2__) - __cl_double2 v2[2]; -#endif -#if defined( __CL_DOUBLE4__) - __cl_double4 v4; -#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]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_double x, y, z, w; }; - __extension__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7; }; - __extension__ struct{ cl_double4 lo, hi; }; -#endif -#if defined( __CL_DOUBLE2__) - __cl_double2 v2[4]; -#endif -#if defined( __CL_DOUBLE4__) - __cl_double4 v4[2]; -#endif -#if defined( __CL_DOUBLE8__ ) - __cl_double8 v8; -#endif -}cl_double8; - -typedef union -{ - cl_double CL_ALIGNED(128) s[16]; -#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ ) - __extension__ struct{ cl_double x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; - __extension__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; - __extension__ struct{ cl_double8 lo, hi; }; -#endif -#if defined( __CL_DOUBLE2__) - __cl_double2 v2[8]; -#endif -#if defined( __CL_DOUBLE4__) - __cl_double4 v4[4]; -#endif -#if defined( __CL_DOUBLE8__ ) - __cl_double8 v8[2]; -#endif -#if defined( __CL_DOUBLE16__ ) - __cl_double16 v16; -#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 -} -#endif - -#endif /* __CL_PLATFORM_H */ diff --git a/Externals/CLRun/include/clrun.h b/Externals/CLRun/include/clrun.h deleted file mode 100644 index 859182e891..0000000000 --- a/Externals/CLRun/include/clrun.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef __CLRUN_H -#define __CLRUN_H - -/*#ifdef _WIN32 -#ifdef CLRUN_COMPILE -#define EXPORTED __declspec(dllexport) -#else -#define EXPORTED __declspec(dllimport) -#endif -#else*/ -#define EXPORTED -//#endif - -#ifdef __cplusplus -extern "C" { -#endif - -extern EXPORTED int clrInit(); -extern EXPORTED int clrHasOpenCL(); - -#ifdef __cplusplus -}; -#endif - -#endif diff --git a/Source/Core/Common/Src/CommonPaths.h b/Source/Core/Common/Src/CommonPaths.h index d171bcb0a7..456f669565 100644 --- a/Source/Core/Common/Src/CommonPaths.h +++ b/Source/Core/Common/Src/CommonPaths.h @@ -65,7 +65,6 @@ #define SHADERCACHE_DIR "ShaderCache" #define STATESAVES_DIR "StateSaves" #define SCREENSHOTS_DIR "ScreenShots" -#define OPENCL_DIR "OpenCL" #define LOAD_DIR "Load" #define HIRES_TEXTURES_DIR LOAD_DIR DIR_SEP "Textures" #define DUMP_DIR "Dump" diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index 7eed3f08f4..ac625e35dd 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -814,7 +814,6 @@ const std::string& GetUserPath(const unsigned int DirIDX, const std::string &new paths[D_SHADERS_IDX] = paths[D_USER_IDX] + SHADERS_DIR DIR_SEP; paths[D_STATESAVES_IDX] = paths[D_USER_IDX] + STATESAVES_DIR DIR_SEP; paths[D_SCREENSHOTS_IDX] = paths[D_USER_IDX] + SCREENSHOTS_DIR DIR_SEP; - paths[D_OPENCL_IDX] = paths[D_USER_IDX] + OPENCL_DIR DIR_SEP; paths[D_HIRESTEXTURES_IDX] = paths[D_USER_IDX] + HIRES_TEXTURES_DIR DIR_SEP; paths[D_DUMP_IDX] = paths[D_USER_IDX] + DUMP_DIR DIR_SEP; paths[D_DUMPFRAMES_IDX] = paths[D_DUMP_IDX] + DUMP_FRAMES_DIR DIR_SEP; @@ -869,7 +868,6 @@ const std::string& GetUserPath(const unsigned int DirIDX, const std::string &new paths[D_SHADERS_IDX] = paths[D_USER_IDX] + SHADERS_DIR DIR_SEP; paths[D_STATESAVES_IDX] = paths[D_USER_IDX] + STATESAVES_DIR DIR_SEP; paths[D_SCREENSHOTS_IDX] = paths[D_USER_IDX] + SCREENSHOTS_DIR DIR_SEP; - paths[D_OPENCL_IDX] = paths[D_USER_IDX] + OPENCL_DIR DIR_SEP; paths[D_HIRESTEXTURES_IDX] = paths[D_USER_IDX] + HIRES_TEXTURES_DIR DIR_SEP; paths[D_DUMP_IDX] = paths[D_USER_IDX] + DUMP_DIR DIR_SEP; paths[D_DUMPFRAMES_IDX] = paths[D_DUMP_IDX] + DUMP_FRAMES_DIR DIR_SEP; diff --git a/Source/Core/Common/Src/FileUtil.h b/Source/Core/Common/Src/FileUtil.h index b39135fa41..91de214a38 100644 --- a/Source/Core/Common/Src/FileUtil.h +++ b/Source/Core/Common/Src/FileUtil.h @@ -29,7 +29,6 @@ enum { D_SHADERS_IDX, D_STATESAVES_IDX, D_SCREENSHOTS_IDX, - D_OPENCL_IDX, D_HIRESTEXTURES_IDX, D_DUMP_IDX, D_DUMPFRAMES_IDX, diff --git a/Source/Core/DolphinWX/DolphinWX.vcxproj b/Source/Core/DolphinWX/DolphinWX.vcxproj index 14eacfd440..d3ca18c360 100644 --- a/Source/Core/DolphinWX/DolphinWX.vcxproj +++ b/Source/Core/DolphinWX/DolphinWX.vcxproj @@ -171,9 +171,6 @@ {8ada04d7-6db1-4da4-ab55-64fb12a0997b} - - {aa862e5e-a993-497a-b6a0-0e8e94b10050} - {4c9f135b-a85e-430c-bad4-4c67ef5fc12c} @@ -241,4 +238,4 @@ - \ No newline at end of file + diff --git a/Source/Core/DolphinWX/Src/ConfigMain.h b/Source/Core/DolphinWX/Src/ConfigMain.h index 1624254003..43fa90c21b 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.h +++ b/Source/Core/DolphinWX/Src/ConfigMain.h @@ -126,7 +126,6 @@ private: wxCheckBox* UseFPSForLimiting; // Advanced - wxCheckBox* EnableOpenCL; wxRadioBox* CPUEngine; wxCheckBox* DSPThread; wxCheckBox* _NTSCJ; diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index d1fc31bc1a..6b416a42e5 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -266,7 +266,6 @@ bool DolphinApp::OnInit() File::CreateFullPath(File::GetUserPath(D_HIRESTEXTURES_IDX)); File::CreateFullPath(File::GetUserPath(D_MAILLOGS_IDX)); File::CreateFullPath(File::GetUserPath(D_MAPS_IDX)); - File::CreateFullPath(File::GetUserPath(D_OPENCL_IDX)); File::CreateFullPath(File::GetUserPath(D_SCREENSHOTS_IDX)); File::CreateFullPath(File::GetUserPath(D_SHADERS_IDX)); File::CreateFullPath(File::GetUserPath(D_STATESAVES_IDX)); diff --git a/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp b/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp index dc91670f4b..34923a4654 100644 --- a/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp +++ b/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp @@ -118,7 +118,6 @@ wxString use_ffv1_desc = wxTRANSLATE("Encode frame dumps using the FFV1 codec.\n #endif wxString free_look_desc = wxTRANSLATE("This feature allows you to change the game's camera.\nMove the mouse while holding the right mouse button to pan and while holding the middle button to move.\nHold SHIFT and press one of the WASD keys to move the camera by a certain step distance (SHIFT+0 to move faster and SHIFT+9 to move slower). Press SHIFT+R to reset the camera.\n\nIf unsure, leave this unchecked."); wxString crop_desc = wxTRANSLATE("Crop the picture from 4:3 to 5:4 or from 16:9 to 16:10.\n\nIf unsure, leave this unchecked."); -wxString opencl_desc = wxTRANSLATE("[EXPERIMENTAL]\nAims to speed up emulation by offloading texture decoding to the GPU using the OpenCL framework.\nHowever, right now it's known to cause texture defects in various games. Also it's slower than regular CPU texture decoding in most cases.\n\nIf unsure, leave this unchecked."); wxString dlc_desc = wxTRANSLATE("[EXPERIMENTAL]\nSpeeds up emulation a bit by caching display lists.\nPossibly causes issues though.\n\nIf unsure, leave this unchecked."); wxString omp_desc = wxTRANSLATE("Use multiple threads to decode textures.\nMight result in a speedup (especially on CPUs with more than two cores).\n\nIf unsure, leave this unchecked."); wxString ppshader_desc = wxTRANSLATE("Apply a post-processing effect after finishing a frame.\n\nIf unsure, select (off)."); @@ -499,7 +498,6 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con wxGridSizer* const szr_other = new wxGridSizer(2, 5, 5); szr_other->Add(CreateCheckBox(page_hacks, _("Cache Display Lists"), wxGetTranslation(dlc_desc), vconfig.bDlistCachingEnable)); szr_other->Add(CreateCheckBox(page_hacks, _("Disable Destination Alpha"), wxGetTranslation(disable_dstalpha_desc), vconfig.bDstAlphaPass)); - szr_other->Add(CreateCheckBox(page_hacks, _("OpenCL Texture Decoder"), wxGetTranslation(opencl_desc), vconfig.bEnableOpenCL)); szr_other->Add(CreateCheckBox(page_hacks, _("OpenMP Texture Decoder"), wxGetTranslation(omp_desc), vconfig.bOMPDecoder)); szr_other->Add(CreateCheckBox(page_hacks, _("Fast Depth Calculation"), wxGetTranslation(fast_depth_calc_desc), vconfig.bFastDepthCalc)); szr_other->Add(hacked_buffer_upload = CreateCheckBox(page_hacks, _("Vertex Streaming Hack"), wxGetTranslation(hacked_buffer_upload_desc), vconfig.bHackedBufferUpload)); diff --git a/Source/Core/VideoBackends/OGL/CMakeLists.txt b/Source/Core/VideoBackends/OGL/CMakeLists.txt index f8ccb85052..8fcc896eb0 100644 --- a/Source/Core/VideoBackends/OGL/CMakeLists.txt +++ b/Source/Core/VideoBackends/OGL/CMakeLists.txt @@ -36,10 +36,6 @@ if(wxWidgets_FOUND) set(LIBS ${LIBS} ${wxWidgets_LIBRARIES}) endif(wxWidgets_FOUND) -if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - set(LIBS ${LIBS} clrun) -endif() - if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "NetBSD") set(LIBS ${LIBS} usbhid) diff --git a/Source/Core/VideoBackends/OGL/Src/TextureConverter.cpp b/Source/Core/VideoBackends/OGL/Src/TextureConverter.cpp index 8124db15e7..56a620b84a 100644 --- a/Source/Core/VideoBackends/OGL/Src/TextureConverter.cpp +++ b/Source/Core/VideoBackends/OGL/Src/TextureConverter.cpp @@ -3,7 +3,6 @@ // Refer to the license.txt file included. // Fast image conversion using OpenGL shaders. -// This kind of stuff would be a LOT nicer with OpenCL. #include "TextureConverter.h" #include "TextureConversionShader.h" diff --git a/Source/Core/VideoBackends/Software/CMakeLists.txt b/Source/Core/VideoBackends/Software/CMakeLists.txt index 2ba8e6c0c7..29179b69c5 100644 --- a/Source/Core/VideoBackends/Software/CMakeLists.txt +++ b/Source/Core/VideoBackends/Software/CMakeLists.txt @@ -45,8 +45,5 @@ else() GLEW ${OPENGL_LIBRARIES}) endif() -if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")) - set(LIBS ${LIBS} clrun) -endif() add_dolphin_library(videosoftware "${SRCS}" "${LIBS}") diff --git a/Source/Core/VideoCommon/CMakeLists.txt b/Source/Core/VideoCommon/CMakeLists.txt index ac2e82bb6b..5d79730044 100644 --- a/Source/Core/VideoCommon/CMakeLists.txt +++ b/Source/Core/VideoCommon/CMakeLists.txt @@ -14,8 +14,6 @@ set(SRCS Src/BPFunctions.cpp Src/MainBase.cpp Src/OnScreenDisplay.cpp Src/OpcodeDecoding.cpp - Src/OpenCL.cpp - Src/OpenCL/TextureDecoder_OpenCL.cpp Src/PerfQueryBase.cpp Src/PixelEngine.cpp Src/PixelShaderGen.cpp diff --git a/Source/Core/VideoCommon/OpenCL.rules b/Source/Core/VideoCommon/OpenCL.rules deleted file mode 100644 index cf695455ef..0000000000 --- a/Source/Core/VideoCommon/OpenCL.rules +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - diff --git a/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp b/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp index 839d3fd5f6..f469bc7f6d 100644 --- a/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp +++ b/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp @@ -33,8 +33,6 @@ #include "Fifo.h" #include "DataReader.h" -#include "OpenCL.h" -#include "OpenCL/TextureDecoder_OpenCL.h" #include "VideoConfig.h" u8* g_pVideoData = 0; @@ -478,22 +476,11 @@ void OpcodeDecoder_Init() DataReadU32xFuncs[i] = DataReadU32xFuncs_SSSE3[i]; } #endif - - if (g_Config.bEnableOpenCL) - { - OpenCL::Initialize(); - TexDecoder_OpenCL_Initialize(); - } } void OpcodeDecoder_Shutdown() { - if (g_Config.bEnableOpenCL) - { - TexDecoder_OpenCL_Shutdown(); - OpenCL::Destroy(); - } } u32 OpcodeDecoder_Run(bool skipped_frame) diff --git a/Source/Core/VideoCommon/Src/OpenCL.cpp b/Source/Core/VideoCommon/Src/OpenCL.cpp deleted file mode 100644 index 7781b04978..0000000000 --- a/Source/Core/VideoCommon/Src/OpenCL.cpp +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright 2013 Dolphin Emulator Project -// Licensed under GPLv2 -// Refer to the license.txt file included. - -// TODO: Make a more centralized version of this (for now every backend that will use it will create its own context, which is weird). An object maybe? - -#include "OpenCL.h" -#include "Common.h" -#include "Timer.h" - -namespace OpenCL -{ - -cl_device_id device_id = NULL; -cl_context g_context = NULL; -cl_command_queue g_cmdq = NULL; - -bool g_bInitialized = false; - -bool Initialize() -{ - if(g_bInitialized) - return true; - - if(g_context) - return false; - int err; // error code returned from api calls - -#ifdef __APPLE__ - // If OpenCL is weakly linked and not found, its symbols will be NULL - if (clGetPlatformIDs == NULL) - return false; -#else - clrInit(); - if(!clrHasOpenCL()) - return false; -#endif - - // Connect to a compute device - cl_uint numPlatforms; - cl_platform_id platform = NULL; - err = clGetPlatformIDs(0, NULL, &numPlatforms); - - if (err != CL_SUCCESS) - { - HandleCLError(err, "clGetPlatformIDs failed."); - return false; - } - - if (0 < numPlatforms) - { - cl_platform_id* platforms = new cl_platform_id[numPlatforms]; - err = clGetPlatformIDs(numPlatforms, platforms, NULL); - - if (err != CL_SUCCESS) - { - HandleCLError(err, "clGetPlatformIDs failed."); - return false; - } - - char pbuf[100]; - err = clGetPlatformInfo(platforms[0], CL_PLATFORM_VENDOR, sizeof(pbuf), - pbuf, NULL); - - if (err != CL_SUCCESS) - { - HandleCLError(err, "clGetPlatformInfo failed."); - return false; - } - - platform = platforms[0]; - delete[] platforms; - } - else - { - PanicAlert("No OpenCL platform found."); - return false; - } - - cl_context_properties cps[3] = {CL_CONTEXT_PLATFORM, - (cl_context_properties)platform, 0}; - - cl_context_properties* cprops = (NULL == platform) ? NULL : cps; - - err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_DEFAULT, 1, &device_id, NULL); - if (err != CL_SUCCESS) - { - HandleCLError(err, "Failed to create a device group!"); - return false; - } - - // Create a compute context - g_context = clCreateContext(cprops, 1, &device_id, NULL, NULL, &err); - if (!g_context) - { - HandleCLError(err, "Failed to create a compute context!"); - return false; - } - - // Create a command commands - g_cmdq = clCreateCommandQueue(g_context, device_id, 0, &err); - if (!g_cmdq) - { - HandleCLError(err, "Failed to create a command commands!"); - return false; - } - - g_bInitialized = true; - return true; -} - -cl_context GetContext() -{ - return g_context; -} - -cl_command_queue GetCommandQueue() -{ - return g_cmdq; -} - -cl_program CompileProgram(const char *Kernel) -{ - u32 compileStart = Common::Timer::GetTimeMs(); - cl_int err; - cl_program program; - program = clCreateProgramWithSource(OpenCL::g_context, 1, - (const char **) & Kernel, NULL, &err); - - if (!program) - { - HandleCLError(err, "Error: Failed to create compute program!"); - } - - // Build the program executable - err = clBuildProgram(program , 0, NULL, NULL, NULL, NULL); - if(err != CL_SUCCESS) { - HandleCLError(err, "Error: failed to build program"); - - char *buildlog = NULL; - size_t buildlog_size = 0; - - clGetProgramBuildInfo(program, OpenCL::device_id, CL_PROGRAM_BUILD_LOG, 0, NULL, &buildlog_size); - buildlog = new char[buildlog_size + 1]; - err = clGetProgramBuildInfo(program, OpenCL::device_id, CL_PROGRAM_BUILD_LOG, buildlog_size, buildlog, NULL); - buildlog[buildlog_size] = 0; - - if(err != CL_SUCCESS) - { - HandleCLError(err, "Error: can't get build log"); - } else - { - ERROR_LOG(COMMON, "Error log:\n%s\n", buildlog); - } - - delete[] buildlog; - return NULL; - } - - INFO_LOG(COMMON, "OpenCL CompileProgram took %.3f seconds", - (float)(Common::Timer::GetTimeMs() - compileStart) / 1000.0); - return program; -} - -cl_kernel CompileKernel(cl_program program, const char *Function) -{ - u32 compileStart = Common::Timer::GetTimeMs(); - int err; - - // Create the compute kernel in the program we wish to run - cl_kernel kernel = clCreateKernel(program, Function, &err); - if (!kernel || err != CL_SUCCESS) - { - char buffer[1024]; - sprintf(buffer, "Failed to create compute kernel '%s' !", Function); - HandleCLError(err, buffer); - return NULL; - } - INFO_LOG(COMMON, "OpenCL CompileKernel took %.3f seconds", - (float)(Common::Timer::GetTimeMs() - compileStart) / 1000.0); - return kernel; -} - -void Destroy() -{ - if (g_cmdq) - { - clReleaseCommandQueue(g_cmdq); - g_cmdq = NULL; - } - if (g_context) - { - clReleaseContext(g_context); - g_context = NULL; - } - g_bInitialized = false; -} - -void HandleCLError(cl_int error, const char* str) -{ - const char* name; - switch(error) - { -#define CL_ERROR(x) case (x): name = #x; break - CL_ERROR(CL_SUCCESS); - CL_ERROR(CL_DEVICE_NOT_FOUND); - CL_ERROR(CL_DEVICE_NOT_AVAILABLE); - CL_ERROR(CL_COMPILER_NOT_AVAILABLE); - CL_ERROR(CL_MEM_OBJECT_ALLOCATION_FAILURE); - CL_ERROR(CL_OUT_OF_RESOURCES); - CL_ERROR(CL_OUT_OF_HOST_MEMORY); - CL_ERROR(CL_PROFILING_INFO_NOT_AVAILABLE); - CL_ERROR(CL_MEM_COPY_OVERLAP); - CL_ERROR(CL_IMAGE_FORMAT_MISMATCH); - CL_ERROR(CL_IMAGE_FORMAT_NOT_SUPPORTED); - CL_ERROR(CL_BUILD_PROGRAM_FAILURE); - CL_ERROR(CL_MAP_FAILURE); - CL_ERROR(CL_INVALID_VALUE); - CL_ERROR(CL_INVALID_DEVICE_TYPE); - CL_ERROR(CL_INVALID_PLATFORM); - CL_ERROR(CL_INVALID_DEVICE); - CL_ERROR(CL_INVALID_CONTEXT); - CL_ERROR(CL_INVALID_QUEUE_PROPERTIES); - CL_ERROR(CL_INVALID_COMMAND_QUEUE); - CL_ERROR(CL_INVALID_HOST_PTR); - CL_ERROR(CL_INVALID_MEM_OBJECT); - CL_ERROR(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR); - CL_ERROR(CL_INVALID_IMAGE_SIZE); - CL_ERROR(CL_INVALID_SAMPLER); - CL_ERROR(CL_INVALID_BINARY); - CL_ERROR(CL_INVALID_BUILD_OPTIONS); - CL_ERROR(CL_INVALID_PROGRAM); - CL_ERROR(CL_INVALID_PROGRAM_EXECUTABLE); - CL_ERROR(CL_INVALID_KERNEL_NAME); - CL_ERROR(CL_INVALID_KERNEL_DEFINITION); - CL_ERROR(CL_INVALID_KERNEL); - CL_ERROR(CL_INVALID_ARG_INDEX); - CL_ERROR(CL_INVALID_ARG_VALUE); - CL_ERROR(CL_INVALID_ARG_SIZE); - CL_ERROR(CL_INVALID_KERNEL_ARGS); - CL_ERROR(CL_INVALID_WORK_DIMENSION); - CL_ERROR(CL_INVALID_WORK_GROUP_SIZE); - CL_ERROR(CL_INVALID_WORK_ITEM_SIZE); - CL_ERROR(CL_INVALID_GLOBAL_OFFSET); - CL_ERROR(CL_INVALID_EVENT_WAIT_LIST); - CL_ERROR(CL_INVALID_EVENT); - CL_ERROR(CL_INVALID_OPERATION); - CL_ERROR(CL_INVALID_GL_OBJECT); - CL_ERROR(CL_INVALID_BUFFER_SIZE); - CL_ERROR(CL_INVALID_MIP_LEVEL); -#undef CL_ERROR - default: - name = "Unknown error code"; - } - if(!str) - str = ""; - ERROR_LOG(COMMON, "OpenCL error: %s %s (%d)", str, name, error); - } -} diff --git a/Source/Core/VideoCommon/Src/OpenCL.h b/Source/Core/VideoCommon/Src/OpenCL.h deleted file mode 100644 index 4ba172bb9c..0000000000 --- a/Source/Core/VideoCommon/Src/OpenCL.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2013 Dolphin Emulator Project -// Licensed under GPLv2 -// Refer to the license.txt file included. - -#ifndef __OPENCL_H__ -#define __OPENCL_H__ - -#include "Common.h" - -#ifdef __APPLE__ -#define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER WEAK_IMPORT_ATTRIBUTE -#include -#else -// The CLRun library provides the headers and all the imports. -#include -#include -#endif - -namespace OpenCL -{ - -extern cl_device_id device_id; -extern cl_context g_context; -extern cl_command_queue g_cmdq; - -bool Initialize(); - -cl_context GetContext(); - -cl_command_queue GetCommandQueue(); - -void Destroy(); - -cl_program CompileProgram(const char *Kernel); -cl_kernel CompileKernel(cl_program program, const char *Function); - -void HandleCLError(cl_int error, const char* str = 0); -} - -#endif diff --git a/Source/Core/VideoCommon/Src/OpenCL/TextureDecoder_OpenCL.cpp b/Source/Core/VideoCommon/Src/OpenCL/TextureDecoder_OpenCL.cpp deleted file mode 100644 index 02e720d4a3..0000000000 --- a/Source/Core/VideoCommon/Src/OpenCL/TextureDecoder_OpenCL.cpp +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright 2013 Dolphin Emulator Project -// Licensed under GPLv2 -// Refer to the license.txt file included. - -#include "TextureDecoder_OpenCL.h" - -#include "../OpenCL.h" -#include "CommonPaths.h" -#include "FileUtil.h" - -#include -#include -#include -#include -#include -#include -#include - -//#define DEBUG_OPENCL - -cl_program g_program; - -struct sDecoderParameter -{ - const char *name; - cl_kernel kernel; - float sizeOfSrc; - float sizeOfDst; - int xSkip; - int ySkip; - PC_TexFormat format; -}; - -sDecoderParameter g_DecodeParametersNative[] = { - /* GX_TF_I4 */ { "DecodeI4", NULL, 0.5f, 1, 8, 8, PC_TEX_FMT_I4_AS_I8 }, - /* GX_TF_I8 */ { "DecodeI8", NULL, 1, 1, 8, 4, PC_TEX_FMT_I8 }, - /* GX_TF_IA4 */ { "DecodeIA4", NULL, 1, 2, 8, 4, PC_TEX_FMT_IA4_AS_IA8 }, - /* GX_TF_IA8 */ { "DecodeIA8", NULL, 2, 2, 4, 4, PC_TEX_FMT_IA8 }, - /* GX_TF_RGB565 */ { "DecodeRGB565", NULL, 2, 2, 4, 4, PC_TEX_FMT_RGB565 }, - /* GX_TF_RGB5A3 */ { "DecodeRGB5A3", NULL, 2, 4, 4, 4, PC_TEX_FMT_BGRA32 }, - /* GX_TF_RGBA8 */ { "DecodeRGBA8", NULL, 4, 4, 4, 4, PC_TEX_FMT_BGRA32 }, - /* 7 */ { NULL, NULL, 0, 0, 0, 0, PC_TEX_FMT_NONE }, - /* GX_TF_C4 */ { NULL, NULL, 0, 0, 0, 0, PC_TEX_FMT_NONE }, - /* GX_TF_C8 */ { NULL, NULL, 0, 0, 0, 0, PC_TEX_FMT_NONE }, - /* GX_TF_C14X2 */ { NULL, NULL, 0, 0, 0, 0, PC_TEX_FMT_NONE }, - /* B */ { NULL, NULL, 0, 0, 0, 0, PC_TEX_FMT_NONE }, - /* C */ { NULL, NULL, 0, 0, 0, 0, PC_TEX_FMT_NONE }, - /* D */ { NULL, NULL, 0, 0, 0, 0, PC_TEX_FMT_NONE }, - /* GX_TF_CMPR */ { "DecodeCMPR", NULL, 0.5f, 4, 8, 8, PC_TEX_FMT_BGRA32 }, -}; - -sDecoderParameter g_DecodeParametersRGBA[] = { - /* GX_TF_I4 */ { "DecodeI4_RGBA", NULL, 0.5f, 4, 8, 8, PC_TEX_FMT_RGBA32 }, - /* GX_TF_I8 */ { "DecodeI8_RGBA", NULL, 1, 4, 8, 4, PC_TEX_FMT_RGBA32 }, - /* GX_TF_IA4 */ { "DecodeIA4_RGBA", NULL, 1, 4, 8, 4, PC_TEX_FMT_RGBA32 }, - /* GX_TF_IA8 */ { "DecodeIA8_RGBA", NULL, 2, 4, 4, 4, PC_TEX_FMT_RGBA32 }, - /* GX_TF_RGB565 */ { "DecodeRGB565_RGBA", NULL, 2, 4, 4, 4, PC_TEX_FMT_RGBA32 }, - /* GX_TF_RGB5A3 */ { "DecodeRGB5A3_RGBA", NULL, 2, 4, 4, 4, PC_TEX_FMT_RGBA32 }, - /* GX_TF_RGBA8 */ { "DecodeRGBA8_RGBA", NULL, 4, 4, 4, 4, PC_TEX_FMT_RGBA32 }, - /* 7 */ { NULL, NULL, 0, 0, 0, 0, PC_TEX_FMT_NONE }, - /* GX_TF_C4 */ { NULL, NULL, 0, 0, 0, 0, PC_TEX_FMT_NONE }, - /* GX_TF_C8 */ { NULL, NULL, 0, 0, 0, 0, PC_TEX_FMT_NONE }, - /* GX_TF_C14X2 */ { NULL, NULL, 0, 0, 0, 0, PC_TEX_FMT_NONE }, - /* B */ { NULL, NULL, 0, 0, 0, 0, PC_TEX_FMT_NONE }, - /* C */ { NULL, NULL, 0, 0, 0, 0, PC_TEX_FMT_NONE }, - /* D */ { NULL, NULL, 0, 0, 0, 0, PC_TEX_FMT_NONE }, - /* GX_TF_CMPR */ { "DecodeCMPR_RGBA", NULL, 0.5f, 4, 8, 8, PC_TEX_FMT_RGBA32 }, -}; - -bool g_Inited = false; -cl_mem g_clsrc, g_cldst; // texture buffer memory objects - -#define HEADER_SIZE 32 - -void TexDecoder_OpenCL_Initialize() -{ - if(!g_Inited) - { - if(!OpenCL::Initialize()) - return; - - cl_int err = 1; - size_t binary_size = 0; - char *binary = NULL; - char *header = NULL; - size_t nDevices = 0; - cl_device_id *devices = NULL; - size_t *binary_sizes = NULL; - char **binaries = NULL; - std::string filename; - char dolphin_rev[HEADER_SIZE]; - - filename = File::GetUserPath(D_OPENCL_IDX) + "kernel.bin"; - snprintf(dolphin_rev, HEADER_SIZE, "%-31s", scm_rev_str); - - { - File::IOFile input(filename, "rb"); - if (!input) - { - binary_size = 0; - } - else - { - binary_size = input.GetSize(); - header = new char[HEADER_SIZE]; - binary = new char[binary_size]; - input.ReadBytes(header, HEADER_SIZE); - input.ReadBytes(binary, binary_size); - } - } - - if (binary_size > 0) - { - if (binary_size > HEADER_SIZE) - { - if (strncmp(header, dolphin_rev, HEADER_SIZE) == 0) - { - g_program = clCreateProgramWithBinary(OpenCL::GetContext(), 1, &OpenCL::device_id, &binary_size, (const unsigned char**)&binary, NULL, &err); - if (err != CL_SUCCESS) - { - OpenCL::HandleCLError(err, "clCreateProgramWithBinary"); - } - - if (!err) - { - err = clBuildProgram(g_program, 1, &OpenCL::device_id, NULL, NULL, NULL); - if (err != CL_SUCCESS) - { - OpenCL::HandleCLError(err, "clBuildProgram"); - } - } - } - } - delete [] header; - delete [] binary; - } - - // If an error occurred using the kernel binary, recompile the kernels - if (err) - { - std::string code; - filename = File::GetSysDirectory() + OPENCL_DIR DIR_SEP "TextureDecoder.cl"; - if (!File::ReadFileToString(filename.c_str(), code)) - { - ERROR_LOG(VIDEO, "Failed to load OpenCL code %s - file is missing?", filename.c_str()); - return; - } - - g_program = OpenCL::CompileProgram(code.c_str()); - - err = clGetProgramInfo(g_program, CL_PROGRAM_NUM_DEVICES, sizeof(nDevices), &nDevices, NULL); - if (err != CL_SUCCESS) - { - OpenCL::HandleCLError(err, "clGetProgramInfo"); - } - devices = (cl_device_id *)malloc( sizeof(cl_device_id) *nDevices); - - err = clGetProgramInfo(g_program, CL_PROGRAM_DEVICES, sizeof(cl_device_id)*nDevices, devices, NULL); - if (err != CL_SUCCESS) - { - OpenCL::HandleCLError(err, "clGetProgramInfo"); - } - - binary_sizes = (size_t *)malloc(sizeof(size_t)*nDevices); - err = clGetProgramInfo(g_program, CL_PROGRAM_BINARY_SIZES, sizeof(size_t)*nDevices, binary_sizes, NULL); - if (err != CL_SUCCESS) - { - OpenCL::HandleCLError(err, "clGetProgramInfo"); - } - - binaries = (char **)malloc(sizeof(char *)*nDevices); - for (u32 i = 0; i < nDevices; ++i) - { - if (binary_sizes[i] != 0) - { - binaries[i] = (char *)malloc(HEADER_SIZE + binary_sizes[i]); - } - else - { - binaries[i] = NULL; - } - } - err = clGetProgramInfo( g_program, CL_PROGRAM_BINARIES, sizeof(char *)*nDevices, binaries, NULL ); - if (err != CL_SUCCESS) - { - OpenCL::HandleCLError(err, "clGetProgramInfo"); - } - - if (!err) - { - filename = File::GetUserPath(D_OPENCL_IDX) + "kernel.bin"; - - File::IOFile output(filename, "wb"); - if (!output) - { - binary_size = 0; - } - else - { - // Supporting one OpenCL device for now - output.WriteBytes(dolphin_rev, HEADER_SIZE); - output.WriteBytes(binaries[0], binary_sizes[0]); - } - } - for (u32 i = 0; i < nDevices; ++i) - { - if (binary_sizes[i] != 0) - { - free(binaries[i]); - } - } - if (binaries != NULL) - free(binaries); - if (binary_sizes != NULL) - free(binary_sizes); - if (devices != NULL) - free(devices); - } - - for (int i = 0; i <= GX_TF_CMPR; ++i) - { - if (g_DecodeParametersNative[i].name) - g_DecodeParametersNative[i].kernel = - OpenCL::CompileKernel(g_program, - g_DecodeParametersNative[i].name); - - if (g_DecodeParametersRGBA[i].name) - g_DecodeParametersRGBA[i].kernel = - OpenCL::CompileKernel(g_program, - g_DecodeParametersRGBA[i].name); - } - - // Allocating maximal Wii texture size in advance, so that we don't have to allocate/deallocate per texture -#ifndef DEBUG_OPENCL - g_clsrc = clCreateBuffer(OpenCL::GetContext(), CL_MEM_READ_ONLY , 1024 * 1024 * sizeof(u32), NULL, NULL); - g_cldst = clCreateBuffer(OpenCL::GetContext(), CL_MEM_WRITE_ONLY, 1024 * 1024 * sizeof(u32), NULL, NULL); -#endif - - g_Inited = true; - } -} - -void TexDecoder_OpenCL_Shutdown() -{ - if (g_program) - clReleaseProgram(g_program); - - for (int i = 0; i < GX_TF_CMPR; ++i) { - if (g_DecodeParametersNative[i].kernel) - clReleaseKernel(g_DecodeParametersNative[i].kernel); - - if(g_DecodeParametersRGBA[i].kernel) - clReleaseKernel(g_DecodeParametersRGBA[i].kernel); - } - - if(g_clsrc) - clReleaseMemObject(g_clsrc); - - if(g_cldst) - clReleaseMemObject(g_cldst); - - g_Inited = false; -} - -PC_TexFormat TexDecoder_Decode_OpenCL(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt, bool rgba) -{ - cl_int err; - sDecoderParameter& decoder = rgba ? g_DecodeParametersRGBA[texformat] : g_DecodeParametersNative[texformat]; - if(!g_Inited || !decoder.name || !decoder.kernel || decoder.format == PC_TEX_FMT_NONE) - return PC_TEX_FMT_NONE; - -#ifdef DEBUG_OPENCL - g_clsrc = clCreateBuffer(OpenCL::GetContext(), CL_MEM_READ_ONLY , 1024 * 1024 * sizeof(u32), NULL, NULL); - g_cldst = clCreateBuffer(OpenCL::GetContext(), CL_MEM_WRITE_ONLY, 1024 * 1024 * sizeof(u32), NULL, NULL); -#endif - - clEnqueueWriteBuffer(OpenCL::GetCommandQueue(), g_clsrc, CL_TRUE, 0, (size_t)(width * height * decoder.sizeOfSrc), src, 0, NULL, NULL); - - clSetKernelArg(decoder.kernel, 0, sizeof(cl_mem), &g_cldst); - clSetKernelArg(decoder.kernel, 1, sizeof(cl_mem), &g_clsrc); - clSetKernelArg(decoder.kernel, 2, sizeof(cl_int), &width); - - size_t global[] = { (size_t)(width / decoder.xSkip), (size_t)(height / decoder.ySkip) }; - - // No work-groups for now - /* - size_t local; - err = clGetKernelWorkGroupInfo(kernelToRun, OpenCL::device_id, CL_KERNEL_WORK_GROUP_SIZE, sizeof(local), &local, NULL); - if(err) - PanicAlert("Error obtaining work-group information"); - */ - - err = clEnqueueNDRangeKernel(OpenCL::GetCommandQueue(), decoder.kernel, 2, NULL, global, NULL, 0, NULL, NULL); - if(err) - OpenCL::HandleCLError(err, "Failed to enqueue kernel"); - - clFinish(OpenCL::GetCommandQueue()); - - clEnqueueReadBuffer(OpenCL::GetCommandQueue(), g_cldst, CL_TRUE, 0, (size_t)(width * height * decoder.sizeOfDst), dst, 0, NULL, NULL); - -#ifdef DEBUG_OPENCL - clReleaseMemObject(g_clsrc); - clReleaseMemObject(g_cldst); -#endif - - return decoder.format; -} diff --git a/Source/Core/VideoCommon/Src/OpenCL/TextureDecoder_OpenCL.h b/Source/Core/VideoCommon/Src/OpenCL/TextureDecoder_OpenCL.h deleted file mode 100644 index aacccd3885..0000000000 --- a/Source/Core/VideoCommon/Src/OpenCL/TextureDecoder_OpenCL.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2013 Dolphin Emulator Project -// Licensed under GPLv2 -// Refer to the license.txt file included. - -#ifndef OPENCL_TEXTURE_DECODER -#define OPENCL_TEXTURE_DECODER -#include "Common.h" -#include "../TextureDecoder.h" - -void TexDecoder_OpenCL_Initialize(); -void TexDecoder_OpenCL_Shutdown(); - -PC_TexFormat TexDecoder_Decode_OpenCL(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt, bool rgba); - -#endif diff --git a/Source/Core/VideoCommon/Src/TextureDecoder_Generic.cpp b/Source/Core/VideoCommon/Src/TextureDecoder_Generic.cpp index a8c34cfac7..4b24409ce3 100644 --- a/Source/Core/VideoCommon/Src/TextureDecoder_Generic.cpp +++ b/Source/Core/VideoCommon/Src/TextureDecoder_Generic.cpp @@ -20,8 +20,6 @@ #include "CPUDetect.h" #include "TextureDecoder.h" -#include "OpenCL.h" -#include "OpenCL/TextureDecoder_OpenCL.h" #include "VideoConfig.h" #include "LookUpTables.h" @@ -1060,15 +1058,12 @@ void TexDecoder_SetTexFmtOverlayOptions(bool enable, bool center) PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt,bool rgbaOnly) { - PC_TexFormat retval = TexDecoder_Decode_OpenCL(dst, src, - width, height, texformat, tlutaddr, tlutfmt, rgbaOnly); - if (retval == PC_TEX_FMT_NONE) - retval = rgbaOnly ? TexDecoder_Decode_RGBA((u32*)dst, src, - width, height, texformat, tlutaddr, tlutfmt) - : TexDecoder_Decode_real(dst, src, - width, height, texformat, tlutaddr, tlutfmt); + PC_TexFormat retval = rgbaOnly ? TexDecoder_Decode_RGBA((u32*)dst, src, + width, height, texformat, tlutaddr, tlutfmt) + : TexDecoder_Decode_real(dst, src, + width, height, texformat, tlutaddr, tlutfmt); - if ((!TexFmt_Overlay_Enable)|| (retval == PC_TEX_FMT_NONE)) + if ((!TexFmt_Overlay_Enable) || (retval == PC_TEX_FMT_NONE)) return retval; int w = min(width, 40); diff --git a/Source/Core/VideoCommon/Src/TextureDecoder_x64.cpp b/Source/Core/VideoCommon/Src/TextureDecoder_x64.cpp index f15a498e24..3913513206 100644 --- a/Source/Core/VideoCommon/Src/TextureDecoder_x64.cpp +++ b/Source/Core/VideoCommon/Src/TextureDecoder_x64.cpp @@ -7,8 +7,6 @@ #include "CPUDetect.h" #include "TextureDecoder.h" -#include "OpenCL.h" -#include "OpenCL/TextureDecoder_OpenCL.h" #include "VideoConfig.h" #include "LookUpTables.h" @@ -2039,15 +2037,12 @@ void TexDecoder_SetTexFmtOverlayOptions(bool enable, bool center) PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt,bool rgbaOnly) { - PC_TexFormat retval = TexDecoder_Decode_OpenCL(dst, src, - width, height, texformat, tlutaddr, tlutfmt, rgbaOnly); - if (retval == PC_TEX_FMT_NONE) - retval = rgbaOnly ? TexDecoder_Decode_RGBA((u32*)dst, src, - width, height, texformat, tlutaddr, tlutfmt) - : TexDecoder_Decode_real(dst, src, - width, height, texformat, tlutaddr, tlutfmt); + PC_TexFormat retval = rgbaOnly ? TexDecoder_Decode_RGBA((u32*)dst, src, + width, height, texformat, tlutaddr, tlutfmt) + : TexDecoder_Decode_real(dst, src, + width, height, texformat, tlutaddr, tlutfmt); - if ((!TexFmt_Overlay_Enable)|| (retval == PC_TEX_FMT_NONE)) + if ((!TexFmt_Overlay_Enable) || (retval == PC_TEX_FMT_NONE)) return retval; int w = min(width, 40); diff --git a/Source/Core/VideoCommon/Src/VideoConfig.cpp b/Source/Core/VideoCommon/Src/VideoConfig.cpp index 93840d7586..bd9fc015ac 100644 --- a/Source/Core/VideoCommon/Src/VideoConfig.cpp +++ b/Source/Core/VideoCommon/Src/VideoConfig.cpp @@ -81,7 +81,6 @@ void VideoConfig::Load(const char *ini_file) iniFile.Get("Settings", "WireFrame", &bWireFrame, 0); iniFile.Get("Settings", "DisableFog", &bDisableFog, 0); - iniFile.Get("Settings", "EnableOpenCL", &bEnableOpenCL, false); iniFile.Get("Settings", "OMPDecoder", &bOMPDecoder, false); iniFile.Get("Settings", "EnableShaderDebugging", &bEnableShaderDebugging, false); @@ -184,7 +183,6 @@ void VideoConfig::GameIniLoad() CHECK_SETTING("Video_Settings", "DstAlphaPass", bDstAlphaPass); CHECK_SETTING("Video_Settings", "DisableFog", bDisableFog); - CHECK_SETTING("Video_Settings", "EnableOpenCL", bEnableOpenCL); CHECK_SETTING("Video_Settings", "OMPDecoder", bOMPDecoder); CHECK_SETTING("Video_Enhancements", "ForceFiltering", bForceFiltering); @@ -265,7 +263,6 @@ void VideoConfig::Save(const char *ini_file) iniFile.Set("Settings", "DstAlphaPass", bDstAlphaPass); iniFile.Set("Settings", "DisableFog", bDisableFog); - iniFile.Set("Settings", "EnableOpenCL", bEnableOpenCL); iniFile.Set("Settings", "OMPDecoder", bOMPDecoder); iniFile.Set("Settings", "EnableShaderDebugging", bEnableShaderDebugging); diff --git a/Source/Core/VideoCommon/Src/VideoConfig.h b/Source/Core/VideoCommon/Src/VideoConfig.h index 4e597e6235..f53551d9a0 100644 --- a/Source/Core/VideoCommon/Src/VideoConfig.h +++ b/Source/Core/VideoCommon/Src/VideoConfig.h @@ -66,8 +66,7 @@ struct VideoConfig bool bUseXFB; bool bUseRealXFB; - // OpenCL/OpenMP - bool bEnableOpenCL; + // OpenMP bool bOMPDecoder; // Enhancements diff --git a/Source/Core/VideoCommon/VideoCommon.vcxproj b/Source/Core/VideoCommon/VideoCommon.vcxproj index 264159def0..c1df8c2810 100644 --- a/Source/Core/VideoCommon/VideoCommon.vcxproj +++ b/Source/Core/VideoCommon/VideoCommon.vcxproj @@ -63,8 +63,6 @@ - - @@ -116,8 +114,6 @@ - - @@ -149,9 +145,6 @@ - - {aa862e5e-a993-497a-b6a0-0e8e94b10050} - {4c9f135b-a85e-430c-bad4-4c67ef5fc12c} diff --git a/Source/Core/VideoCommon/VideoCommon.vcxproj.filters b/Source/Core/VideoCommon/VideoCommon.vcxproj.filters index 96503ba0e0..c0fefdf7b1 100644 --- a/Source/Core/VideoCommon/VideoCommon.vcxproj.filters +++ b/Source/Core/VideoCommon/VideoCommon.vcxproj.filters @@ -7,9 +7,6 @@ {2baa29c2-a528-4981-abcb-e0842c311f63} - - {f32547ad-f1c1-4e47-9ded-c07f66de2100} - {6a88e4a0-754c-43df-98e6-405c99cd2ca7} @@ -57,12 +54,6 @@ Base - - Decoding\OpenCL - - - Decoding\OpenCL - Decoding @@ -184,12 +175,6 @@ Base - - Decoding\OpenCL - - - Decoding\OpenCL - Decoding diff --git a/Source/VSProps/Base.props b/Source/VSProps/Base.props index 27268243e8..2f3ffa9a9f 100644 --- a/Source/VSProps/Base.props +++ b/Source/VSProps/Base.props @@ -43,7 +43,6 @@ $(CoreDir)VideoCommon\Src;%(AdditionalIncludeDirectories) $(ExternalsDir);%(AdditionalIncludeDirectories) $(ExternalsDir)Bochs_disasm;%(AdditionalIncludeDirectories) - $(ExternalsDir)CLRun\include;%(AdditionalIncludeDirectories) $(ExternalsDir)GLew\include;%(AdditionalIncludeDirectories) $(ExternalsDir)libpng;%(AdditionalIncludeDirectories) $(ExternalsDir)libusbx\libusb;%(AdditionalIncludeDirectories) @@ -120,4 +119,4 @@ - \ No newline at end of file + diff --git a/Source/dolphin-emu.sln b/Source/dolphin-emu.sln index 97618922dd..0012593492 100644 --- a/Source/dolphin-emu.sln +++ b/Source/dolphin-emu.sln @@ -45,8 +45,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SCMRevGen", "Core\Common\SC EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SFML_Network", "..\Externals\SFML\build\vc2010\SFML_Network.vcxproj", "{93D73454-2512-424E-9CDA-4BB357FE13DD}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CLRun", "..\Externals\CLRun\clrun\CLRun.vcxproj", "{AA862E5E-A993-497A-B6A0-0E8E94B10050}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-1.0", "..\Externals\libusbx\msvc\libusb_static_2013.vcxproj", "{349EE8F9-7D25-4909-AAF5-FF3FADE72187}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glew", "..\Externals\GLew\glew.vcxproj", "{2A3F751D-69E9-45F2-9199-9A00BFB6CC72}"