10 #include <config_feature_opencl.h>
14 #include <document.hxx>
19 #include <officecfg/Office/Common.hxx>
20 #if HAVE_FEATURE_OPENCL
26 #include <unordered_map>
29 #if HAVE_FEATURE_OPENCL
36 mpCells(pCells),
mnRow(nRow), mnLength(nLength), mbShared(true) {}
39 mpCell(pCell),
mnRow(nRow), mnLength(0), mbShared(false) {}
54 mpNumArray(pNumArray), mpStrArray(pStrArray),
mnSize(0)
69 ColArray& rCached = itColArray->second;
70 if (nSize > rCached.
mnSize)
83 std::pair<ColArraysType::iterator,bool> r =
90 return &r.first->second;
95 rArray =
ColArray(pNumArray, pStrArray);
112 std::make_unique<sc::FormulaGroupContext::StrArrayType>(nArrayLen,
nullptr));
122 rtl::math::setNan(&fNan);
125 std::make_unique<sc::FormulaGroupContext::NumArrayType>(nArrayLen, fNan));
154 #if HAVE_FEATURE_OPENCL
162 SAL_WARN(
"opencl",
"OpenCL forced but failed to initialize" );
173 #if HAVE_FEATURE_OPENCL
174 void FormulaGroupInterpreter::fillOpenCLInfo(std::vector<OpenCLPlatformInfo>& rPlatforms)
176 const std::vector<OpenCLPlatformInfo>& rPlatformsFromWrapper =
179 rPlatforms.assign(rPlatformsFromWrapper.begin(), rPlatformsFromWrapper.end());
182 bool FormulaGroupInterpreter::switchOpenCLDevice(
const OUString& rDeviceId,
bool bAutoSelect,
bool bForceEvaluation)
188 msInstance =
nullptr;
192 OUString aSelectedCLDeviceVersionID;
204 void FormulaGroupInterpreter::getOpenCLDeviceInfo(sal_Int32& rDeviceId, sal_Int32& rPlatformId)
212 size_t aDeviceId =
static_cast<size_t>(-1);
213 size_t aPlatformId =
static_cast<size_t>(-1);
216 rDeviceId = aDeviceId;
217 rPlatformId = aPlatformId;
220 void FormulaGroupInterpreter::enableOpenCL_UnitTestsOnly()
223 officecfg::Office::Common::Misc::UseOpenCL::set(
true, batch);
234 void FormulaGroupInterpreter::disableOpenCL_UnitTestsOnly()
237 officecfg::Office::Common::Misc::UseOpenCL::set(
false, batch);
ColArray * setCachedColArray(SCTAB nTab, SCCOL nCol, NumArrayType *pNumArray, StrArrayType *pStrArray)
void getOpenCLDeviceInfo(size_t &rDeviceId, size_t &rPlatformId)
bool switchOpenCLDevice(const OUString *pDeviceId, bool bAutoSelect, bool bForceEvaluation, OUString &rOutSelectedDeviceVersionIDString)
ColArray * getCachedColArray(SCTAB nTab, SCCOL nCol, size_t nSize)
keep track of longest array for each column.
size_t operator()(const ColKey &rKey) const
static ForceCalculationType getForceCalculationType()
void ensureStrArray(ColArray &rColArray, size_t nArrayLen)
ColArray(NumArrayType *pNumArray, StrArrayType *pStrArray)
static std::shared_ptr< ConfigurationChanges > create(css::uno::Reference< css::uno::XComponentContext > const &context=comphelper::getProcessComponentContext())
std::vector< double, DoubleAllocType > NumArrayType
bool operator==(const ColKey &r) const
StrArrayStoreType m_StrArrays
manage life cycle of numeric arrays.
void discardCachedColArray(SCTAB nTab, SCCOL nCol)
NumArrayType * mpNumArray
static void SetGlobalConfig(const ScCalcConfig &rConfig)
ColKey(SCTAB nTab, SCCOL nCol)
StrArrayType * mpStrArray
FormulaGroupEntry(ScFormulaCell **pCells, size_t nRow, size_t nLength)
std::vector< rtl_uString * > StrArrayType
static const ScCalcConfig & GetGlobalConfig()
static bool isOpenCLEnabled()
Configuration options for formula interpreter.
sal_Int32 mnOpenCLMinimumFormulaGroupSize
NumArrayStoreType m_NumArrays
const ScCalcConfig & GetCalcConfig() const
void ensureNumArray(ColArray &rColArray, size_t nArrayLen)
#define OPENCL_SOFTWARE_DEVICE_CONFIG_NAME
#define SAL_WARN(area, stream)
const std::vector< OpenCLPlatformInfo > & fillOpenCLInfo()
ColArraysType maColArrays
manage life cycle of string arrays.