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) {}
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
173 void FormulaGroupInterpreter::fillOpenCLInfo(std::vector<OpenCLPlatformInfo>& rPlatforms)
175 const std::vector<OpenCLPlatformInfo>& rPlatformsFromWrapper =
178 rPlatforms.assign(rPlatformsFromWrapper.begin(), rPlatformsFromWrapper.end());
181 bool FormulaGroupInterpreter::switchOpenCLDevice(
const OUString& rDeviceId,
bool bAutoSelect,
bool bForceEvaluation)
187 msInstance =
nullptr;
191 OUString aSelectedCLDeviceVersionID;
203 void 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;
219 void FormulaGroupInterpreter::enableOpenCL_UnitTestsOnly()
222 officecfg::Office::Common::Misc::UseOpenCL::set(
true, batch);
233 void FormulaGroupInterpreter::disableOpenCL_UnitTestsOnly()
236 officecfg::Office::Common::Misc::UseOpenCL::set(
false, batch);
ColArray * setCachedColArray(SCTAB nTab, SCCOL nCol, NumArrayType *pNumArray, StrArrayType *pStrArray)
static std::shared_ptr< ConfigurationChanges > create()
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)
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)
CAUTION! The following defines must be in the same namespace as the respective type.
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.
const SCCOL MAXCOLCOUNT_JUMBO
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)
bool m_bDetectedRangeSegmentation false
const std::vector< OpenCLPlatformInfo > & fillOpenCLInfo()
ColArraysType maColArrays
manage life cycle of string arrays.