opencl and args

Started by
3 comments, last by Yours3!f 11 years, 4 months ago
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?
Advertisement
i must implement a neighbor's finder with k-dtree, and for this i must create the data structure and fill it with data, after that i must call several time a kernel for each search, a solution is send all the queries in a kernel arguments , but it is not sufficient, because i should be able to adjourn the data structure for example if adds a element or delete it, how i can send only an argument or some to the kdtree of 100000 elements(for example)?

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).

[quote name='giugio' timestamp='1355142115' post='5009059']
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).
[/quote]

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,
I think this might be what you are looking for.
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.

This topic is closed to new replies.

Advertisement