10#include <config_feature_opencl.h>
14#include <document.hxx>
19#include <officecfg/Office/Common.hxx>
20#if HAVE_FEATURE_OPENCL
27#include <unordered_map>
30#if HAVE_FEATURE_OPENCL
37 mpCells(pCells),
mnRow(nRow), mnLength(
nLength), mbShared(true) {}
40 mpCell(pCell),
mnRow(nRow), mnLength(0), mbShared(false) {}
55 mpNumArray(pNumArray), mpStrArray(pStrArray),
mnSize(0)
70 ColArray& rCached = itColArray->second;
71 if (nSize > rCached.
mnSize)
84 std::pair<ColArraysType::iterator,bool> r =
91 return &r.first->second;
96 rArray =
ColArray(pNumArray, pStrArray);
113 std::make_unique<sc::FormulaGroupContext::StrArrayType>(nArrayLen,
nullptr));
123 std::make_unique<sc::FormulaGroupContext::NumArrayType>(nArrayLen,
124 std::numeric_limits<double>::quiet_NaN()));
153#if HAVE_FEATURE_OPENCL
161 SAL_WARN(
"opencl",
"OpenCL forced but failed to initialize" );
172#if HAVE_FEATURE_OPENCL
173void FormulaGroupInterpreter::fillOpenCLInfo(std::vector<OpenCLPlatformInfo>& rPlatforms)
175 const std::vector<OpenCLPlatformInfo>& rPlatformsFromWrapper =
178 rPlatforms.assign(rPlatformsFromWrapper.begin(), rPlatformsFromWrapper.end());
181bool FormulaGroupInterpreter::switchOpenCLDevice(std::u16string_view rDeviceId,
bool bAutoSelect,
bool bForceEvaluation)
187 msInstance =
nullptr;
191 OUString aSelectedCLDeviceVersionID;
203void FormulaGroupInterpreter::getOpenCLDeviceInfo(sal_Int32& rDeviceId, sal_Int32& rPlatformId)
211 size_t aDeviceId =
static_cast<size_t>(-1);
212 size_t aPlatformId =
static_cast<size_t>(-1);
215 rDeviceId = aDeviceId;
216 rPlatformId = aPlatformId;
219void FormulaGroupInterpreter::enableOpenCL_UnitTestsOnly()
222 officecfg::Office::Common::Misc::UseOpenCL::set(
true, batch);
233void FormulaGroupInterpreter::disableOpenCL_UnitTestsOnly()
236 officecfg::Office::Common::Misc::UseOpenCL::set(
false, batch);
const SCCOL MAXCOLCOUNT_JUMBO
const ScCalcConfig & GetCalcConfig() const
static void SetGlobalConfig(const ScCalcConfig &rConfig)
static const ScCalcConfig & GetGlobalConfig()
static std::shared_ptr< ConfigurationChanges > create()
#define OPENCL_SOFTWARE_DEVICE_CONFIG_NAME
#define SAL_WARN(area, stream)
bool switchOpenCLDevice(std::u16string_view aDevice, bool bAutoSelect, bool bForceEvaluation, OUString &rOutSelectedDeviceVersionIDString)
const std::vector< OpenCLPlatformInfo > & fillOpenCLInfo()
void getOpenCLDeviceInfo(size_t &rDeviceId, size_t &rPlatformId)
CAUTION! The following defines must be in the same namespace as the respective type.
Configuration options for formula interpreter.
sal_Int32 mnOpenCLMinimumFormulaGroupSize
static bool isOpenCLEnabled()
static ForceCalculationType getForceCalculationType()
StrArrayType * mpStrArray
NumArrayType * mpNumArray
ColArray(NumArrayType *pNumArray, StrArrayType *pStrArray)
size_t operator()(const ColKey &rKey) const
ColKey(SCTAB nTab, SCCOL nCol)
bool operator==(const ColKey &r) const
std::vector< rtl_uString * > StrArrayType
std::vector< double, DoubleAllocType > NumArrayType
StrArrayStoreType m_StrArrays
manage life cycle of numeric arrays.
void ensureNumArray(ColArray &rColArray, size_t nArrayLen)
void discardCachedColArray(SCTAB nTab, SCCOL nCol)
ColArray * setCachedColArray(SCTAB nTab, SCCOL nCol, NumArrayType *pNumArray, StrArrayType *pStrArray)
ColArray * getCachedColArray(SCTAB nTab, SCCOL nCol, size_t nSize)
keep track of longest array for each column.
NumArrayStoreType m_NumArrays
ColArraysType maColArrays
manage life cycle of string arrays.
void ensureStrArray(ColArray &rColArray, size_t nArrayLen)
FormulaGroupEntry(ScFormulaCell **pCells, size_t nRow, size_t nLength)