- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
In CUDA, when you declare a gpu-buffer it is accessible to all the methods of your kernel, not only the 'kernel'.
It is a problem because if you have a lot of buffers, you have to pass all the buffers pointers to every method !
The best way I have found is to create a typedef that will contains all theses pointers, if I don't want that all the methods have 40 parameters ! But it require time to initialize, to pass and some memory too. Also it will be easier if we will be able to access all theses buffers globally !
BTW, does someone know if OpenCL 2 (or a new specification) is in preparation ? Because we really miss a lot of features :-P Even if today it is more important to have stable OpenCL drivers !
typedefstruct
{
__globalData1*data1;
__globalData2*data4;
__globalData3*data3;
__globalData4*data2;
.....
}clBufferReferences;
void__kernelmain_kernel(__globalData1*data1,__globalData2*data2,__globalData3*data3,__globalData4*data4)
{
clBufferReferencesreferences;
references.data1=data1;
references.data2=data2;
references.data3=data3;
references.data4=data4;
first_method(&references);
}
Thanks
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page