martijnberger / clew Goto Github PK
View Code? Open in Web Editor NEWThe OpenCL Extension Wrangler Library
License: Other
The OpenCL Extension Wrangler Library
License: Other
Hi!
I've looked through the project build configuration, and I found few moments I can improve it:
CMakeLists.txt
into a the topmost one. You cannot build only part of the project by issuing cmake ../src
or cmake ../clewTest
, so why have them separated at all?BUILD_TESTS
or BUILD_SHARED_LIBRARY
should have CLEW_
prefix in their name.clewTest
directory to clew_test
or simply test
?What you you think about the proposal?
Option renaming is a breaking change, so I'd want to discuss it prior PR'ing. See the EasyCL issue discussion for more information why this rename maybe a right thing to do.
has anyone tested this library with the cl.hpp binder?
Thanks.
Just ran into this building against blender's copy of clew, inside /blender/extern/clew path off of Trunk.
I don't know why they didn't roll it up to you but they've modified clew.c and clew.h making it useless against their new split kernel.
You can get their changes that compile Blender with no mistakes from blender.git.
There is no information about how this code is licensed and copyrighted. Would be convenient, if this is added.
Blender has a need for libGLEW.so instead of libglew.so and fails to build without it. On Linux I just made a ln -s libglew.so libGLEW.so but I imagine you can make a cleaner solution by providing a link installed version of it.
There is some strange code in clew.h:
// #define CLEW_STATIC
#ifdef _WIN32
#ifdef clew_STATIC
# define CLEWAPI extern
#else
# ifdef clew_EXPORTS
#pragma message("exporting")
# define CLEWAPI extern __declspec(dllexport)
# else
#pragma message("importing")
# define CLEWAPI extern __declspec(dllimport)
# endif
#endif
#else
# define CLEWAPI extern
#endif
clGetGLContextInfoKHR (https://www.khronos.org/registry/OpenCL/sdk/1.2/docs/man/xhtml/clGetGLContextInfoKHR.html) is defined in the cl_khr_gl_sharing (https://www.khronos.org/registry/OpenCL/sdk/1.2/docs/man/xhtml/cl_khr_gl_sharing.html) extension. However, clew doesn't necessarily always find it.
That's because clGetGLContextInfoKHR is an extension function, and according to https://www.khronos.org/registry/OpenCL/sdk/1.0/docs/man/xhtml/clGetExtensionFunctionAddress.html
For functions that are queryable with clGetExtensionFunctionAddress, implementations may choose to also export those functions statically from the object libraries implementing those functions. However, portable applications cannot rely on this behavior.
Since clew uses dlsym-like mechanism, it fails to find the function.
AFAIK that's the only extension function currently exposed by clew. We wound need a proper mechanism to get it, i.e. clGetExtensionFunctionAddress() if we don't want to use the platform, or clGetExtensionFunctionAddressForPlatform() if we want to do it right.
That might require introducing another version of clew initialization that is called with a platform ID to initialize the functions for a given platform.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.