-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: qualifiers dropped in binding reference of type "PointPlusPayload &" to initializer of type "const PointPlusPayload" #19
Comments
look at your get_point method:
it is defined as taking - as first parameter - a NON-CONST reference to a data, meaning it would allow that method to modify that point. But the builder calls that with a 'const data_t', which means that the builder cannot allow any modifications to that point... and thus, it refuses to call your function. If you look in my example code (testing/testPointPlusPayloadFromReadme.cu) you'll see that in my sample code that same function looks like this: float3 get_point(const PointPlusPayload &data) In my version that method accepts a refernce to a CONST data (and returns a copy, not a reference), so the builder is happy to call it. |
hello, The reason why I use the payload in struct PointPlusPayload is everytime I use cct::buildtree It will changer the origin index of my 3Dpoints . Now I run the example code (testing/testPointPlusPayloadFromReadme.cu) succeed,but i have a question about it. how can i use the fcp or knn in struct PointPlusPayload ? Or is there any other way to solve this problem? So I can find my source struct PointPlusPayload { |
yes, that's the right way to go. you can store your original index in the payload, and then use these traits to describe this. |
it doesn't work,It always say ’don't match the math.h’ or something else .can you give me a simple example on how to use fcp or knn? Thank you! |
added a fcp call to the sample code. |
hello,when i follow the example like:
/* code */
struct PointPlusPayload {
float3 position;
int payload;
};
struct PointPlusPayload_traits
: public cukd::default_data_traits
{
using point_t = float3;
static inline device host
float3 &get_point(PointPlusPayload &data) { return data.position; }
static inline device host
float get_coord(const PointPlusPayload &data, int dim)
{ return cukd::get_coord(get_point(data),dim); }
};
void test_kdtree()
{
PointPlusPayload data;
cudaMallocManaged((char **)&data,countsizeof(*data));
/... fill the data/
cukd::buildTree
</* type of the data: /PointPlusPayload ,
/ traits for this data: */PointPlusPayload_traits>
(data,count);
std::cout<<"build tree done"<<std::endl;
}
/* code */
I got 3 errors:
.cu:
error: qualifiers dropped in binding reference of type "PointPlusPayload &" to initializer of type "const PointPlusPayload"
builder_common.h(84): error: qualifiers dropped in binding reference of type "PointPlusPayload &" to initializer of type "const PointPlusPayload"
detected during:
instantiation of "void cukd::computeBounds_copyFirst<data_t,data_traits>(cukd::box_t<data_traits::point_t> *, const data_t *) [with data_t=PointPlusPayload, data_traits=PointPlusPayload_traits]"
builder_common.h(137): error: qualifiers dropped in binding reference of type "PointPlusPayload &" to initializer of type "const PointPlusPayload"
detected during:
instantiation of "void cukd::computeBounds_atomicGrow<data_t,data_traits>(cukd::box_t<data_traits::point_t> *, const data_t *, int) [with data_t=PointPlusPayload, data_traits=PointPlusPayload_traits]"
plz tell me how can i fix that? thanx!
The text was updated successfully, but these errors were encountered: