Skip to content

Commit

Permalink
Attempting to fix nvcc
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Heller committed Sep 1, 2017
1 parent d374d7c commit 3a72e69
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
16 changes: 16 additions & 0 deletions hpx/hpx_init.hpp
Expand Up @@ -10,6 +10,20 @@
#ifndef HPX_HPX_INIT_HPP
#define HPX_HPX_INIT_HPP

// // We don't hpx_init and friends when compiling in device mode
#if 0//defined(__CUDA_ARCH__)

namespace hpx
{
template <typename...Dummy>
int init(Dummy&&...)
{
return 0;
}
}

#else

#include <hpx/config.hpp>
#include <hpx/hpx_finalize.hpp>
#include <hpx/runtime/runtime_mode.hpp>
Expand Down Expand Up @@ -716,4 +730,6 @@ namespace hpx
#endif
#endif

#endif

#endif /*HPX_HPX_INIT_HPP*/
1 change: 1 addition & 0 deletions hpx/lcos/future.hpp
Expand Up @@ -362,6 +362,7 @@ namespace hpx { namespace lcos { namespace detail
#if defined(HPX_HAVE_EXECUTOR_COMPATIBILITY)
template <typename ContResult, typename Future, typename Executor,
typename F>
HPX_DEPRECATED(HPX_DEPRECATED_MSG)
inline typename hpx::traits::detail::shared_state_ptr<
typename continuation_result<ContResult>::type
>::type
Expand Down
1 change: 0 additions & 1 deletion hpx/lcos/local/packaged_continuation.hpp
Expand Up @@ -670,7 +670,6 @@ namespace hpx { namespace lcos { namespace detail
#if defined(HPX_HAVE_EXECUTOR_COMPATIBILITY)
template <typename ContResult, typename Future, typename Executor,
typename F>
HPX_DEPRECATED(HPX_DEPRECATED_MSG)
inline typename traits::detail::shared_state_ptr<
typename continuation_result<ContResult>::type
>::type
Expand Down
2 changes: 1 addition & 1 deletion hpx/runtime/actions/lambda_to_action.hpp
Expand Up @@ -104,7 +104,7 @@ namespace hpx { namespace actions
{
template<typename F>
HPX_CONSTEXPR typename hpx::actions::detail::action_from_lambda<F>::type
operator += (F* f)
operator += (F* f) const
{
static_assert(
//!std::is_assignable<F,F>::value &&
Expand Down
6 changes: 5 additions & 1 deletion hpx/runtime/components/binpacking_distribution_policy.hpp
Expand Up @@ -8,6 +8,9 @@
#if !defined(HPX_COMPONENTS_BINPACKING_DISTRIBUTION_POLICY_APR_10_2015_0344PM)
#define HPX_COMPONENTS_BINPACKING_DISTRIBUTION_POLICY_APR_10_2015_0344PM

//#if !defined(__CUDA_ARCH__)
#if !defined(__CUDACC__)

#include <hpx/config.hpp>
#include <hpx/dataflow.hpp>
#include <hpx/lcos/future.hpp>
Expand Down Expand Up @@ -99,7 +102,7 @@ namespace hpx { namespace components

return hpx::dataflow(hpx::launch::sync,
hpx::util::unwrapping(
[](std::vector<std::uint64_t> && values)
[](std::vector<std::uint64_t> values)
{
return values;
}),
Expand Down Expand Up @@ -484,5 +487,6 @@ namespace hpx
}
}
/// \endcond
#endif

#endif
18 changes: 6 additions & 12 deletions tests/performance/local/stream.cpp
Expand Up @@ -388,7 +388,7 @@ run_benchmark(
}

///////////////////////////////////////////////////////////////////////////////
int hpx_main(boost::program_options::variables_map& vm)
int stream_main(boost::program_options::variables_map& vm)
{
std::size_t vector_size = vm["vector_size"].as<std::size_t>();
std::size_t offset = vm["offset"].as<std::size_t>();
Expand Down Expand Up @@ -520,6 +520,8 @@ int hpx_main(boost::program_options::variables_map& vm)
return hpx::finalize();
}

#include <hpx/runtime/resource/partitioner.hpp>

int main(int argc, char* argv[])
{
using namespace boost::program_options;
Expand Down Expand Up @@ -550,21 +552,13 @@ int main(int argc, char* argv[])
#endif
;

// parse command line here to extract the necessary settings for HPX
parsed_options opts =
command_line_parser(argc, argv)
.allow_unregistered()
.options(cmdline)
.style(command_line_style::unix_style)
.run();

variables_map vm;
store(opts, vm);
// hpx::resource::partitioner rp(cmdline, argc, argv);
// return hpx::init();

std::vector<std::string> cfg = {
"hpx.numa_sensitive=2" // no-cross NUMA stealing
};

return hpx::init(cmdline, argc, argv, cfg);
return hpx::init(&stream_main, cmdline, argc, argv, cfg);
}

0 comments on commit 3a72e69

Please sign in to comment.