Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


opencl and args


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 giugio   Members   -  Reputation: 215

Like
0Likes
Like

Posted 10 December 2012 - 06:21 AM

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?

Sponsor:

#2 giugio   Members   -  Reputation: 215

Like
0Likes
Like

Posted 12 December 2012 - 06:23 AM

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

#3 Yours3!f   Members   -  Reputation: 1383

Like
0Likes
Like

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 giugio   Members   -  Reputation: 215

Like
0Likes
Like

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 Yours3!f   Members   -  Reputation: 1383

Like
0Likes
Like

Posted 14 December 2012 - 04:05 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS