Skip to content
Snippets Groups Projects
Commit 4b8486c7 authored by i-bird's avatar i-bird
Browse files

Fixing CUDA on CPU in case of no work

parent a48cbfb9
No related branches found
No related tags found
No related merge requests found
Pipeline #2652 passed
......@@ -12,7 +12,7 @@
#define CUDIFY_ACTIVE
#include "util/cuda_util.hpp"
#include "boost/bind.hpp"
#include <boost/bind/bind.hpp>
#include <type_traits>
#ifdef HAVE_BOOST_CONTEXT
#include <boost/context/continuation.hpp>
......@@ -330,6 +330,8 @@ void launch_kernel(boost::context::detail::transfer_t par)
template<typename lambda_f, typename ite_type>
static void exe_kernel(lambda_f f, ite_type & ite)
{
if (ite.nthrs() == 0 || ite.nblocks() == 0) {return;}
if (mem_stack.size() < ite.nthrs())
{
int old_size = mem_stack.size();
......@@ -552,4 +554,4 @@ static void exe_kernel_no_sync(lambda_f f, ite_type & ite)
#endif
#endif
\ No newline at end of file
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment