Commit 4b8486c7 authored by i-bird's avatar i-bird

Fixing CUDA on CPU in case of no work

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