[Libreoffice-commits] core.git: Branch 'feature/calc-group-interpreter-2' - sc/source

2013-09-10 Thread Kohei Yoshida
 sc/source/core/opencl/formulagroupcl.cxx |8 
 sc/source/core/tool/formulagroup.cxx |2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 69df845f854d49f86e05ee9266054b38540726b3
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Tue Sep 10 17:10:15 2013 -0400

Disable dummy and groundwater interpreters from the default build.

They are of no use in the default build.

Change-Id: Ie3b874a5c78123436736318357fa48baafd991f3

diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index 352d0bf..4fe03ae 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -18,6 +18,8 @@
 
 #include openclwrapper.hxx
 
+#define USE_GROUNDWATER_INTERPRETER 0
+
 #define SRCDATASIZE 100
 #define SINGLEARRAYLEN 100
 #define DOUBLEARRAYLEN 100
@@ -954,6 +956,8 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument 
rDoc, const ScAddress
 return false;
 }
 
+#if USE_GROUNDWATER_INTERPRETER
+
 /// Special case of formula compiler for groundwatering
 class FormulaGroupInterpreterGroundwater : public 
FormulaGroupInterpreterSoftware
 {
@@ -1068,13 +1072,17 @@ bool 
FormulaGroupInterpreterGroundwater::interpret(ScDocument rDoc, const ScAdd
 return true;
 }
 
+#endif
+
 sc::FormulaGroupInterpreter *createFormulaGroupInterpreter()
 {
 if (getenv(SC_SOFTWARE))
 return NULL;
 
+#if USE_GROUNDWATER_INTERPRETER
 if (getenv(SC_GROUNDWATER))
 return new FormulaGroupInterpreterGroundwater();
+#endif
 
 return new FormulaGroupInterpreterOpenCL();
 }
diff --git a/sc/source/core/tool/formulagroup.cxx 
b/sc/source/core/tool/formulagroup.cxx
index d8ba564..04bec4f 100644
--- a/sc/source/core/tool/formulagroup.cxx
+++ b/sc/source/core/tool/formulagroup.cxx
@@ -21,7 +21,7 @@
 #include vector
 #include boost/unordered_map.hpp
 
-#define USE_DUMMY_INTERPRETER 1
+#define USE_DUMMY_INTERPRETER 0
 
 #if USE_DUMMY_INTERPRETER
 #include cstdio
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/calc-group-interpreter-2' - sc/source

2013-09-10 Thread Kohei Yoshida
 sc/source/core/opencl/formulagroupcl.cxx |   14 +
 sc/source/core/opencl/oclkernels.hxx |5 +
 sc/source/core/opencl/openclwrapper.cxx  |   39 --
 sc/source/core/opencl/openclwrapper.hxx  |   84 +++
 sc/source/core/tool/formulagroup.cxx |2 
 5 files changed, 75 insertions(+), 69 deletions(-)

New commits:
commit 3e8fab98560f1e0b250bc1478ce84bd8ad9a8d41
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Tue Sep 10 17:01:15 2013 -0400

Put all opencl related code inside sc::opencl namespace.

Change-Id: Ia6c1fd88ed08022347c60af33a8620b9cf278c12

diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index 33eb834..352d0bf 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -7,7 +7,6 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include config_features.h
 #include formulagroup.hxx
 #include document.hxx
 #include formulacell.hxx
@@ -23,12 +22,11 @@
 #define SINGLEARRAYLEN 100
 #define DOUBLEARRAYLEN 100
 #define SVDOUBLELEN 100
-namespace sc {
+
+namespace sc { namespace opencl {
 
 // A single public entry point for a factory function:
-namespace opencl {
-extern sc::FormulaGroupInterpreter *createFormulaGroupInterpreter();
-}
+extern sc::FormulaGroupInterpreter *createFormulaGroupInterpreter();
 
 /time test dbg
 double getTimeDiff(const TimeValue t1, const TimeValue t2)
@@ -1070,17 +1068,15 @@ bool 
FormulaGroupInterpreterGroundwater::interpret(ScDocument rDoc, const ScAdd
 return true;
 }
 
-namespace opencl {
-
 sc::FormulaGroupInterpreter *createFormulaGroupInterpreter()
 {
 if (getenv(SC_SOFTWARE))
 return NULL;
 
 if (getenv(SC_GROUNDWATER))
-return new sc::FormulaGroupInterpreterGroundwater();
+return new FormulaGroupInterpreterGroundwater();
 
-return new sc::FormulaGroupInterpreterOpenCL();
+return new FormulaGroupInterpreterOpenCL();
 }
 
 } // namespace opencl
diff --git a/sc/source/core/opencl/oclkernels.hxx 
b/sc/source/core/opencl/oclkernels.hxx
index 53917b3..3e0af5b 100644
--- a/sc/source/core/opencl/oclkernels.hxx
+++ b/sc/source/core/opencl/oclkernels.hxx
@@ -12,6 +12,9 @@
 
 #ifndef USE_EXTERNAL_KERNEL
 #define KERNEL( ... )# __VA_ARGS__
+
+namespace sc { namespace opencl {
+
 // Double precision is a default of spreadsheets
 // cl_khr_fp64: Khronos extension
 // cl_amd_fp64: AMD extension
@@ -380,6 +383,8 @@ __kernel void oclSub( fp_t ltData, __global fp_t *rtData, 
__global fp_t *outData
 }
 );
 
+}}
+
 #endif // USE_EXTERNAL_KERNEL
 #endif //_OCL_KERNEL_H_
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/opencl/openclwrapper.cxx 
b/sc/source/core/opencl/openclwrapper.cxx
index 6db498b..75e991b 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -7,24 +7,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include stdio.h
-#include stdlib.h
-#include string.h
-#include cmath
+#include openclwrapper.hxx
+
 #include sal/config.h
 #include random.hxx
-#include openclwrapper.hxx
 #include oclkernels.hxx
-#ifdef SAL_WIN32
-#include Windows.h
-#endif
-//#define USE_MAP_BUFFER
-using namespace std;
-GPUEnv OpenclDevice::gpuEnv;
-int OpenclDevice::isInited =0;
 
+#include stdio.h
+#include stdlib.h
+#include string.h
+#include cmath
 
-#ifdef SAL_WIN32
+#ifdef WIN32
+#include Windows.h
 
 #define OPENCL_DLL_NAME opencllo.dll
 #define OCLERR -1
@@ -40,6 +35,16 @@ int OpenclDevice::isInited =0;
 #define OCL_CHECK(value1,value2,str) \
 if(value1!=value2) \
 fprintf(stderr,[OCL_ERROR] %s\n,str);
+#endif
+
+using namespace std;
+
+namespace sc { namespace opencl {
+
+GPUEnv OpenclDevice::gpuEnv;
+int OpenclDevice::isInited =0;
+
+#ifdef WIN32
 
 HINSTANCE HOpenclDll = NULL;
 void * OpenclDll = NULL;
@@ -69,7 +74,7 @@ void OpenclDevice::freeOpenclDll()
 
 int OpenclDevice::initEnv()
 {
-#ifdef SAL_WIN32
+#ifdef WIN32
 while( 1 )
 {
 if( 1 == loadOpencl() )
@@ -83,14 +88,14 @@ int OpenclDevice::initEnv()
 int OpenclDevice::releaseOpenclRunEnv()
 {
 releaseOpenclEnv( gpuEnv );
-#ifdef SAL_WIN32
+#ifdef WIN32
 freeOpenclDll();
 #endif
 return 1;
 }
 ///
 ///
-inline int OpenclDevice::addKernelConfig( int kCount, const char *kName )
+int OpenclDevice::addKernelConfig( int kCount, const char *kName )
 {
 if ( kCount  1 )
 fprintf(stderr,Error: ( KCount  1 ) SAL_DETAIL_WHERE 
addKernelConfig\n );
@@ -2660,4 +2665,6 @@ int OclCalc::oclHostMatrixInverse32Bits( const char* 
aKernelName, float *fpOclMa
 return 0;
 }
 
+}}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/opencl/openclwrapper.hxx 
b/sc/source/core/opencl/openclwrapper.hxx
index cf3b4f1..d1e8925 

[Libreoffice-commits] core.git: Branch 'feature/calc-group-interpreter-2' - sc/source

2013-09-05 Thread Kohei Yoshida
 sc/source/core/data/column2.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit 7212c44103d8bd98b1152e45ac8fa27ce0a94c15
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Thu Sep 5 20:29:18 2013 -0400

Handle string or edit cells when resolving static reference for group calc.

Change-Id: Ifb2d0d6e7c9f3040bca61b5bdce14d853058d954

diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 5c5e28a..2098921 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1849,6 +1849,17 @@ formula::FormulaTokenRef 
ScColumn::ResolveStaticReference( SCROW nRow )
 
 return formula::FormulaTokenRef(new 
formula::FormulaStringToken(p-GetString()));
 }
+case sc::element_type_string:
+{
+OUString aStr = sc::string_block::at(*it-data, aPos.second);
+return formula::FormulaTokenRef(new 
formula::FormulaStringToken(aStr));
+}
+case sc::element_type_edittext:
+{
+const EditTextObject* pText = sc::edittext_block::at(*it-data, 
aPos.second);
+OUString aStr = ScEditUtil::GetString(*pText, pDocument);
+return formula::FormulaTokenRef(new 
formula::FormulaStringToken(aStr));
+}
 case sc::element_type_empty:
 default:
 // Return a value of 0.0 in all the other cases.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits