Recently I've been playing with OpenCL Wrangle SOP quite a bit and reeeally enjoying how fast this thing is.
More specifically I've been developing a HeightField Sand Solver that reads the current state of ‘height’ grid , processes it, and writes it out.
At the moment the data i'm copying on the device is the following:
'height' (volume) (Read=ON , Write=ON)
'temp' (volume) (Read=OFF , Write=OFF)
'temp' is a temporary field i need as a temporary data storage but I don't need it as node output. It's only a temporary internal data storage.
I was wondering if there is a way (and any benefit) to create my temporary data, aligned with some other data (in this case the ‘height’ volume) within the kernel and then destroy when the kernel is done.
I believe the OpenCL command to achieve this is clCreateBuffer but I might be wrong, and I wasn't really able to find good examples on how to use it.
Any idea ?
OpenCL clCreateBuffer
2079 2 2- mrWolf
- Member
- 22 posts
- Joined: June 2006
- Offline
Edited by mrWolf - July 15, 2017 17:19:20
Alessandro Pepe
http://www.alessandropepe.com [www.alessandropepe.com]
http://pepefx.blogspot.com [pepefx.blogspot.com]
http://www.alessandropepe.com [www.alessandropepe.com]
http://pepefx.blogspot.com [pepefx.blogspot.com]
- jlait
- Staff
- 6220 posts
- Joined: July 2005
- Offline
No. You'll need to make a temp volume for this purpose. The clCreateBuffer() is done from the API layer, not from inside the kernel.
Since you are wrapping this in an HDA likely, you can always delete the volume when done. Empty constant volumes don't take any RAM so this should be difficulty in using it, not an optimization issue.
Since you are wrapping this in an HDA likely, you can always delete the volume when done. Empty constant volumes don't take any RAM so this should be difficulty in using it, not an optimization issue.
- mrWolf
- Member
- 22 posts
- Joined: June 2006
- Offline
jlait
No. You'll need to make a temp volume for this purpose. The clCreateBuffer() is done from the API layer, not from inside the kernel.
Since you are wrapping this in an HDA likely, you can always delete the volume when done. Empty constant volumes don't take any RAM so this should be difficulty in using it, not an optimization issue.
Awesome ! I was hoping for this answer.
Thank you Jeff !
Alessandro Pepe
http://www.alessandropepe.com [www.alessandropepe.com]
http://pepefx.blogspot.com [pepefx.blogspot.com]
http://www.alessandropepe.com [www.alessandropepe.com]
http://pepefx.blogspot.com [pepefx.blogspot.com]
-
- Quick Links