1 Reply Latest reply on Oct 2, 2010 5:54 AM by himanshu.gautam

    Does "typedef struct" in OpenCL is allowed ?

    spectral

       

      Hi, I currently write my union like this :
      typedef struct
      {
       union
       {
        BxDFDataRefraction refraction;
       } data;
      } BxDFData;
      But can I write it like this :
      typedef union struct
      {
        BxDFDataRefraction refraction;
      } BxDFData;
      Like this I can access my data like this :
      BxDFData bxdfd;
      bxdfd.refraction.value = 10;
      And not like this :
      BxDFData bxdfd;
      bxdfd.data.refraction.value = 10;
      Thanks