I've tried playing with clang's extended vectors. The ternary operator is supposed to work, but it is not working for me. Example:
int main()
{
using int4 = int __attribute__((ext_vector_type(4)));
int4 a{0, 1, 3, 4};
int4 b{2, 1, 4, 5};
auto const r(a - b ? a : b);
return 0;
}
Please provide examples on how I might make it work, like it works under OpenCL. I am using clang-3.4.2
.
Error:
t.cpp:8:16: error: value of type 'int __attribute__((ext_vector_type(4)))' is not contextually convertible to 'bool'
auto const r(a - b ? a : b);
^~~~~
1 error generated.