diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2018-05-31 22:37:06 +0200 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2018-05-31 22:37:06 +0200 |
commit | 5702bff5ad579466397f6537dc8925ebd64e3ba3 (patch) | |
tree | b375ab600530fda9ac42aa0ab908b1f8fcd7042a /src/routines/common.cpp | |
parent | e609220393654e5400b0acd0d362367f5fe28ab8 (diff) |
Added error-checking for half-empty local work group sizes; fixed a minor TRSV global worksize issue
Diffstat (limited to 'src/routines/common.cpp')
-rw-r--r-- | src/routines/common.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/routines/common.cpp b/src/routines/common.cpp index d3c402bd..695785c4 100644 --- a/src/routines/common.cpp +++ b/src/routines/common.cpp @@ -13,6 +13,7 @@ #include <vector> #include <chrono> +#include <iostream> #include "routines/common.hpp" @@ -46,6 +47,14 @@ void RunKernel(Kernel &kernel, Queue &queue, const Device &device, for (auto i=size_t{0}; i<global.size(); ++i) { if (global[i] < local[i]) { global[i] = local[i]; } } + + // Verify that the global thread sizes are a multiple of the local sizes + for (auto i=size_t{0}; i<global.size(); ++i) { + if ((global[i] / local[i]) * local[i] != global[i]) { + throw RuntimeErrorCode(StatusCode::kInvalidLocalThreadsDim, + ToString(global[i]) + " is not divisible by " + ToString(local[i])); + } + } } // Tests for local memory usage |