trass3r / cl4d Goto Github PK
View Code? Open in Web Editor NEWobject-oriented wrapper for the OpenCL C API written in the D programming language
License: Other
object-oriented wrapper for the OpenCL C API written in the D programming language
License: Other
You allocate the memory via the usual "new" keyword, the problem here is that the so allocated memory can be moved by the GC at any time. So this could mean that in the usage code (inside the library) the memory is at another place...which is (very) bad...
Allocate the memory with GC.malloc and as flags use NO_MOVE and NO_SCAN, after usage you need to free it manually.
Hi,
I created Derelict-style OpenCL bindings (mdparker/Derelict3#102).
I also edited cl4d so it can use them (https://github.com/vuaru/cl4d).
Perhaps you could take a look at them.
I also edited the VectorAdd example :)
If you build it in non-release mode for example
rdmd.exe --force --build-only --chatty -version=CL_VERSION_1_1 -d -gc -w OpenCL.lib -ofVector VectorAdd.d
it crashs because something somewhere violates a assert :(
Well a big question is how to deal with backward compatibility and OpenCL extensions.
In the long run it isn't practical to support every OpenCL version in the wrapper. They already removed functionality in v1.2 so I have to write different code for < 1.2 and >= 1.2
Extensions need to be properly supported with dynamic loading like Derelict does.
after commenting out the CLObjectCollection destructor like said in issue #1 i still cant build cl4d:
opencl\memory.d(164): Error: function opencl.c.cl.clGetMemObjectInfo (const(void_) memobj, uint param_name, uint param_value_size, void_ param_value, uint* param_value_size_ret) is not callable using argument types (const(void_),uint,uint,const(void_),typeof(null))
opencl\memory.d(164): Error: cannot implicitly convert expression (& info) of type const(void)* to void*
opencl\buffer.d(102): Error: template instance opencl.memory.CLMemory.getInfo!(const(void*),clGetMemObjectInfo) error instantiating
this simple cmd line build of cl4d makes dmd 2057 "stack overflow" :
dmd opencl\c\cl.d opencl\c\cl_ext.d opencl\c\cl_gl.d opencl\c\cl_gl_ext.d opencl\c\cl_platform.d opencl\c\opencl.d opencl\all.d opencl\buffer.d opencl\commandqueue.d opencl\context.d opencl\device.d opencl\error.d opencl\event.d opencl\host.d opencl\image.d opencl\kernel.d opencl\memory.d opencl\platform.d opencl\program.d opencl\sampler.d opencl\wrapper.d
unfortunately cl4d does not link on osx. any ideas ?
$ dub build --config=vector-example
WARNING: A deprecated branch based version specification is used for the dependency derelict-sdl2. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a branch instead.
WARNING: A deprecated branch based version specification is used for the dependency derelict-gl3. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a branch instead.
Performing "debug" build using dmd for x86_64.
cl4d ~master: building configuration "vector-example"...
Linking...
ld: library not found for -lOpenCL
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How did you get OpenCL.lib? I need equalent for linux platform to provide crosspaltfom support.
Because it is not possible to use them directly within nothrow methods/functions
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.