From 27854070b4f9ba1d58ccd7189032e56325506597 Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Wed, 6 Jul 2016 21:50:12 +0200 Subject: Added a VERBOSE mode to debug performance: now prints details about compilation and kernel execution to screen --- src/clpp11.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/clpp11.hpp') 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 &global, const std::vector &local, EventPointer event) { -- cgit v1.2.3