diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-02-05 12:10:03 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2020-02-07 09:13:34 +0100 |
commit | 3fd32d48bf7d59175c59a224cf7a481eee5c158a (patch) | |
tree | f2f5e84ec25d015a3922f393c76a5f1772e76889 /sc | |
parent | 8a2a9d2809ed0664c2e47d634e1c2c6c6493d251 (diff) |
add OpenCLZone in suitable places in Calc's OpenCL code
Change-Id: I0ce230a9a876c2f1fdbcd7ed81a1aba043cc5fb8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88012
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/opencl/formulagroupcl.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index af591f871f55..9ed14b24929d 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -20,6 +20,7 @@ #include <rtl/math.hxx> #include <opencl/openclwrapper.hxx> +#include <opencl/OpenCLZone.hxx> #include "op_financial.hxx" #include "op_database.hxx" @@ -259,6 +260,7 @@ OUString DebugPeekDoubles(const double* data, int size) /// Map the buffer used by an argument and do necessary argument setting size_t VectorRef::Marshal( cl_kernel k, int argno, int, cl_program ) { + OpenCLZone zone; FormulaToken* ref = mFormulaTree->GetFormulaToken(); double* pHostBuffer = nullptr; size_t szHostBuffer = 0; @@ -382,6 +384,7 @@ public: /// Pass the 32-bit hash of the string to the kernel virtual size_t Marshal( cl_kernel k, int argno, int, cl_program ) override { + OpenCLZone zone; FormulaToken* ref = mFormulaTree->GetFormulaToken(); cl_uint hashCode = 0; if (ref->GetType() != formula::svString) @@ -441,6 +444,7 @@ public: /// Create buffer and pass the buffer to a given kernel virtual size_t Marshal( cl_kernel k, int argno, int, cl_program ) override { + OpenCLZone zone; double tmp = GetDouble(); // Pass the scalar result back to the rest of the formula kernel SAL_INFO("sc.opencl", "Kernel " << k << " arg " << argno << ": double: " << tmp); @@ -481,6 +485,7 @@ public: /// Create buffer and pass the buffer to a given kernel virtual size_t Marshal( cl_kernel k, int argno, int, cl_program ) override { + OpenCLZone zone; double tmp = 0.0; // Pass the scalar result back to the rest of the formula kernel SAL_INFO("sc.opencl", "Kernel " << k << " arg " << argno << ": double: " << tmp << " (PI)"); @@ -846,6 +851,7 @@ threefry2x32 (threefry2x32_ctr_t in, threefry2x32_key_t k)\n\ /// Create buffer and pass the buffer to a given kernel virtual size_t Marshal( cl_kernel k, int argno, int, cl_program ) override { + OpenCLZone zone; cl_int seed = comphelper::rng::uniform_int_distribution(0, SAL_MAX_INT32); // Pass the scalar result back to the rest of the formula kernel SAL_INFO("sc.opencl", "Kernel " << k << " arg " << argno << ": cl_int: " << seed << "(RANDOM)"); @@ -882,6 +888,7 @@ public: /// Marshal a string vector reference size_t DynamicKernelStringArgument::Marshal( cl_kernel k, int argno, int, cl_program ) { + OpenCLZone zone; FormulaToken* ref = mFormulaTree->GetFormulaToken(); openclwrapper::KernelEnv kEnv; @@ -2172,6 +2179,7 @@ size_t ParallelReductionVectorRef<Base>::Marshal( cl_kernel k, int argno, int w, { assert(Base::mpClmem == nullptr); + OpenCLZone zone; openclwrapper::KernelEnv kEnv; openclwrapper::setKernelEnv(&kEnv); cl_int err; @@ -2355,6 +2363,7 @@ public: /// Create buffer and pass the buffer to a given kernel virtual size_t Marshal( cl_kernel k, int argno, int nVectorWidth, cl_program pProgram ) override { + OpenCLZone zone; unsigned i = 0; for (const auto& rxSubArgument : mvSubArguments) { @@ -3957,6 +3966,7 @@ void DynamicKernel::CreateKernel() std::string kname = "DynamicKernel" + mKernelSignature; // Compile kernel here!!! + OpenCLZone zone; openclwrapper::KernelEnv kEnv; openclwrapper::setKernelEnv(&kEnv); const char* src = mFullProgramSrc.c_str(); @@ -4071,6 +4081,7 @@ void DynamicKernel::CreateKernel() void DynamicKernel::Launch( size_t nr ) { + OpenCLZone zone; openclwrapper::KernelEnv kEnv; openclwrapper::setKernelEnv(&kEnv); cl_int err; @@ -4249,6 +4260,8 @@ public: if (!isValid()) return; + OpenCLZone zone; + // Map results back mpCLResBuf = mpKernel->GetResultBuffer(); @@ -4276,6 +4289,8 @@ public: if (!mpResBuf) return false; + OpenCLZone zone; + rDoc.SetFormulaResults(rTopPos, mpResBuf, mnGroupLength); openclwrapper::KernelEnv kEnv; @@ -4377,6 +4392,7 @@ void genRPNTokens( ScDocument& rDoc, const ScAddress& rTopPos, ScTokenArray& rCo bool waitForResults() { + OpenCLZone zone; openclwrapper::KernelEnv kEnv; openclwrapper::setKernelEnv(&kEnv); |