I would like to write something like that :
typedef struct
{
int a;
float b;
float c;
} T1;
typedef struct
{
float a;
} T2;
typdef union
{
T1 t1;
T2 t2;
} ValuesSet;
Like this I can access like this :
ValuesSet set;
set.t1.a = 20;
Today I have to do the following :
typdef
{
union {
T1 t1;
T2 t2;
} all;
} ValuesSet;
set.all.t1.a = 20;
It is a longer expression 😞
Thanks Micah,
It is an example in my previous post ! ? !
You can insert this code in any 'opencl sample' to check if it work ?
Hi Micah, thanks for your answer....
It is NOT a bug, I just ask if this 'syntax' is allowed in an OpenCL kernel ?
It is supported in C++ and avoid to write 'shorter' code, simply !
NB: I think it is not yet supported in OpenCL 1.1...
Thx
viewon01,
I tried the snippet, it works on my system.
Can you provide you SYSTEM detailsS,CPU,GPU,SDK,DRIVER.
you can also send your code at streamdeveloper@amd.com.