0
我在opencl(v1.1)中使用了char向量类型,并且正在搜索 以获得vector.lo和vector.hi扩展,但只能访问cl_char数组。 通过opencl头文件搜索,我发现了以下列表 ,这表明这些扩展可用于GNUC和“strict ansi”。使用Microsoft编译器减少opencl内置矢量类型的功能吗?
/* Define cl_vector types in cl_platform.h */
/* ---- cl_charn ---- */
typedef union
{
cl_char CL_ALIGNED(2) s[2];
#if defined(__GNUC__) && ! defined(__STRICT_ANSI__)
__extension__ struct{ cl_char x, y; };
__extension__ struct{ cl_char s0, s1; };
__extension__ struct{ cl_char lo, hi; };
#endif
#if defined(__CL_CHAR2__)
__cl_char2 v2;
#endif
}cl_char2;
// other vector type definitions follow...
这是正确的吗?我该如何解决这个问题?