Navigation Menu

Skip to content

Commit

Permalink
Fixing more compiler errors when not compiling in CUDA mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sithhell committed Sep 5, 2017
1 parent 28a5ec8 commit 34d4a77
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hpx/compute/cuda/default_executor.hpp
Expand Up @@ -8,7 +8,7 @@

#include <hpx/config.hpp>

#if defined(HPX_HAVE_CUDA) && defined(__CUDACC__)
#if defined(HPX_HAVE_CUDA)
#include <hpx/lcos/future.hpp>
#include <hpx/traits/executor_traits.hpp>
#include <hpx/traits/is_executor.hpp>
Expand All @@ -17,6 +17,7 @@
#include <hpx/util/decay.hpp>
#include <hpx/util/range.hpp>
#include <hpx/util/tuple.hpp>
#include <hpx/throw_exception.hpp>

#include <hpx/parallel/executors/execution.hpp>

Expand Down Expand Up @@ -45,6 +46,7 @@ namespace hpx { namespace compute { namespace cuda
static void call(cuda::target const& target, F && f,
Shape const& shape, Ts &&... ts)
{
#if defined(HPX_COMPUTE_DEVICE_CODE) || defined(HPX_COMPUTE_HOST_CODE)
std::size_t count = util::size(shape);

int threads_per_block =
Expand Down Expand Up @@ -73,6 +75,11 @@ namespace hpx { namespace compute { namespace cuda
},
std::forward<F>(f), shape_container.data(), count,
std::forward<Ts>(ts)...);
#else
HPX_THROW_EXCEPTION(hpx::not_implemented,
"hpx::compute::cuda::detail::bulk_launch_helper",
"Trying to launch a CUDA kernel, but did not compile in CUDA mode");
#endif
}
};

Expand Down

0 comments on commit 34d4a77

Please sign in to comment.