Don't treat clew as part of an "external" clcc module
There is no obvious authoritative upstream for clew anyway, so it causes
philosophical problems for distros. For a while, we used to use a zip archive
from the "clcc" project on SourceForge that included clew.c and
clew.h. (Before that we also just had clew.c and clew.h in our source repo.)
So, drop the external/clcc module and have clew.c and clew.h in the source
repo again. But this time clew is in a module of its own, not in sc.
This re-introduces "No need to have OpenCL optional at configure-time"
This reverts commit 764836cb00
.
Change-Id: I413142f4f9f8399489f9c3e5327132822f07a454
Reviewed-on: https://gerrit.libreoffice.org/13368
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
This commit is contained in:
committed by
David Tardon
parent
4517c94000
commit
bf6544c0ab
@@ -115,7 +115,6 @@ $(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR)
|
||||
$(call fetch_Optional,CAIRO,CAIRO_TARBALL) \
|
||||
$(call fetch_Optional,CAIRO,PIXMAN_TARBALL) \
|
||||
$(call fetch_Optional,CDR,CDR_TARBALL) \
|
||||
$(call fetch_Optional,CLCC,CLCC_TARBALL) \
|
||||
$(call fetch_Optional,CLUCENE,CLUCENE_TARBALL) \
|
||||
$(call fetch_Optional,CMIS,CMIS_TARBALL) \
|
||||
$(call fetch_Optional,COINMP,COINMP_TARBALL) \
|
||||
|
@@ -316,7 +316,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
|
||||
chartcore \
|
||||
chartcontroller \
|
||||
chartopengl \
|
||||
$(call gb_Helper_optional,CLCC,clew) \
|
||||
$(call gb_Helper_optional,OPENCL,clew) \
|
||||
$(if $(filter $(OS),WNT),,cmdmail) \
|
||||
cppcanvas \
|
||||
configmgr \
|
||||
|
@@ -279,17 +279,6 @@ endef
|
||||
|
||||
endif # SYSTEM_GLEW
|
||||
|
||||
define gb_LinkTarget__use_clew
|
||||
$(call gb_LinkTarget_set_include,$(1),\
|
||||
-I$(call gb_UnpackedTarball_get_dir,clcc)/src \
|
||||
$$(INCLUDE) \
|
||||
)
|
||||
$(call gb_LinkTarget_use_libraries,$(1),\
|
||||
clew \
|
||||
)
|
||||
|
||||
endef
|
||||
|
||||
define gb_LinkTarget__use_iconv
|
||||
$(call gb_LinkTarget_add_libs,$(1),-liconv)
|
||||
|
||||
|
@@ -26,6 +26,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
|
||||
bridges \
|
||||
canvas \
|
||||
chart2 \
|
||||
$(call gb_Helper_optional,OPENCL,clew) \
|
||||
cli_ure \
|
||||
$(call gb_Helper_optional,DESKTOP,codemaker) \
|
||||
comphelper \
|
||||
|
@@ -28,8 +28,8 @@ $(eval $(call gb_Library_add_libs,clew,\
|
||||
))
|
||||
endif
|
||||
|
||||
$(eval $(call gb_Library_add_generated_cobjects,clew,\
|
||||
UnpackedTarball/clcc/src/clew \
|
||||
$(eval $(call gb_Library_add_cobjects,clew,\
|
||||
clew/source/clew \
|
||||
))
|
||||
|
||||
# vim: set noet sw=4 ts=4:
|
@@ -2,6 +2,6 @@
|
||||
|
||||
module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
include $(module_directory)/../../solenv/gbuild/partial_build.mk
|
||||
include $(module_directory)/../solenv/gbuild/partial_build.mk
|
||||
|
||||
# vim: set noet sw=4 ts=4:
|
@@ -7,11 +7,10 @@
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
#
|
||||
|
||||
$(eval $(call gb_Module_Module,clcc))
|
||||
$(eval $(call gb_Module_Module,clew))
|
||||
|
||||
$(eval $(call gb_Module_add_targets,clcc,\
|
||||
$(eval $(call gb_Module_add_targets,clew,\
|
||||
Library_clew \
|
||||
UnpackedTarball_clcc \
|
||||
))
|
||||
|
||||
# vim: set noet sw=4 ts=4:
|
326
clew/source/clew.c
Normal file
326
clew/source/clew.c
Normal file
@@ -0,0 +1,326 @@
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (c) 2009-2011 Organic Vectory B.V.
|
||||
// Written by George van Venrooij
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file license.txt)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "clew/clew.h"
|
||||
|
||||
//! \file clew.c
|
||||
//! \brief OpenCL run-time loader source
|
||||
|
||||
#ifndef CLCC_GENERATE_DOCUMENTATION
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define VC_EXTRALEAN
|
||||
#include <windows.h>
|
||||
|
||||
typedef HMODULE CLCC_DYNLIB_HANDLE;
|
||||
|
||||
#define CLCC_DYNLIB_OPEN LoadLibrary
|
||||
#define CLCC_DYNLIB_CLOSE FreeLibrary
|
||||
#define CLCC_DYNLIB_IMPORT GetProcAddress
|
||||
#else
|
||||
#include <dlfcn.h>
|
||||
|
||||
typedef void* CLCC_DYNLIB_HANDLE;
|
||||
|
||||
#define CLCC_DYNLIB_OPEN(path) dlopen(path, RTLD_NOW | RTLD_GLOBAL)
|
||||
#define CLCC_DYNLIB_CLOSE dlclose
|
||||
#define CLCC_DYNLIB_IMPORT dlsym
|
||||
#endif
|
||||
#else
|
||||
//typedef implementation_defined CLCC_DYNLIB_HANDLE;
|
||||
//#define CLCC_DYNLIB_OPEN(path) implementation_defined
|
||||
//#define CLCC_DYNLIB_CLOSE implementation_defined
|
||||
//#define CLCC_DYNLIB_IMPORT implementation_defined
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
//! \brief module handle
|
||||
static CLCC_DYNLIB_HANDLE module = NULL;
|
||||
|
||||
// Variables holding function entry points
|
||||
#ifndef CLCC_GENERATE_DOCUMENTATION
|
||||
PFNCLGETPLATFORMIDS __clewGetPlatformIDs = NULL;
|
||||
PFNCLGETPLATFORMINFO __clewGetPlatformInfo = NULL;
|
||||
PFNCLGETDEVICEIDS __clewGetDeviceIDs = NULL;
|
||||
PFNCLGETDEVICEINFO __clewGetDeviceInfo = NULL;
|
||||
PFNCLCREATECONTEXT __clewCreateContext = NULL;
|
||||
PFNCLCREATECONTEXTFROMTYPE __clewCreateContextFromType = NULL;
|
||||
PFNCLRETAINCONTEXT __clewRetainContext = NULL;
|
||||
PFNCLRELEASECONTEXT __clewReleaseContext = NULL;
|
||||
PFNCLGETCONTEXTINFO __clewGetContextInfo = NULL;
|
||||
PFNCLCREATECOMMANDQUEUE __clewCreateCommandQueue = NULL;
|
||||
PFNCLRETAINCOMMANDQUEUE __clewRetainCommandQueue = NULL;
|
||||
PFNCLRELEASECOMMANDQUEUE __clewReleaseCommandQueue = NULL;
|
||||
PFNCLGETCOMMANDQUEUEINFO __clewGetCommandQueueInfo = NULL;
|
||||
PFNCLSETCOMMANDQUEUEPROPERTY __clewSetCommandQueueProperty = NULL;
|
||||
PFNCLCREATEBUFFER __clewCreateBuffer = NULL;
|
||||
PFNCLCREATEIMAGE2D __clewCreateImage2D = NULL;
|
||||
PFNCLCREATEIMAGE3D __clewCreateImage3D = NULL;
|
||||
PFNCLRETAINMEMOBJECT __clewRetainMemObject = NULL;
|
||||
PFNCLRELEASEMEMOBJECT __clewReleaseMemObject = NULL;
|
||||
PFNCLGETSUPPORTEDIMAGEFORMATS __clewGetSupportedImageFormats = NULL;
|
||||
PFNCLGETMEMOBJECTINFO __clewGetMemObjectInfo = NULL;
|
||||
PFNCLGETIMAGEINFO __clewGetImageInfo = NULL;
|
||||
PFNCLCREATESAMPLER __clewCreateSampler = NULL;
|
||||
PFNCLRETAINSAMPLER __clewRetainSampler = NULL;
|
||||
PFNCLRELEASESAMPLER __clewReleaseSampler = NULL;
|
||||
PFNCLGETSAMPLERINFO __clewGetSamplerInfo = NULL;
|
||||
PFNCLCREATEPROGRAMWITHSOURCE __clewCreateProgramWithSource = NULL;
|
||||
PFNCLCREATEPROGRAMWITHBINARY __clewCreateProgramWithBinary = NULL;
|
||||
PFNCLRETAINPROGRAM __clewRetainProgram = NULL;
|
||||
PFNCLRELEASEPROGRAM __clewReleaseProgram = NULL;
|
||||
PFNCLBUILDPROGRAM __clewBuildProgram = NULL;
|
||||
PFNCLUNLOADCOMPILER __clewUnloadCompiler = NULL;
|
||||
PFNCLGETPROGRAMINFO __clewGetProgramInfo = NULL;
|
||||
PFNCLGETPROGRAMBUILDINFO __clewGetProgramBuildInfo = NULL;
|
||||
PFNCLCREATEKERNEL __clewCreateKernel = NULL;
|
||||
PFNCLCREATEKERNELSINPROGRAM __clewCreateKernelsInProgram = NULL;
|
||||
PFNCLRETAINKERNEL __clewRetainKernel = NULL;
|
||||
PFNCLRELEASEKERNEL __clewReleaseKernel = NULL;
|
||||
PFNCLSETKERNELARG __clewSetKernelArg = NULL;
|
||||
PFNCLGETKERNELINFO __clewGetKernelInfo = NULL;
|
||||
PFNCLGETKERNELWORKGROUPINFO __clewGetKernelWorkGroupInfo = NULL;
|
||||
PFNCLWAITFOREVENTS __clewWaitForEvents = NULL;
|
||||
PFNCLGETEVENTINFO __clewGetEventInfo = NULL;
|
||||
PFNCLRETAINEVENT __clewRetainEvent = NULL;
|
||||
PFNCLRELEASEEVENT __clewReleaseEvent = NULL;
|
||||
PFNCLGETEVENTPROFILINGINFO __clewGetEventProfilingInfo = NULL;
|
||||
PFNCLFLUSH __clewFlush = NULL;
|
||||
PFNCLFINISH __clewFinish = NULL;
|
||||
PFNCLENQUEUEREADBUFFER __clewEnqueueReadBuffer = NULL;
|
||||
PFNCLENQUEUEWRITEBUFFER __clewEnqueueWriteBuffer = NULL;
|
||||
PFNCLENQUEUECOPYBUFFER __clewEnqueueCopyBuffer = NULL;
|
||||
PFNCLENQUEUEREADIMAGE __clewEnqueueReadImage = NULL;
|
||||
PFNCLENQUEUEWRITEIMAGE __clewEnqueueWriteImage = NULL;
|
||||
PFNCLENQUEUECOPYIMAGE __clewEnqueueCopyImage = NULL;
|
||||
PFNCLENQUEUECOPYIMAGETOBUFFER __clewEnqueueCopyImageToBuffer = NULL;
|
||||
PFNCLENQUEUECOPYBUFFERTOIMAGE __clewEnqueueCopyBufferToImage = NULL;
|
||||
PFNCLENQUEUEMAPBUFFER __clewEnqueueMapBuffer = NULL;
|
||||
PFNCLENQUEUEMAPIMAGE __clewEnqueueMapImage = NULL;
|
||||
PFNCLENQUEUEUNMAPMEMOBJECT __clewEnqueueUnmapMemObject = NULL;
|
||||
PFNCLENQUEUENDRANGEKERNEL __clewEnqueueNDRangeKernel = NULL;
|
||||
PFNCLENQUEUETASK __clewEnqueueTask = NULL;
|
||||
PFNCLENQUEUENATIVEKERNEL __clewEnqueueNativeKernel = NULL;
|
||||
PFNCLENQUEUEMARKER __clewEnqueueMarker = NULL;
|
||||
PFNCLENQUEUEWAITFOREVENTS __clewEnqueueWaitForEvents = NULL;
|
||||
PFNCLENQUEUEBARRIER __clewEnqueueBarrier = NULL;
|
||||
PFNCLGETEXTENSIONFUNCTIONADDRESS __clewGetExtensionFunctionAddress = NULL;
|
||||
#endif // CLCC_GENERATE_DOCUMENTATION
|
||||
|
||||
|
||||
//! \brief Unloads OpenCL dynamic library, should not be called directly
|
||||
static void clewExit(void)
|
||||
{
|
||||
if (module != NULL)
|
||||
{
|
||||
// Ignore errors
|
||||
CLCC_DYNLIB_CLOSE(module);
|
||||
module = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#define CLEW_CHECK_FUNCTION(f) \
|
||||
if ((f) == NULL) \
|
||||
{ \
|
||||
CLCC_DYNLIB_CLOSE(module); \
|
||||
module = NULL; \
|
||||
return CLEW_ERROR_IMPORT_FAILED; \
|
||||
} \
|
||||
|
||||
//! \param path path to dynamic library to load
|
||||
//! \return CLEW_ERROR_OPEN_FAILED if the library could not be opened
|
||||
//! CLEW_ERROR_ATEXIT_FAILED if atexit(clewExit) failed
|
||||
//! CLEW_SUCCESS when the library was succesfully loaded
|
||||
int clewInit(const char* path)
|
||||
{
|
||||
int error = 0;
|
||||
|
||||
// Check if already initialized
|
||||
if (module != NULL)
|
||||
{
|
||||
return CLEW_SUCCESS;
|
||||
}
|
||||
|
||||
// Load library
|
||||
module = CLCC_DYNLIB_OPEN(path);
|
||||
|
||||
// Check for errors
|
||||
if (module == NULL)
|
||||
{
|
||||
return CLEW_ERROR_OPEN_FAILED;
|
||||
}
|
||||
|
||||
// Set unloading
|
||||
error = atexit(clewExit);
|
||||
|
||||
if (error)
|
||||
{
|
||||
// Failure queing atexit, shutdown with error
|
||||
CLCC_DYNLIB_CLOSE(module);
|
||||
module = NULL;
|
||||
|
||||
return CLEW_ERROR_ATEXIT_FAILED;
|
||||
}
|
||||
|
||||
// Determine function entry-points
|
||||
CLEW_CHECK_FUNCTION(__clewGetPlatformIDs = (PFNCLGETPLATFORMIDS )CLCC_DYNLIB_IMPORT(module, "clGetPlatformIDs"));
|
||||
CLEW_CHECK_FUNCTION(__clewGetPlatformInfo = (PFNCLGETPLATFORMINFO )CLCC_DYNLIB_IMPORT(module, "clGetPlatformInfo"));
|
||||
CLEW_CHECK_FUNCTION(__clewGetDeviceIDs = (PFNCLGETDEVICEIDS )CLCC_DYNLIB_IMPORT(module, "clGetDeviceIDs"));
|
||||
CLEW_CHECK_FUNCTION(__clewGetDeviceInfo = (PFNCLGETDEVICEINFO )CLCC_DYNLIB_IMPORT(module, "clGetDeviceInfo"));
|
||||
CLEW_CHECK_FUNCTION(__clewCreateContext = (PFNCLCREATECONTEXT )CLCC_DYNLIB_IMPORT(module, "clCreateContext"));
|
||||
CLEW_CHECK_FUNCTION(__clewCreateContextFromType = (PFNCLCREATECONTEXTFROMTYPE )CLCC_DYNLIB_IMPORT(module, "clCreateContextFromType"));
|
||||
CLEW_CHECK_FUNCTION(__clewRetainContext = (PFNCLRETAINCONTEXT )CLCC_DYNLIB_IMPORT(module, "clRetainContext"));
|
||||
CLEW_CHECK_FUNCTION(__clewReleaseContext = (PFNCLRELEASECONTEXT )CLCC_DYNLIB_IMPORT(module, "clReleaseContext"));
|
||||
CLEW_CHECK_FUNCTION(__clewGetContextInfo = (PFNCLGETCONTEXTINFO )CLCC_DYNLIB_IMPORT(module, "clGetContextInfo"));
|
||||
CLEW_CHECK_FUNCTION(__clewCreateCommandQueue = (PFNCLCREATECOMMANDQUEUE )CLCC_DYNLIB_IMPORT(module, "clCreateCommandQueue"));
|
||||
CLEW_CHECK_FUNCTION(__clewRetainCommandQueue = (PFNCLRETAINCOMMANDQUEUE )CLCC_DYNLIB_IMPORT(module, "clRetainCommandQueue"));
|
||||
CLEW_CHECK_FUNCTION(__clewReleaseCommandQueue = (PFNCLRELEASECOMMANDQUEUE )CLCC_DYNLIB_IMPORT(module, "clReleaseCommandQueue"));
|
||||
CLEW_CHECK_FUNCTION(__clewGetCommandQueueInfo = (PFNCLGETCOMMANDQUEUEINFO )CLCC_DYNLIB_IMPORT(module, "clGetCommandQueueInfo"));
|
||||
CLEW_CHECK_FUNCTION(__clewSetCommandQueueProperty = (PFNCLSETCOMMANDQUEUEPROPERTY )CLCC_DYNLIB_IMPORT(module, "clSetCommandQueueProperty"));
|
||||
CLEW_CHECK_FUNCTION(__clewCreateBuffer = (PFNCLCREATEBUFFER )CLCC_DYNLIB_IMPORT(module, "clCreateBuffer"));
|
||||
CLEW_CHECK_FUNCTION(__clewCreateImage2D = (PFNCLCREATEIMAGE2D )CLCC_DYNLIB_IMPORT(module, "clCreateImage2D"));
|
||||
CLEW_CHECK_FUNCTION(__clewCreateImage3D = (PFNCLCREATEIMAGE3D )CLCC_DYNLIB_IMPORT(module, "clCreateImage3D"));
|
||||
CLEW_CHECK_FUNCTION(__clewRetainMemObject = (PFNCLRETAINMEMOBJECT )CLCC_DYNLIB_IMPORT(module, "clRetainMemObject"));
|
||||
CLEW_CHECK_FUNCTION(__clewReleaseMemObject = (PFNCLRELEASEMEMOBJECT )CLCC_DYNLIB_IMPORT(module, "clReleaseMemObject"));
|
||||
CLEW_CHECK_FUNCTION(__clewGetSupportedImageFormats = (PFNCLGETSUPPORTEDIMAGEFORMATS )CLCC_DYNLIB_IMPORT(module, "clGetSupportedImageFormats"));
|
||||
CLEW_CHECK_FUNCTION(__clewGetMemObjectInfo = (PFNCLGETMEMOBJECTINFO )CLCC_DYNLIB_IMPORT(module, "clGetMemObjectInfo"));
|
||||
CLEW_CHECK_FUNCTION(__clewGetImageInfo = (PFNCLGETIMAGEINFO )CLCC_DYNLIB_IMPORT(module, "clGetImageInfo"));
|
||||
CLEW_CHECK_FUNCTION(__clewCreateSampler = (PFNCLCREATESAMPLER )CLCC_DYNLIB_IMPORT(module, "clCreateSampler"));
|
||||
CLEW_CHECK_FUNCTION(__clewRetainSampler = (PFNCLRETAINSAMPLER )CLCC_DYNLIB_IMPORT(module, "clRetainSampler"));
|
||||
CLEW_CHECK_FUNCTION(__clewReleaseSampler = (PFNCLRELEASESAMPLER )CLCC_DYNLIB_IMPORT(module, "clReleaseSampler"));
|
||||
CLEW_CHECK_FUNCTION(__clewGetSamplerInfo = (PFNCLGETSAMPLERINFO )CLCC_DYNLIB_IMPORT(module, "clGetSamplerInfo"));
|
||||
CLEW_CHECK_FUNCTION(__clewCreateProgramWithSource = (PFNCLCREATEPROGRAMWITHSOURCE )CLCC_DYNLIB_IMPORT(module, "clCreateProgramWithSource"));
|
||||
CLEW_CHECK_FUNCTION(__clewCreateProgramWithBinary = (PFNCLCREATEPROGRAMWITHBINARY )CLCC_DYNLIB_IMPORT(module, "clCreateProgramWithBinary"));
|
||||
CLEW_CHECK_FUNCTION(__clewRetainProgram = (PFNCLRETAINPROGRAM )CLCC_DYNLIB_IMPORT(module, "clRetainProgram"));
|
||||
CLEW_CHECK_FUNCTION(__clewReleaseProgram = (PFNCLRELEASEPROGRAM )CLCC_DYNLIB_IMPORT(module, "clReleaseProgram"));
|
||||
CLEW_CHECK_FUNCTION(__clewBuildProgram = (PFNCLBUILDPROGRAM )CLCC_DYNLIB_IMPORT(module, "clBuildProgram"));
|
||||
CLEW_CHECK_FUNCTION(__clewUnloadCompiler = (PFNCLUNLOADCOMPILER )CLCC_DYNLIB_IMPORT(module, "clUnloadCompiler"));
|
||||
CLEW_CHECK_FUNCTION(__clewGetProgramInfo = (PFNCLGETPROGRAMINFO )CLCC_DYNLIB_IMPORT(module, "clGetProgramInfo"));
|
||||
CLEW_CHECK_FUNCTION(__clewGetProgramBuildInfo = (PFNCLGETPROGRAMBUILDINFO )CLCC_DYNLIB_IMPORT(module, "clGetProgramBuildInfo"));
|
||||
CLEW_CHECK_FUNCTION(__clewCreateKernel = (PFNCLCREATEKERNEL )CLCC_DYNLIB_IMPORT(module, "clCreateKernel"));
|
||||
CLEW_CHECK_FUNCTION(__clewCreateKernelsInProgram = (PFNCLCREATEKERNELSINPROGRAM )CLCC_DYNLIB_IMPORT(module, "clCreateKernelsInProgram"));
|
||||
CLEW_CHECK_FUNCTION(__clewRetainKernel = (PFNCLRETAINKERNEL )CLCC_DYNLIB_IMPORT(module, "clRetainKernel"));
|
||||
CLEW_CHECK_FUNCTION(__clewReleaseKernel = (PFNCLRELEASEKERNEL )CLCC_DYNLIB_IMPORT(module, "clReleaseKernel"));
|
||||
CLEW_CHECK_FUNCTION(__clewSetKernelArg = (PFNCLSETKERNELARG )CLCC_DYNLIB_IMPORT(module, "clSetKernelArg"));
|
||||
CLEW_CHECK_FUNCTION(__clewGetKernelInfo = (PFNCLGETKERNELINFO )CLCC_DYNLIB_IMPORT(module, "clGetKernelInfo"));
|
||||
CLEW_CHECK_FUNCTION(__clewGetKernelWorkGroupInfo = (PFNCLGETKERNELWORKGROUPINFO )CLCC_DYNLIB_IMPORT(module, "clGetKernelWorkGroupInfo"));
|
||||
CLEW_CHECK_FUNCTION(__clewWaitForEvents = (PFNCLWAITFOREVENTS )CLCC_DYNLIB_IMPORT(module, "clWaitForEvents"));
|
||||
CLEW_CHECK_FUNCTION(__clewGetEventInfo = (PFNCLGETEVENTINFO )CLCC_DYNLIB_IMPORT(module, "clGetEventInfo"));
|
||||
CLEW_CHECK_FUNCTION(__clewRetainEvent = (PFNCLRETAINEVENT )CLCC_DYNLIB_IMPORT(module, "clRetainEvent"));
|
||||
CLEW_CHECK_FUNCTION(__clewReleaseEvent = (PFNCLRELEASEEVENT )CLCC_DYNLIB_IMPORT(module, "clReleaseEvent"));
|
||||
CLEW_CHECK_FUNCTION(__clewGetEventProfilingInfo = (PFNCLGETEVENTPROFILINGINFO )CLCC_DYNLIB_IMPORT(module, "clGetEventProfilingInfo"));
|
||||
CLEW_CHECK_FUNCTION(__clewFlush = (PFNCLFLUSH )CLCC_DYNLIB_IMPORT(module, "clFlush"));
|
||||
CLEW_CHECK_FUNCTION(__clewFinish = (PFNCLFINISH )CLCC_DYNLIB_IMPORT(module, "clFinish"));
|
||||
CLEW_CHECK_FUNCTION(__clewEnqueueReadBuffer = (PFNCLENQUEUEREADBUFFER )CLCC_DYNLIB_IMPORT(module, "clEnqueueReadBuffer"));
|
||||
CLEW_CHECK_FUNCTION(__clewEnqueueWriteBuffer = (PFNCLENQUEUEWRITEBUFFER )CLCC_DYNLIB_IMPORT(module, "clEnqueueWriteBuffer"));
|
||||
CLEW_CHECK_FUNCTION(__clewEnqueueCopyBuffer = (PFNCLENQUEUECOPYBUFFER )CLCC_DYNLIB_IMPORT(module, "clEnqueueCopyBuffer"));
|
||||
CLEW_CHECK_FUNCTION(__clewEnqueueReadImage = (PFNCLENQUEUEREADIMAGE )CLCC_DYNLIB_IMPORT(module, "clEnqueueReadImage"));
|
||||
CLEW_CHECK_FUNCTION(__clewEnqueueWriteImage = (PFNCLENQUEUEWRITEIMAGE )CLCC_DYNLIB_IMPORT(module, "clEnqueueWriteImage"));
|
||||
CLEW_CHECK_FUNCTION(__clewEnqueueCopyImage = (PFNCLENQUEUECOPYIMAGE )CLCC_DYNLIB_IMPORT(module, "clEnqueueCopyImage"));
|
||||
CLEW_CHECK_FUNCTION(__clewEnqueueCopyImageToBuffer = (PFNCLENQUEUECOPYIMAGETOBUFFER )CLCC_DYNLIB_IMPORT(module, "clEnqueueCopyImageToBuffer"));
|
||||
CLEW_CHECK_FUNCTION(__clewEnqueueCopyBufferToImage = (PFNCLENQUEUECOPYBUFFERTOIMAGE )CLCC_DYNLIB_IMPORT(module, "clEnqueueCopyBufferToImage"));
|
||||
CLEW_CHECK_FUNCTION(__clewEnqueueMapBuffer = (PFNCLENQUEUEMAPBUFFER )CLCC_DYNLIB_IMPORT(module, "clEnqueueMapBuffer"));
|
||||
CLEW_CHECK_FUNCTION(__clewEnqueueMapImage = (PFNCLENQUEUEMAPIMAGE )CLCC_DYNLIB_IMPORT(module, "clEnqueueMapImage"));
|
||||
CLEW_CHECK_FUNCTION(__clewEnqueueUnmapMemObject = (PFNCLENQUEUEUNMAPMEMOBJECT )CLCC_DYNLIB_IMPORT(module, "clEnqueueUnmapMemObject"));
|
||||
CLEW_CHECK_FUNCTION(__clewEnqueueNDRangeKernel = (PFNCLENQUEUENDRANGEKERNEL )CLCC_DYNLIB_IMPORT(module, "clEnqueueNDRangeKernel"));
|
||||
CLEW_CHECK_FUNCTION(__clewEnqueueTask = (PFNCLENQUEUETASK )CLCC_DYNLIB_IMPORT(module, "clEnqueueTask"));
|
||||
CLEW_CHECK_FUNCTION(__clewEnqueueNativeKernel = (PFNCLENQUEUENATIVEKERNEL )CLCC_DYNLIB_IMPORT(module, "clEnqueueNativeKernel"));
|
||||
CLEW_CHECK_FUNCTION(__clewEnqueueMarker = (PFNCLENQUEUEMARKER )CLCC_DYNLIB_IMPORT(module, "clEnqueueMarker"));
|
||||
CLEW_CHECK_FUNCTION(__clewEnqueueWaitForEvents = (PFNCLENQUEUEWAITFOREVENTS )CLCC_DYNLIB_IMPORT(module, "clEnqueueWaitForEvents"));
|
||||
CLEW_CHECK_FUNCTION(__clewEnqueueBarrier = (PFNCLENQUEUEBARRIER )CLCC_DYNLIB_IMPORT(module, "clEnqueueBarrier"));
|
||||
CLEW_CHECK_FUNCTION(__clewGetExtensionFunctionAddress = (PFNCLGETEXTENSIONFUNCTIONADDRESS )CLCC_DYNLIB_IMPORT(module, "clGetExtensionFunctionAddress"));
|
||||
|
||||
return CLEW_SUCCESS;
|
||||
}
|
||||
|
||||
//! \param error CL error code
|
||||
//! \return a string representation of the error code
|
||||
const char* clewErrorString(cl_int error)
|
||||
{
|
||||
static const char* strings[] =
|
||||
{
|
||||
// Error Codes
|
||||
"CL_SUCCESS" // 0
|
||||
, "CL_DEVICE_NOT_FOUND" // -1
|
||||
, "CL_DEVICE_NOT_AVAILABLE" // -2
|
||||
, "CL_COMPILER_NOT_AVAILABLE" // -3
|
||||
, "CL_MEM_OBJECT_ALLOCATION_FAILURE" // -4
|
||||
, "CL_OUT_OF_RESOURCES" // -5
|
||||
, "CL_OUT_OF_HOST_MEMORY" // -6
|
||||
, "CL_PROFILING_INFO_NOT_AVAILABLE" // -7
|
||||
, "CL_MEM_COPY_OVERLAP" // -8
|
||||
, "CL_IMAGE_FORMAT_MISMATCH" // -9
|
||||
, "CL_IMAGE_FORMAT_NOT_SUPPORTED" // -10
|
||||
, "CL_BUILD_PROGRAM_FAILURE" // -11
|
||||
, "CL_MAP_FAILURE" // -12
|
||||
|
||||
, "" // -13
|
||||
, "" // -14
|
||||
, "" // -15
|
||||
, "" // -16
|
||||
, "" // -17
|
||||
, "" // -18
|
||||
, "" // -19
|
||||
|
||||
, "" // -20
|
||||
, "" // -21
|
||||
, "" // -22
|
||||
, "" // -23
|
||||
, "" // -24
|
||||
, "" // -25
|
||||
, "" // -26
|
||||
, "" // -27
|
||||
, "" // -28
|
||||
, "" // -29
|
||||
|
||||
, "CL_INVALID_VALUE" // -30
|
||||
, "CL_INVALID_DEVICE_TYPE" // -31
|
||||
, "CL_INVALID_PLATFORM" // -32
|
||||
, "CL_INVALID_DEVICE" // -33
|
||||
, "CL_INVALID_CONTEXT" // -34
|
||||
, "CL_INVALID_QUEUE_PROPERTIES" // -35
|
||||
, "CL_INVALID_COMMAND_QUEUE" // -36
|
||||
, "CL_INVALID_HOST_PTR" // -37
|
||||
, "CL_INVALID_MEM_OBJECT" // -38
|
||||
, "CL_INVALID_IMAGE_FORMAT_DESCRIPTOR" // -39
|
||||
, "CL_INVALID_IMAGE_SIZE" // -40
|
||||
, "CL_INVALID_SAMPLER" // -41
|
||||
, "CL_INVALID_BINARY" // -42
|
||||
, "CL_INVALID_BUILD_OPTIONS" // -43
|
||||
, "CL_INVALID_PROGRAM" // -44
|
||||
, "CL_INVALID_PROGRAM_EXECUTABLE" // -45
|
||||
, "CL_INVALID_KERNEL_NAME" // -46
|
||||
, "CL_INVALID_KERNEL_DEFINITION" // -47
|
||||
, "CL_INVALID_KERNEL" // -48
|
||||
, "CL_INVALID_ARG_INDEX" // -49
|
||||
, "CL_INVALID_ARG_VALUE" // -50
|
||||
, "CL_INVALID_ARG_SIZE" // -51
|
||||
, "CL_INVALID_KERNEL_ARGS" // -52
|
||||
, "CL_INVALID_WORK_DIMENSION" // -53
|
||||
, "CL_INVALID_WORK_GROUP_SIZE" // -54
|
||||
, "CL_INVALID_WORK_ITEM_SIZE" // -55
|
||||
, "CL_INVALID_GLOBAL_OFFSET" // -56
|
||||
, "CL_INVALID_EVENT_WAIT_LIST" // -57
|
||||
, "CL_INVALID_EVENT" // -58
|
||||
, "CL_INVALID_OPERATION" // -59
|
||||
, "CL_INVALID_GL_OBJECT" // -60
|
||||
, "CL_INVALID_BUFFER_SIZE" // -61
|
||||
, "CL_INVALID_MIP_LEVEL" // -62
|
||||
, "CL_INVALID_GLOBAL_WORK_SIZE" // -63
|
||||
};
|
||||
|
||||
if ( (error > 0)
|
||||
|| (error < -63)
|
||||
)
|
||||
{
|
||||
return "unknown error code (no OpenCL driver?)";
|
||||
}
|
||||
|
||||
return strings[-error];
|
||||
}
|
19
configure.ac
19
configure.ac
@@ -1096,10 +1096,6 @@ AC_ARG_ENABLE(cairo-canvas,
|
||||
platforms where Cairo is available.
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE(opencl,
|
||||
AS_HELP_STRING([--disable-opencl],
|
||||
[Determines whether to build with OpenCL support.]))
|
||||
|
||||
AC_ARG_ENABLE(dbus,
|
||||
AS_HELP_STRING([--disable-dbus],
|
||||
[Determines whether to enable features that depend on dbus.
|
||||
@@ -10267,21 +10263,12 @@ dnl =================================================
|
||||
dnl Check whether to build with OpenCL support.
|
||||
dnl =================================================
|
||||
|
||||
AC_MSG_CHECKING([whether to build with the OpenCL support.])
|
||||
ENABLE_OPENCL=
|
||||
|
||||
if test $_os != iOS -a $_os != Android -a "x$enable_opencl" != "xno"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
# CLCC in BUILD_TYPE tells that we are building a bundled clcc (just the clew part), OPENCL in
|
||||
# BUILD_TYPE tells that OpenCL is potentially available on the platform (optional at run-time,
|
||||
if test $_os != iOS -a $_os != Android; then
|
||||
# OPENCL in BUILD_TYPE tells that OpenCL is potentially available on the platform (optional at run-time,
|
||||
# used through clew).
|
||||
BUILD_TYPE="$BUILD_TYPE CLCC OPENCL"
|
||||
ENABLE_OPENCL=TRUE
|
||||
BUILD_TYPE="$BUILD_TYPE OPENCL"
|
||||
AC_DEFINE(HAVE_FEATURE_OPENCL)
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
AC_SUBST(ENABLE_OPENCL)
|
||||
|
||||
dnl ===================================================================
|
||||
dnl Check whether to enable glTF support
|
||||
|
@@ -34,6 +34,8 @@ $(eval $(call gb_Library_use_sdk_api,cui))
|
||||
$(eval $(call gb_Library_use_libraries,cui,\
|
||||
$(call gb_Helper_optional,AVMEDIA,avmedia) \
|
||||
basegfx \
|
||||
$(call gb_Helper_optional,OPENCL,\
|
||||
clew) \
|
||||
comphelper \
|
||||
cppu \
|
||||
cppuhelper \
|
||||
@@ -66,8 +68,6 @@ $(eval $(call gb_Library_use_libraries,cui,\
|
||||
|
||||
$(eval $(call gb_Library_use_externals,cui,\
|
||||
boost_headers \
|
||||
$(call gb_Helper_optional,OPENCL,\
|
||||
clew) \
|
||||
icuuc \
|
||||
icu_headers \
|
||||
))
|
||||
|
@@ -20,8 +20,6 @@ export BSH_TARBALL := ea570af93c284aa9e5621cd563f54f4d-bsh-2.0b1-src.tar.gz
|
||||
export CAIRO_TARBALL := f101a9e88b783337b20b2e26dfd26d5f-cairo-1.10.2.tar.gz
|
||||
export CDR_MD5SUM := b33fd0be3befdd1b37777e08ce058bd9
|
||||
export CDR_TARBALL := libcdr-0.1.1.tar.bz2
|
||||
export CLCC_TARBALL := clcc-0.3.0-25-src.zip
|
||||
export CLCC_MD5SUM := 7ec003cc775d1cd06e789fb054c1d695
|
||||
export CLUCENE_TARBALL := 48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz
|
||||
export CMIS_TARBALL := 22f8a85daf4a012180322e1f52a7563b-libcmis-0.4.1.tar.gz
|
||||
export COINMP_MD5SUM := 1cce53bf4b40ae29790d2c5c9f8b1129
|
||||
|
1
external/Module_external.mk
vendored
1
external/Module_external.mk
vendored
@@ -27,7 +27,6 @@ $(eval $(call gb_Module_add_moduledirs,external,\
|
||||
$(call gb_Helper_optional,BSH,beanshell) \
|
||||
$(call gb_Helper_optional,CAIRO,cairo) \
|
||||
$(call gb_Helper_optional,CDR,libcdr) \
|
||||
$(call gb_Helper_optional,CLCC,clcc) \
|
||||
$(call gb_Helper_optional,CLUCENE,clucene) \
|
||||
$(call gb_Helper_optional,CMIS,libcmis) \
|
||||
$(call gb_Helper_optional,COINMP,coinmp) \
|
||||
|
25
external/clcc/UnpackedTarball_clcc.mk
vendored
25
external/clcc/UnpackedTarball_clcc.mk
vendored
@@ -1,25 +0,0 @@
|
||||
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
|
||||
#
|
||||
# This file is part of the LibreOffice project.
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
#
|
||||
|
||||
$(eval $(call gb_UnpackedTarball_UnpackedTarball,clcc))
|
||||
|
||||
$(eval $(call gb_UnpackedTarball_set_tarball,clcc,$(CLCC_TARBALL),0))
|
||||
|
||||
$(eval $(call gb_UnpackedTarball_set_patchlevel,clcc,0))
|
||||
|
||||
$(eval $(call gb_UnpackedTarball_fix_end_of_line,clcc,\
|
||||
src/clew.c \
|
||||
src/clew.h \
|
||||
))
|
||||
|
||||
$(eval $(call gb_UnpackedTarball_add_patches,clcc,\
|
||||
external/clcc/clew-non-static.patch \
|
||||
))
|
||||
|
||||
# vim: set noet sw=4 ts=4:
|
52
external/clcc/clew-non-static.patch
vendored
52
external/clcc/clew-non-static.patch
vendored
@@ -1,52 +0,0 @@
|
||||
--- src/clew.h
|
||||
+++ src/clew.h
|
||||
@@ -1141,25 +1141,28 @@
|
||||
// calling the returned function address.
|
||||
//
|
||||
typedef CL_API_ENTRY void * (CL_API_CALL * PFNCLGETEXTENSIONFUNCTIONADDRESS)(const char * /* func_name */) CL_API_SUFFIX__VERSION_1_0;
|
||||
-
|
||||
-
|
||||
-#define CLEW_STATIC
|
||||
|
||||
#ifdef CLEW_STATIC
|
||||
# define CLEWAPI extern
|
||||
#else
|
||||
# ifdef CLEW_BUILD
|
||||
-# define CLEWAPI extern __declspec(dllexport)
|
||||
+# if defined(_WIN32)
|
||||
+# define CLEWAPI extern __declspec(dllexport)
|
||||
+# elif defined(HAVE_GCC_VISIBILITY_FEATURE)
|
||||
+# define CLEWAPI extern __attribute__ ((visibility("default")))
|
||||
+# else
|
||||
+# define CLEWAPI extern
|
||||
+# endif
|
||||
# else
|
||||
-# define CLEWAPI extern __declspec(dllimport)
|
||||
+# if defined(_WIN32)
|
||||
+# define CLEWAPI extern __declspec(dllimport)
|
||||
+# else
|
||||
+# define CLEWAPI extern
|
||||
+# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
-#if defined(_WIN32)
|
||||
-#define CLEW_FUN_EXPORT extern
|
||||
-#else
|
||||
#define CLEW_FUN_EXPORT CLEWAPI
|
||||
-#endif
|
||||
|
||||
#define CLEW_GET_FUN(x) x
|
||||
|
||||
@@ -1305,9 +1305,9 @@
|
||||
#define CLEW_ERROR_IMPORT_FAILED -3 //!< Error code for failing to import a named function from the dll
|
||||
|
||||
//! \brief Load OpenCL dynamic library and set function entry points
|
||||
-int clewInit (const char*);
|
||||
+CLEW_FUN_EXPORT int clewInit (const char*);
|
||||
//! \brief Convert an OpenCL error code to its string equivalent
|
||||
-const char* clewErrorString (cl_int error);
|
||||
+CLEW_FUN_EXPORT const char* clewErrorString (cl_int error);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
1320
include/clew/clew.h
Normal file
1320
include/clew/clew.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -16,7 +16,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <clew.h>
|
||||
#include <clew/clew.h>
|
||||
|
||||
#include <sal/detail/log.h>
|
||||
#include <opencl/opencldllapi.h>
|
||||
|
@@ -13,7 +13,7 @@
|
||||
#include <ostream>
|
||||
#include <vector>
|
||||
|
||||
#include <clew.h>
|
||||
#include <clew/clew.h>
|
||||
|
||||
#include <opencl/opencldllapi.h>
|
||||
#include <rtl/ustring.hxx>
|
||||
|
@@ -20,7 +20,6 @@ $(eval $(call gb_Library_add_defs,opencl,\
|
||||
|
||||
$(eval $(call gb_Library_use_externals,opencl,\
|
||||
boost_headers \
|
||||
clew \
|
||||
icu_headers \
|
||||
icui18n \
|
||||
icuuc \
|
||||
@@ -33,6 +32,7 @@ $(eval $(call gb_Library_use_custom_headers,opencl,\
|
||||
$(eval $(call gb_Library_use_sdk_api,opencl))
|
||||
|
||||
$(eval $(call gb_Library_use_libraries,opencl,\
|
||||
clew \
|
||||
configmgr \
|
||||
comphelper \
|
||||
cppu \
|
||||
|
@@ -17,7 +17,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <clew.h>
|
||||
|
||||
#include <clew/clew.h>
|
||||
|
||||
#define DS_DEVICE_NAME_LENGTH 256
|
||||
|
||||
|
@@ -15,7 +15,6 @@ $(eval $(call gb_CppunitTest_add_exception_objects,sc_opencl_test, \
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_externals,sc_opencl_test, \
|
||||
boost_headers \
|
||||
$(call gb_Helper_optional,OPENCL,clew) \
|
||||
mdds_headers \
|
||||
orcus \
|
||||
orcus-parser \
|
||||
@@ -23,6 +22,7 @@ $(eval $(call gb_CppunitTest_use_externals,sc_opencl_test, \
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_libraries,sc_opencl_test, \
|
||||
basegfx \
|
||||
clew \
|
||||
comphelper \
|
||||
cppu \
|
||||
cppuhelper \
|
||||
|
@@ -31,7 +31,6 @@ endif
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_externals,sc_ucalc,\
|
||||
boost_headers \
|
||||
$(call gb_Helper_optional,OPENCL,clew) \
|
||||
icu_headers \
|
||||
icui18n \
|
||||
icuuc \
|
||||
@@ -44,6 +43,8 @@ $(eval $(call gb_CppunitTest_use_externals,sc_ucalc,\
|
||||
$(eval $(call gb_CppunitTest_use_libraries,sc_ucalc, \
|
||||
$(call gb_Helper_optional,AVMEDIA,avmedia) \
|
||||
basegfx \
|
||||
$(call gb_Helper_optional,OPENCL, \
|
||||
clew) \
|
||||
comphelper \
|
||||
cppu \
|
||||
cppuhelper \
|
||||
|
@@ -37,7 +37,6 @@ $(eval $(call gb_Library_use_sdk_api,sc))
|
||||
|
||||
$(eval $(call gb_Library_use_externals,sc,\
|
||||
boost_headers \
|
||||
$(call gb_Helper_optional,OPENCL,clew) \
|
||||
icu_headers \
|
||||
icui18n \
|
||||
icuuc \
|
||||
@@ -63,6 +62,8 @@ endif
|
||||
$(eval $(call gb_Library_use_libraries,sc,\
|
||||
$(call gb_Helper_optional,AVMEDIA,avmedia) \
|
||||
basegfx \
|
||||
$(call gb_Helper_optional,OPENCL, \
|
||||
clew) \
|
||||
comphelper \
|
||||
cppu \
|
||||
cppuhelper \
|
||||
|
@@ -24,11 +24,12 @@ $(eval $(call gb_Library_use_sdk_api,scui))
|
||||
|
||||
$(eval $(call gb_Library_use_externals,scui,\
|
||||
boost_headers \
|
||||
$(call gb_Helper_optional,OPENCL,clew) \
|
||||
mdds_headers \
|
||||
))
|
||||
|
||||
$(eval $(call gb_Library_use_libraries,scui,\
|
||||
$(call gb_Helper_optional,OPENCL, \
|
||||
clew) \
|
||||
comphelper \
|
||||
cppu \
|
||||
cppuhelper \
|
||||
|
@@ -54,7 +54,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sc, \
|
||||
CppunitTest_sc_subsequent_filters_test \
|
||||
CppunitTest_sc_subsequent_export_test \
|
||||
CppunitTest_sc_html_export_test \
|
||||
$(call gb_Helper_optional,OPENCL,CppunitTest_sc_opencl_test) \
|
||||
CppunitTest_sc_opencl_test \
|
||||
))
|
||||
|
||||
# Disabled to allow the check tinderbox execute the sd tests
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <sal/log.hxx>
|
||||
|
||||
#include <clew.h>
|
||||
#include <clew/clew.h>
|
||||
|
||||
#include <formula/token.hxx>
|
||||
#include <formula/vectortoken.hxx>
|
||||
|
@@ -64,10 +64,8 @@ private:
|
||||
OUString toString(sal_Int32 nVal) const;
|
||||
SvTreeListEntry *createItem(const OUString &rCaption, const OUString& sValue) const;
|
||||
void setValueAt(size_t nPos, const OUString &rString);
|
||||
#if HAVE_FEATURE_OPENCL
|
||||
OpenCLConfig::ImplMatcherSet& CurrentWhiteOrBlackList();
|
||||
const OpenCLConfig::ImplMatcher& CurrentWhiteOrBlackListEntry();
|
||||
#endif
|
||||
|
||||
private:
|
||||
SvxCheckListBox* mpLbSettings;
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "clew.h"
|
||||
#include <clew/clew.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
Reference in New Issue
Block a user