00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined SOOPENCLARITHMETIC_H
00024 #define SOOPENCLARITHMETIC_H
00025
00026 #include <Inventor/SbString.h>
00027 #include <Inventor/SbDataType.h>
00028
00029 #include <Inventor/STL/vector>
00030 #include <Inventor/STL/map>
00031
00032 #include <Inventor/algorithms/SoArithmetic.h>
00033
00034 #include <Inventor/OpenCL/algorithms/SoOpenCLAlgorithmsDefs.h>
00035
00036 class SoOpenCLHandle;
00037 class SoOpenCLBufferObject;
00038
00060 class INVENTOROPENCLALGORITHMS_API SoOpenCLArithmetic : public SoArithmetic
00061 {
00062 private:
00066 static void initClass();
00067
00071 static void exitClass();
00072
00076 ~SoOpenCLArithmetic();
00077
00078 public:
00082 SoOpenCLArithmetic();
00083
00093 virtual int add(
00094 SoBufferObject* inputBufferA, const SbDataType typeA,
00095 SoBufferObject* inputBufferB, const SbDataType typeB,
00096 SoBufferObject* outputBufferC, const SbDataType typeC );
00097
00103 int add(
00104 SoOpenCLBufferObject* inputBufferA, const SbDataType typeA,
00105 SoOpenCLBufferObject* inputBufferB, const SbDataType typeB,
00106 SoOpenCLBufferObject* outputBufferC, const SbDataType typeC
00107 );
00108
00109
00118 virtual int mult(
00119 SoBufferObject* intpuBufferA, const SbDataType typeA,
00120 SoBufferObject* intpuBufferB, const SbDataType typeB,
00121 SoBufferObject* outputBufferC, const SbDataType typeC
00122 );
00123
00129 int mult(
00130 SoOpenCLBufferObject* inputBufferA, const SbDataType typeA,
00131 SoOpenCLBufferObject* inputBufferB, const SbDataType typeB,
00132 SoOpenCLBufferObject* outputBufferC, const SbDataType typeC
00133 );
00134
00142 virtual int scale(
00143 SoBufferObject* inputBufferA, const SbDataType typeA,
00144 SoBufferObject* outputBufferB, const SbDataType typeB,
00145 const float scaleValue
00146 );
00147
00153 int scale(
00154 SoOpenCLBufferObject* inputBufferA, const SbDataType typeA,
00155 SoOpenCLBufferObject* outputBufferB, const SbDataType typeB,
00156 const float scaleValue
00157 );
00158
00166 virtual int shift(
00167 SoBufferObject* inputBufferA, const SbDataType typeA,
00168 SoBufferObject* outputBufferB, const SbDataType typeB,
00169 const float shiftFactor
00170 );
00171
00177 int shift(
00178 SoOpenCLBufferObject* inputBufferA, const SbDataType typeA,
00179 SoOpenCLBufferObject* outputBufferB, const SbDataType typeB,
00180 const float shiftFactor
00181 );
00182
00190 virtual int madd(
00191 SoBufferObject* inputBufferA, const SbDataType typeA,
00192 SoBufferObject* inputBufferB, const SbDataType typeB,
00193 SoBufferObject* outputBufferC, const SbDataType typeC,
00194 const float scaleValue
00195 );
00196
00202 int madd(
00203 SoOpenCLBufferObject* inputBufferA, const SbDataType typeA,
00204 SoOpenCLBufferObject* inputBufferB, const SbDataType typeB,
00205 SoOpenCLBufferObject* outputBufferC, const SbDataType typeC,
00206 const float scaleValue
00207 );
00208
00209 private:
00210
00211
00212 std::map<SbDataType,SoOpenCLHandle*> m_addFunctionHandles;
00213 std::map<SbDataType,SoOpenCLHandle*> m_scaleFunctionHandles;
00214 std::map<SbDataType,SoOpenCLHandle*> m_multFunctionHandles;
00215 std::map<SbDataType,SoOpenCLHandle*> m_shiftFunctionHandles;
00216 std::map<SbDataType,SoOpenCLHandle*> m_madFunctionHandles;
00217 };
00218
00219 #endif // SOOPENCLARITHMETIC_H
00220
00221