From 4b8486c78865493289af411158fe3d43717a1896 Mon Sep 17 00:00:00 2001 From: i-bird Date: Sun, 10 Jan 2021 23:34:50 +0100 Subject: [PATCH] Fixing CUDA on CPU in case of no work --- src/util/cudify/cudify_sequencial.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util/cudify/cudify_sequencial.hpp b/src/util/cudify/cudify_sequencial.hpp index 06de3a2..1172070 100644 --- a/src/util/cudify/cudify_sequencial.hpp +++ b/src/util/cudify/cudify_sequencial.hpp @@ -12,7 +12,7 @@ #define CUDIFY_ACTIVE #include "util/cuda_util.hpp" -#include "boost/bind.hpp" +#include #include #ifdef HAVE_BOOST_CONTEXT #include @@ -330,6 +330,8 @@ void launch_kernel(boost::context::detail::transfer_t par) template 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 -- GitLab