diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2016-07-06 21:50:12 +0200 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2016-07-06 21:50:12 +0200 |
commit | 27854070b4f9ba1d58ccd7189032e56325506597 (patch) | |
tree | a2e1b393ad06668f00ac7f5701d53df10a97fb4c /src/clpp11.hpp | |
parent | 77325b8974e19188fc5afad1447d4df4f9ae30fd (diff) |
Added a VERBOSE mode to debug performance: now prints details about compilation and kernel execution to screen
Diffstat (limited to 'src/clpp11.hpp')
-rw-r--r-- | src/clpp11.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/clpp11.hpp b/src/clpp11.hpp index 2b21e1e1..fcb71e38 100644 --- a/src/clpp11.hpp +++ b/src/clpp11.hpp @@ -664,6 +664,16 @@ class Kernel { return result; } + // Retrieves the name of the kernel + std::string GetFunctionName() { + auto bytes = size_t{0}; + CheckError(clGetKernelInfo(*kernel_, CL_KERNEL_FUNCTION_NAME, 0, nullptr, &bytes)); + auto result = std::string{}; + result.resize(bytes); + CheckError(clGetKernelInfo(*kernel_, CL_KERNEL_FUNCTION_NAME, bytes, &result[0], nullptr)); + return std::string{result.c_str()}; // Removes any trailing '\0'-characters + } + // Launches a kernel onto the specified queue void Launch(const Queue &queue, const std::vector<size_t> &global, const std::vector<size_t> &local, EventPointer event) { |