sympiler / aggregation

The aggregation repository contains a set of algorithms for grouping vertices of DAGs coming from loop-carried dependencies. For more information see Sympiler website
http://www.sympiler.com/
MIT License
5 stars 5 forks source link

Use std::isnan in example/SpTRSV_runtime.h #4

Closed learning-chip closed 1 year ago

learning-chip commented 1 year ago

In example/SpTRSV_runtime.h there are two isnan calls which should be std::isnan

https://github.com/sympiler/aggregation/blob/da104fa343672469f2000efa4285dccb32107370/example/SpTRSV_runtime.h#L858-L860

https://github.com/sympiler/aggregation/blob/da104fa343672469f2000efa4285dccb32107370/example/SpTRSV_runtime.h#L907-L909

Otherwise got this compile error (with gcc 11.3 and cmake 3.22):

In file included from /usr/include/c++/11/cassert:44,
                 from /work_dir/aggregation/include/aggregation/def.h:11,
                 from /work_dir/aggregation/include/aggregation/sparse_utilities.h:12,
                 from /work_dir/aggregation/include/aggregation/metis_interface.h:8,
                 from /work_dir/aggregation/example/SpTRSV_runtime.cpp:7:
/work_dir/aggregation/example/SpTRSV_runtime.h: In member function 'double sym_lib::SpTrSv_LL_Tree_HDAGG_BFS::getPotentialGain()':
/work_dir/aggregation/example/SpTRSV_runtime.h:859:19: error: 'isnan' was not declared in this scope; did you mean 'std::isnan'?
  859 |           assert(!isnan(cost[node]));
      |                   ^~~~~
In file included from /work_dir/aggregation/include/aggregation/test_utils.h:8,
                 from /work_dir/aggregation/example/SpTRSV_runtime.cpp:12:
/usr/include/c++/11/cmath:632:5: note: 'std::isnan' declared here
  632 |     isnan(_Tp __x)
      |     ^~~~~
In file included from /usr/include/c++/11/cassert:44,
                 from /work_dir/aggregation/include/aggregation/def.h:11,
                 from /work_dir/aggregation/include/aggregation/sparse_utilities.h:12,
                 from /work_dir/aggregation/include/aggregation/metis_interface.h:8,
                 from /work_dir/aggregation/example/SpTRSV_runtime.cpp:7:
/work_dir/aggregation/example/SpTRSV_runtime.h: In member function 'void sym_lib::SpTrSv_LL_Tree_HDAGG_BFS::computeMetrics(double&, double&, double&, double&, double&, double&, double&, double&, double&, double&, double&)':
/work_dir/aggregation/example/SpTRSV_runtime.h:908:19: error: 'isnan' was not declared in this scope; did you mean 'std::isnan'?
  908 |           assert(!isnan(cost[node]));
      |                   ^~~~~
In file included from /work_dir/aggregation/include/aggregation/test_utils.h:8,
                 from /work_dir/aggregation/example/SpTRSV_runtime.cpp:12:
/usr/include/c++/11/cmath:632:5: note: 'std::isnan' declared here
  632 |     isnan(_Tp __x)
      |     ^~~~~
gmake[2]: *** [example/CMakeFiles/Hdagg_SpTRSV.dir/build.make:76: example/CMakeFiles/Hdagg_SpTRSV.dir/SpTRSV_runtime.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:261: example/CMakeFiles/Hdagg_SpTRSV.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
learning-chip commented 1 year ago

Fixed in #8