* Issue with passing NULL as argument in 4.8.5
[not found] <842883304.907747.1572124496869.ref@mail.yahoo.com>
@ 2019-10-26 21:15 ` Mahmood Naderan via gcc-help
2019-10-28 11:49 ` Jonathan Wakely
0 siblings, 1 reply; 2+ messages in thread
From: Mahmood Naderan via gcc-help @ 2019-10-26 21:15 UTC (permalink / raw)
To: Gcc-help
Hi,
There is a code as below
typename GraphT::SizeT Validate_Results(
util::Parameters ¶meters, GraphT &graph, typename GraphT::VertexT src,
LabelT *h_labels, typename GraphT::VertexT *h_preds,
LabelT *ref_labels = (LabelT*)NULL,
typename GraphT::VertexT *ref_preds = NULL,
bool verbose = true) {
which is called like this:
SizeT num_errors = app::bfs::Validate_Results(
parameters, graph, src, h_labels, h_preds,
ref_labels == NULL ? NULL : ref_labels[run_num % num_srcs],
NULL,
false);
However, gcc 4.8.5 has problem with passing NULL with the 7th argument.
/home/mahmood/gunrock-1.0/examples/bfs/test_bfs.cu:120:62: required from here
/home/mahmood/gunrock-1.0/gunrock/app/bfs/bfs_app.cu:114:166: error: no matching function for call to ‘Validate_Results(gunrock::util::Parameters&, gunrock::app::TestGraph<long unsigned int, long unsigned int, unsigned int, 768u, 0u>&, VertexT&, long unsigned int*&, VertexT*&, long unsigned int*, NULL, bool)’
SizeT num_errors = app::bfs::Validate_Results(
^
/home/mahmood/gunrock-1.0/gunrock/app/bfs/bfs_app.cu:114:166: note: candidate is:
/home/mahmood/gunrock-1.0/gunrock/app/bfs/bfs_test.cuh:132:1: note: template<class GraphT, class LabelT> typename GraphT::SizeT gunrock::app::bfs::Validate_Results(gunrock::util::Parameters&, GraphT&, typename GraphT::VertexT, LabelT*, typename GraphT::VertexT*, LabelT*, typename GraphT::VertexT*, bool)
typename GraphT::SizeT Validate_Results(
^
/home/mahmood/gunrock-1.0/gunrock/app/bfs/bfs_test.cuh:132:1: note: template argument deduction/substitution failed:
/home/mahmood/gunrock-1.0/gunrock/app/bfs/bfs_app.cu:114:166: note: mismatched types ‘typename GraphT::VertexT*’ and ‘long int’
SizeT num_errors = app::bfs::Validate_Results(
^
I have confused on how to solve that. Any idea?
Regards,
Mahmood
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Issue with passing NULL as argument in 4.8.5
2019-10-26 21:15 ` Issue with passing NULL as argument in 4.8.5 Mahmood Naderan via gcc-help
@ 2019-10-28 11:49 ` Jonathan Wakely
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2019-10-28 11:49 UTC (permalink / raw)
To: Mahmood Naderan via gcc-help
On Sat, 26 Oct 2019 at 22:15, Mahmood Naderan via gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> Hi,
> There is a code as below
> typename GraphT::SizeT Validate_Results(
> util::Parameters ¶meters, GraphT &graph, typename GraphT::VertexT src,
> LabelT *h_labels, typename GraphT::VertexT *h_preds,
> LabelT *ref_labels = (LabelT*)NULL,
> typename GraphT::VertexT *ref_preds = NULL,
> bool verbose = true) {
>
> which is called like this:
> SizeT num_errors = app::bfs::Validate_Results(
> parameters, graph, src, h_labels, h_preds,
> ref_labels == NULL ? NULL : ref_labels[run_num % num_srcs],
> NULL,
> false);
>
>
> However, gcc 4.8.5 has problem with passing NULL with the 7th argument.
>
>
> /home/mahmood/gunrock-1.0/examples/bfs/test_bfs.cu:120:62: required from here
> /home/mahmood/gunrock-1.0/gunrock/app/bfs/bfs_app.cu:114:166: error: no matching function for call to ‘Validate_Results(gunrock::util::Parameters&, gunrock::app::TestGraph<long unsigned int, long unsigned int, unsigned int, 768u, 0u>&, VertexT&, long unsigned int*&, VertexT*&, long unsigned int*, NULL, bool)’
> SizeT num_errors = app::bfs::Validate_Results(
> ^
> /home/mahmood/gunrock-1.0/gunrock/app/bfs/bfs_app.cu:114:166: note: candidate is:
> /home/mahmood/gunrock-1.0/gunrock/app/bfs/bfs_test.cuh:132:1: note: template<class GraphT, class LabelT> typename GraphT::SizeT gunrock::app::bfs::Validate_Results(gunrock::util::Parameters&, GraphT&, typename GraphT::VertexT, LabelT*, typename GraphT::VertexT*, LabelT*, typename GraphT::VertexT*, bool)
> typename GraphT::SizeT Validate_Results(
> ^
> /home/mahmood/gunrock-1.0/gunrock/app/bfs/bfs_test.cuh:132:1: note: template argument deduction/substitution failed:
> /home/mahmood/gunrock-1.0/gunrock/app/bfs/bfs_app.cu:114:166: note: mismatched types ‘typename GraphT::VertexT*’ and ‘long int’
> SizeT num_errors = app::bfs::Validate_Results(
> ^
>
>
>
> I have confused on how to solve that. Any idea?
Has somebody redefined NULL in your code base?
Compile with -save-temps and check the .ii file to see what the NULL
macro expands to at that point.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-28 11:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <842883304.907747.1572124496869.ref@mail.yahoo.com>
2019-10-26 21:15 ` Issue with passing NULL as argument in 4.8.5 Mahmood Naderan via gcc-help
2019-10-28 11:49 ` Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).