opencl and args
#1 Members - Reputation: 183
Posted 10 December 2012 - 06:21 AM
I would understand a thing in opencl:
Is possible run a kernel more times without reload all the arguments ?
What is the tecnique for do that ,if is possible?
mapping only a portion of the total buffer?
reload an heavy arg can fill the band?
#2 Members - Reputation: 183
Posted 12 December 2012 - 06:23 AM
#3 Members - Reputation: 691
Posted 13 December 2012 - 12:34 PM
hello.
I would understand a thing in opencl:
Is possible run a kernel more times without reload all the arguments ?
What is the tecnique for do that ,if is possible?
mapping only a portion of the total buffer?
reload an heavy arg can fill the band?
arguments work the same way as uniforms in opengl the data they store stays the same until YOU change them (provided they are read-only). So you only need to update parts that have changed. Or if your data is not several megabytes, then you can update the whole thing.
the way they work is really simple. You can ask for memory from the opencl API by creating memory objects. Then you can assign the memory objects to the kernel arguments. This way you only need to pay attention to syncing, and you can freely read/write the memory objects (thus the kernel arguments).
#4 Members - Reputation: 183
Posted 13 December 2012 - 02:25 PM
hello.
I would understand a thing in opencl:
Is possible run a kernel more times without reload all the arguments ?
What is the tecnique for do that ,if is possible?
mapping only a portion of the total buffer?
reload an heavy arg can fill the band?
arguments work the same way as uniforms in opengl the data they store stays the same until YOU change them (provided they are read-only). So you only need to update parts that have changed. Or if your data is not several megabytes, then you can update the whole thing.
the way they work is really simple. You can ask for memory from the opencl API by creating memory objects. Then you can assign the memory objects to the kernel arguments. This way you only need to pay attention to syncing, and you can freely read/write the memory objects (thus the kernel arguments).
i understand the discourse of the kernel args that working like uniforms parameters of shader, very thanks,
I have understand argument in this mode :
The local memory,global memory and private memory after that are used if are not deleted remain the same(like uniform)
then i can relaunch the kernel with some changed parameters,
But if i would changes only a part of an arg like in opengl the map/unmap of a vbo,i can do?
I can use subbuffers or subimages?
how?
is possible?
Is this that I not understand.
Thanks,
#5 Members - Reputation: 691
Posted 14 December 2012 - 04:05 AM
http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWriteBufferRect.html
To add, you can work directly with VBOs, therefore the same functions are available to you. You only need to pay attention to API switching.
See OpenGL-OpenCL interop.






