Commit 7ddeb944 authored by Paul's avatar Paul
Browse files

Only run __syncthreads when there is data to preload

parent 2783c649
...@@ -186,7 +186,8 @@ __device__ auto auto_preload(index idx) ...@@ -186,7 +186,8 @@ __device__ auto auto_preload(index idx)
{ {
return make_transform([=](auto f, auto... xs) { return make_transform([=](auto f, auto... xs) {
auto invoke = [=](auto... ys) { auto invoke = [=](auto... ys) {
__syncthreads(); if constexpr((Bs or ...))
__syncthreads();
f(ys...); f(ys...);
}; };
join(invoke, preload_copy<Bs>(idx, xs)...); join(invoke, preload_copy<Bs>(idx, xs)...);
......
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