You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello there. I am working on a Simulation of a radar sensor using ROS and gazebo. For the acceleration of some calculations I want to use CUDA. CUDA-code and non-CUDA code are seperated in different files. But both of them contain thesame header file because of gazebo specifc data types that are passed to the kernels. While compiling I got the following error message:
/usr/include/ignition/math6/gz/math/graph/Graph.hh: In member function ‘EdgeType& ignition::math::v6::graph::Graph<V, E, EdgeType>::LinkEdge(const EdgeType&)’:
/usr/include/ignition/math6/gz/math/graph/Graph.hh:249:67: error: expected ‘;’ before ‘}’ token
249 | for (auto const &v : {edgeVertices.first, edgeVertices.second})
| ^
| ;
/usr/include/ignition/math6/gz/math/graph/Graph.hh:266:67: error: expected ‘;’ before ‘}’ token
266 | for (auto const &v : {edgeVertices.first, edgeVertices.second})
| ^
| ;
/usr/include/ignition/math6/gz/math/graph/Graph.hh: In member function ‘bool ignition::math::v6::graph::Graph<V, E, EdgeType>::RemoveEdge(const EdgeId&)’:
/usr/include/ignition/math6/gz/math/graph/Graph.hh:614:67: error: expected ‘;’ before ‘}’ token
614 | for (auto const &v : {edgeVertices.first, edgeVertices.second})
I think NVCC has problems with the syntax {edgeVertices.first, edgeVertices.second} in Graph.hh.
I am not sure why this error occurs, becuse gcc has no problems compiling my non-CUDA code where math-6 is also included.
It might be a faulty CMakeLists.txt or a bug in NVCC itself.
Possible solution?
I "fixed" the problem by updating Grph.hh. I know it is not the best and recomandable way but in my case it works.
std::vector<decltype(edgeVertices.first)>temp = {edgeVertices.first, edgeVertices.second};
for (auto const &v : temp)
{
if (this->vertices.find(v) == this->vertices.end())
return EdgeType::NullEdge;
}
Is there any other possibility to fix this Problem?
The text was updated successfully, but these errors were encountered:
I'm not sure how to fix this since this is valid code (initializer list in a range-for loop) and compiles on all of our supported platforms. I think it's best to ask in https://robotics.stackexchange.com/. I'll go ahead and close this since it's not a big in gz-math.
Environment
Description
Hello there. I am working on a Simulation of a radar sensor using ROS and gazebo. For the acceleration of some calculations I want to use CUDA. CUDA-code and non-CUDA code are seperated in different files. But both of them contain thesame header file because of gazebo specifc data types that are passed to the kernels. While compiling I got the following error message:
I think NVCC has problems with the syntax
{edgeVertices.first, edgeVertices.second}
in Graph.hh.Steps to reproduce
Output
I am not sure why this error occurs, becuse gcc has no problems compiling my non-CUDA code where math-6 is also included.
It might be a faulty CMakeLists.txt or a bug in NVCC itself.
Possible solution?
I "fixed" the problem by updating Grph.hh. I know it is not the best and recomandable way but in my case it works.
Is there any other possibility to fix this Problem?
The text was updated successfully, but these errors were encountered: