cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

jean-claude
Journeyman III

Constant Lookup tables in kernel ?

Hi, sorry to ask a possibly dumb question...

Anyway let me synthesize through a simple example:

I need to pass to a kernel a constant argument which is
a linear look_up table

float LookupTbl[4096];

kernel (out float a<>, int b<>, float LookupTbl[]) {
 a = LookupTbl;
}

BTW. The size of a and b streams are different from the sizeof the LookupTbl.
 
Thanks for hints

Jean-Claude

0 Likes
4 Replies
dukeleto
Adept I

Depending on what you're trying to do exactly, can't you stick your lookup
table in a stream and input it as a gather stream?
0 Likes

Thanks Dukeleto,

This is obviously what I ended up doing as a short cut.

Having said so the issue is that the size of the lookup table is much smaller than the stream size, so this is a waiste of memory.

The basic question is: is there any way to have a vector (Lookup table) as a constant (the same way we have float4, int, ... as constant) whose size is not aligned with the main stream size?

Regards

Jean-Claude

0 Likes

jean-claude, in the current iteration of the Brook+ SDK that is not possible, but it is something we are considering implementing for a future release. In CAL, you get more control over the constant buffers and this is then possible.
0 Likes

Thanks Mika,

I think I'll have a close look at CAL as soon as I get some time.

Jean-Claude

0 Likes