CHIP-SPV / chipStar

chipStar is a tool for compiling and running HIP/CUDA on SPIR-V via OpenCL or Level Zero APIs.
Other
185 stars 30 forks source link

question about __align__ #593

Open zjin-lcf opened 1 year ago

zjin-lcf commented 1 year ago
typedef struct __align__(4)
{
  unsigned char r, g, b, a;
}
uchar4_aligned;

causes compile error (Please see https://github.com/zjin-lcf/HeCBench/pull/46 for more details).

Is the following recommended for nvcc, hipcc, and clang++ ?

typedef struct
{
  unsigned char r, g, b, a;
}
uchar4_aligned __attribute__((aligned(4)));
linehill commented 1 year ago

The __align__ has been broken for a while but it used to work until some patch broke it. There's a ticket for it here.