Closed bmerry closed 10 years ago
The problem here is not is_cl_native
, but cl_vector_length
, which is unspecialized for bool
, which is a non-cl-native type. Are you by any chance trying to use a vex::vector<bool>
?
Actually I'm writing a header to allow vex to work with clogs (which has a much faster autotuned implementation of exclusive scan) so I'm doing metaprogramming to determine whether a type is supported by clogs. I'll send you a pull request when I think it is ready. This only came up in tests I wrote for my traits types (i.e. an assertion that clogs_is_scannable<bool>
is false). I've worked around it, but I filed the bug because normally traits classes of the form is_xxx<T>
are instantiable for any T
.
Well, is_cl_native<bool>::value
is defined and returns false
. It's the second part of the SFINAE check from your example that gives the compilation error.
Btw, could you give me a link to clogs? I have never heard of the library. Update: found it.
Well,
is_cl_native<bool>::value
is defined and returnsfalse
. It's the second part of the SFINAE check from your example that gives the compilation error.
Indeed. The code that fails is in the implementation of is_cl_vector
, and hence any instantiation of is_cl_vector<bool>
causes a compilation error instead of becoming false_type
.
Btw, could you give me a link to clogs? I have never heard of the library.
http://clogs.sourceforge.net (I am the author).
Ok, I understand the problem now. The patch is incoming.
clogs looks like an interesting library! Out of interest, how faster is its implementation of inclusive scan than the one from VexCL? Btw, the VexCL version was adopted from AMD Bolt code.
It only does exclusive scan, not inclusive. On a GeForce 480 GTX it is about 3-4 times faster. I thought it was about 2x faster on my R9 270, but now it seems to only be 15% faster. I'll need to check if some of the recent changes I've made to clogs to make it easier to integrate with vexcl have damaged performance.
That sounds nice! The problem with is_cl_vector
and is_cl_scalar
should be fixed by 1801b6f.
Yes, that seems to have fixed it. That was quick work, thanks!
Attempting to instantiate vex::is_cl_native causes this error:
This makes it unusable within enable_if tests. I haven't tested it, but I think the right fix is to define the general case to subclass false_type and use enable_if to specialize the appropriate cases to subclass true_type.