Skip to content

Commit

Permalink
Adding empty (but non-trivial) destructor to circumvent warnings
Browse files Browse the repository at this point in the history
- cleaning up use of annotate_function
  • Loading branch information
hkaiser committed Jul 21, 2017
1 parent 815144a commit a93b210
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 12 deletions.
1 change: 0 additions & 1 deletion hpx/lcos/dataflow.hpp
Expand Up @@ -234,7 +234,6 @@ namespace hpx { namespace lcos { namespace detail
HPX_FORCEINLINE void done()
{
hpx::util::annotate_function annotate(func_);
(void)annotate; // suppress warning about unused variable
execute(indices_type(), is_void());
}

Expand Down
1 change: 0 additions & 1 deletion hpx/lcos/detail/future_data.hpp
Expand Up @@ -502,7 +502,6 @@ namespace detail
{
try {
hpx::util::annotate_function annotate(on_completed);
(void)annotate; // suppress warning about unused variable
on_completed();
}
catch (...) {
Expand Down
1 change: 0 additions & 1 deletion hpx/lcos/local/packaged_continuation.hpp
Expand Up @@ -112,7 +112,6 @@ namespace hpx { namespace lcos { namespace detail
> is_void;

hpx::util::annotate_function annotate(func);
(void)annotate; // suppress warning about unused variable
invoke_continuation(func, future, cont, is_void());
}

Expand Down
1 change: 0 additions & 1 deletion hpx/lcos/local/packaged_task.hpp
Expand Up @@ -95,7 +95,6 @@ namespace hpx { namespace lcos { namespace local
}

hpx::util::annotate_function annotate(function_);
(void)annotate; // suppress warning about unused variable
invoke_impl(std::is_void<R>(), std::forward<Ts>(vs)...);
}

Expand Down
3 changes: 0 additions & 3 deletions hpx/parallel/algorithms/for_each.hpp
Expand Up @@ -128,10 +128,7 @@ namespace hpx { namespace parallel { inline namespace v1
void operator()(Iter part_begin, std::size_t part_size,
std::size_t /*part_index*/)
{
#if !defined(__NVCC__) && !defined(__CUDACC__)
hpx::util::annotate_function annotate(f_);
(void)annotate; // suppress warning about unused variable
#endif
execute(part_begin, part_size);
}
};
Expand Down
3 changes: 0 additions & 3 deletions hpx/parallel/algorithms/for_loop.hpp
Expand Up @@ -146,10 +146,7 @@ namespace hpx { namespace parallel { inline namespace v2
void operator()(B part_begin, std::size_t part_steps,
std::size_t part_index)
{
#if !defined(__NVCC__) && !defined(__CUDACC__)
hpx::util::annotate_function annotate(f_);
(void)annotate; // suppress warning about unused variable
#endif
execute(part_begin, part_steps, part_index);
}
};
Expand Down
1 change: 0 additions & 1 deletion hpx/parallel/algorithms/transform.hpp
Expand Up @@ -130,7 +130,6 @@ namespace hpx { namespace parallel { inline namespace v1
std::size_t /*part_index*/)
{
hpx::util::annotate_function annotate(f_);
(void)annotate; // suppress warning about unused variable
return execute(part_begin, part_size);
}
};
Expand Down
11 changes: 10 additions & 1 deletion hpx/util/annotated_function.hpp
Expand Up @@ -38,8 +38,14 @@ namespace hpx { namespace util
#if (!defined(__NVCC__) && !defined(__CUDACC__))
struct annotate_function
{
HPX_NON_COPYABLE(annotate_function);

explicit annotate_function(char const* name) {}
template <typename F>
explicit HPX_HOST_DEVICE annotate_function(F && f){}
explicit HPX_HOST_DEVICE annotate_function(F && f) {}

// add empty (but non-trivial) destructor to silence warnings
~annotate_function() {}
};
#elif HPX_HAVE_ITTNOTIFY != 0
struct annotate_function
Expand Down Expand Up @@ -178,6 +184,9 @@ namespace hpx { namespace util
explicit annotate_function(char const* name) {}
template <typename F>
explicit HPX_HOST_DEVICE annotate_function(F && f) {}

// add empty (but non-trivial) destructor to silence warnings
~annotate_function() {}
};

///////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit a93b210

Please sign in to comment.