[Boost.Compute]: min_element over a double3 vector sequence

31 views
Skip to first unread message

Manfred Doudar

unread,
Oct 12, 2020, 2:24:25 AM10/12/20
to boost-compute
Hello List,

Having first tried both the C++ Slack channel, and Boost.Users newsgroup, without much luck I finally landed here - not realizing there was  dedicated Boost.Compute forum.

So, here's the issue -


BOOST_COMPUTE_ADAPT_STRUCT(double3, double3, (x, y, z))
BOOST_COMPUTE_FUNCTION(bool, CompareX, (double3 a, double3 b),
{
    return a.x < b.x;
});
boost::compute::vector<double> points;
...
auto it = boost::compute::min_element(points.begin(), points.end(), CompareX, queue);


which results in the following kernel compilation failure -


--- build log ---
<kernel>:9:3: error: typedef redefinition with different types ('struct double3' vs 'double __attribute__((ext_vector_type(3)))')
} double3;
  ^
cl_kernel.h:154:1: note: previous definition is here
__NV_DECLARE_VECT_TYPES(double,          double)
^
cl_kernel.h:114:61: note: expanded from macro '__NV_DECLARE_VECT_TYPES'
typedef __attribute__(( ext_vector_type(3)  ))        CTYPE CLTYPE##3;  \
                                                            ^
<scratch space>:53:1: note: expanded from here
double3
^
^@


Something obvious I am sure, but guidance would be appreciated.

Thanks,
/M




Reply all
Reply to author
Forward
0 new messages