diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-10-03 12:08:49 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-10-03 15:31:32 -0400 |
commit | 9ed7f53a96a41534338eeef27e6fa3c6c3de9b85 (patch) | |
tree | 8dc5566c5ebc0ed442c6e1d3c5763852479f27d0 /sc | |
parent | 2549b21b5226c30d900f5994d45b7b08c15935d6 (diff) |
Make these non-inline.
Change-Id: I1cc28c16796934f20afc53c6f6f083f372b7ce69
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/opencl/opbase.cxx | 71 | ||||
-rw-r--r-- | sc/source/core/opencl/opbase.hxx | 73 |
2 files changed, 77 insertions, 67 deletions
diff --git a/sc/source/core/opencl/opbase.cxx b/sc/source/core/opencl/opbase.cxx index 17996e9d4c08..e1aef1f3f3f1 100644 --- a/sc/source/core/opencl/opbase.cxx +++ b/sc/source/core/opencl/opbase.cxx @@ -13,6 +13,77 @@ using namespace formula; namespace sc { namespace opencl { +UnhandledToken::UnhandledToken( + formula::FormulaToken* t, const char* m, const std::string& fn, int ln ) : + mToken(t), mMessage(m), mFile(fn), mLineNumber(ln) {} + +OpenCLError::OpenCLError( cl_int err, const std::string& fn, int ln ) : + mError(err), mFile(fn), mLineNumber(ln) +{ + SAL_INFO("sc.opencl", "OpenCLError:" << mError << ": " << strerror(mError)); +} + +const char* OpenCLError::strerror( cl_int i ) const +{ +#define CASE(val) case val: return #val + switch (i) + { + CASE(CL_SUCCESS); + CASE(CL_DEVICE_NOT_FOUND); + CASE(CL_DEVICE_NOT_AVAILABLE); + CASE(CL_COMPILER_NOT_AVAILABLE); + CASE(CL_MEM_OBJECT_ALLOCATION_FAILURE); + CASE(CL_OUT_OF_RESOURCES); + CASE(CL_OUT_OF_HOST_MEMORY); + CASE(CL_PROFILING_INFO_NOT_AVAILABLE); + CASE(CL_MEM_COPY_OVERLAP); + CASE(CL_IMAGE_FORMAT_MISMATCH); + CASE(CL_IMAGE_FORMAT_NOT_SUPPORTED); + CASE(CL_BUILD_PROGRAM_FAILURE); + CASE(CL_MAP_FAILURE); + CASE(CL_INVALID_VALUE); + CASE(CL_INVALID_DEVICE_TYPE); + CASE(CL_INVALID_PLATFORM); + CASE(CL_INVALID_DEVICE); + CASE(CL_INVALID_CONTEXT); + CASE(CL_INVALID_QUEUE_PROPERTIES); + CASE(CL_INVALID_COMMAND_QUEUE); + CASE(CL_INVALID_HOST_PTR); + CASE(CL_INVALID_MEM_OBJECT); + CASE(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR); + CASE(CL_INVALID_IMAGE_SIZE); + CASE(CL_INVALID_SAMPLER); + CASE(CL_INVALID_BINARY); + CASE(CL_INVALID_BUILD_OPTIONS); + CASE(CL_INVALID_PROGRAM); + CASE(CL_INVALID_PROGRAM_EXECUTABLE); + CASE(CL_INVALID_KERNEL_NAME); + CASE(CL_INVALID_KERNEL_DEFINITION); + CASE(CL_INVALID_KERNEL); + CASE(CL_INVALID_ARG_INDEX); + CASE(CL_INVALID_ARG_VALUE); + CASE(CL_INVALID_ARG_SIZE); + CASE(CL_INVALID_KERNEL_ARGS); + CASE(CL_INVALID_WORK_DIMENSION); + CASE(CL_INVALID_WORK_GROUP_SIZE); + CASE(CL_INVALID_WORK_ITEM_SIZE); + CASE(CL_INVALID_GLOBAL_OFFSET); + CASE(CL_INVALID_EVENT_WAIT_LIST); + CASE(CL_INVALID_EVENT); + CASE(CL_INVALID_OPERATION); + CASE(CL_INVALID_GL_OBJECT); + CASE(CL_INVALID_BUFFER_SIZE); + CASE(CL_INVALID_MIP_LEVEL); + CASE(CL_INVALID_GLOBAL_WORK_SIZE); + default: + return "Unknown OpenCL error code"; + } +#undef CASE +} + +Unhandled::Unhandled( const std::string& fn, int ln ) : + mFile(fn), mLineNumber(ln) {} + DynamicKernelArgument::DynamicKernelArgument( const std::string& s, FormulaTreeNodeRef ft ) : mSymName(s), mFormulaTree(ft) { } diff --git a/sc/source/core/opencl/opbase.hxx b/sc/source/core/opencl/opbase.hxx index 795b7bb6623b..125d24d30acc 100644 --- a/sc/source/core/opencl/opbase.hxx +++ b/sc/source/core/opencl/opbase.hxx @@ -31,9 +31,7 @@ class FormulaTreeNode; class UnhandledToken { public: - UnhandledToken( formula::FormulaToken* t, - const char* m, const std::string& fn = "", int ln = 0 ) : - mToken(t), mMessage(m), mFile(fn), mLineNumber(ln) {} + UnhandledToken( formula::FormulaToken* t, const char* m, const std::string& fn = "", int ln = 0 ); formula::FormulaToken* mToken; std::string mMessage; @@ -45,70 +43,11 @@ public: class OpenCLError { private: - const char* strerror( cl_int i ) - { -#define CASE(val) case val: return #val - switch (i) - { - CASE(CL_SUCCESS); - CASE(CL_DEVICE_NOT_FOUND); - CASE(CL_DEVICE_NOT_AVAILABLE); - CASE(CL_COMPILER_NOT_AVAILABLE); - CASE(CL_MEM_OBJECT_ALLOCATION_FAILURE); - CASE(CL_OUT_OF_RESOURCES); - CASE(CL_OUT_OF_HOST_MEMORY); - CASE(CL_PROFILING_INFO_NOT_AVAILABLE); - CASE(CL_MEM_COPY_OVERLAP); - CASE(CL_IMAGE_FORMAT_MISMATCH); - CASE(CL_IMAGE_FORMAT_NOT_SUPPORTED); - CASE(CL_BUILD_PROGRAM_FAILURE); - CASE(CL_MAP_FAILURE); - CASE(CL_INVALID_VALUE); - CASE(CL_INVALID_DEVICE_TYPE); - CASE(CL_INVALID_PLATFORM); - CASE(CL_INVALID_DEVICE); - CASE(CL_INVALID_CONTEXT); - CASE(CL_INVALID_QUEUE_PROPERTIES); - CASE(CL_INVALID_COMMAND_QUEUE); - CASE(CL_INVALID_HOST_PTR); - CASE(CL_INVALID_MEM_OBJECT); - CASE(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR); - CASE(CL_INVALID_IMAGE_SIZE); - CASE(CL_INVALID_SAMPLER); - CASE(CL_INVALID_BINARY); - CASE(CL_INVALID_BUILD_OPTIONS); - CASE(CL_INVALID_PROGRAM); - CASE(CL_INVALID_PROGRAM_EXECUTABLE); - CASE(CL_INVALID_KERNEL_NAME); - CASE(CL_INVALID_KERNEL_DEFINITION); - CASE(CL_INVALID_KERNEL); - CASE(CL_INVALID_ARG_INDEX); - CASE(CL_INVALID_ARG_VALUE); - CASE(CL_INVALID_ARG_SIZE); - CASE(CL_INVALID_KERNEL_ARGS); - CASE(CL_INVALID_WORK_DIMENSION); - CASE(CL_INVALID_WORK_GROUP_SIZE); - CASE(CL_INVALID_WORK_ITEM_SIZE); - CASE(CL_INVALID_GLOBAL_OFFSET); - CASE(CL_INVALID_EVENT_WAIT_LIST); - CASE(CL_INVALID_EVENT); - CASE(CL_INVALID_OPERATION); - CASE(CL_INVALID_GL_OBJECT); - CASE(CL_INVALID_BUFFER_SIZE); - CASE(CL_INVALID_MIP_LEVEL); - CASE(CL_INVALID_GLOBAL_WORK_SIZE); - default: - return "Unknown OpenCL error code"; - } -#undef CASE - } + const char* strerror( cl_int i ) const; public: - OpenCLError( cl_int err, const std::string& fn, int ln ) : mError(err), - mFile(fn), mLineNumber(ln) - { - SAL_INFO("sc.opencl", "OpenCLError:" << mError << ": " << strerror(mError)); - } + OpenCLError( cl_int err, const std::string& fn, int ln ); + cl_int mError; std::string mFile; int mLineNumber; @@ -118,8 +57,8 @@ public: class Unhandled { public: - Unhandled( const std::string& fn = "", int ln = 0 ) : - mFile(fn), mLineNumber(ln) { } + Unhandled( const std::string& fn = "", int ln = 0 ); + std::string mFile; int mLineNumber; }; |