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 SOCUDAARITHMETIC_H
00024 #define SOCUDAARITHMETIC_H
00025
00026 #include <Inventor/SbString.h>
00027 #include <Inventor/SbDataType.h>
00028
00029 #include <Inventor/STL/vector>
00030
00031 #include <Inventor/algorithms/SoArithmetic.h>
00032
00033 #include <Inventor/cuda/algorithms/SoCudaAlgorithmsDefs.h>
00034
00035 class SoCudaHandle;
00036 class SoCudaBufferObject;
00037
00059 class SoCudaArithmetic : public SoArithmetic
00060 {
00061 private:
00065 static void initClass();
00066
00070 static void exitClass();
00071
00075 ~SoCudaArithmetic();
00076
00077 public:
00081 SoCudaArithmetic();
00082
00092 virtual int add(
00093 SoBufferObject* inputBufferA, const SbDataType typeA,
00094 SoBufferObject* inputBufferB, const SbDataType typeB,
00095 SoBufferObject* outputBufferC, const SbDataType typeC );
00096
00102 int add(
00103 SoCudaBufferObject* inputBufferA, const SbDataType typeA,
00104 SoCudaBufferObject* inputBufferB, const SbDataType typeB,
00105 SoCudaBufferObject* outputBufferC, const SbDataType typeC
00106 );
00107
00108
00117 virtual int mult(
00118 SoBufferObject* intpuBufferA, const SbDataType typeA,
00119 SoBufferObject* intpuBufferB, const SbDataType typeB,
00120 SoBufferObject* outputBufferC, const SbDataType typeC
00121 );
00122
00128 int mult(
00129 SoCudaBufferObject* inputBufferA, const SbDataType typeA,
00130 SoCudaBufferObject* inputBufferB, const SbDataType typeB,
00131 SoCudaBufferObject* outputBufferC, const SbDataType typeC
00132 );
00133
00141 virtual int scale(
00142 SoBufferObject* inputBufferA, const SbDataType typeA,
00143 SoBufferObject* outputBufferB, const SbDataType typeB,
00144 const float scaleValue
00145 );
00146
00152 int scale(
00153 SoCudaBufferObject* inputBufferA, const SbDataType typeA,
00154 SoCudaBufferObject* outputBufferB, const SbDataType typeB,
00155 const float scaleValue
00156 );
00157
00165 virtual int shift(
00166 SoBufferObject* inputBufferA, const SbDataType typeA,
00167 SoBufferObject* outputBufferB, const SbDataType typeB,
00168 const float shiftFactor
00169 );
00170
00176 int shift(
00177 SoCudaBufferObject* inputBufferA, const SbDataType typeA,
00178 SoCudaBufferObject* outputBufferB, const SbDataType typeB,
00179 const float shiftFactor
00180 );
00181
00189 virtual int madd(
00190 SoBufferObject* inputBufferA, const SbDataType typeA,
00191 SoBufferObject* inputBufferB, const SbDataType typeB,
00192 SoBufferObject* outputBufferC, const SbDataType typeC,
00193 const float scaleValue
00194 );
00195
00201 int madd(
00202 SoCudaBufferObject* inputBufferA, const SbDataType typeA,
00203 SoCudaBufferObject* inputBufferB, const SbDataType typeB,
00204 SoCudaBufferObject* outputBufferC, const SbDataType typeC,
00205 const float scaleValue
00206 );
00207
00208 private:
00209
00210 SoCudaHandle* m_addFunctionHandle;
00211
00212 SoCudaHandle* m_multFunctionHandle;
00213
00214 SoCudaHandle* m_scaleFunctionHandle;
00215
00216 SoCudaHandle* m_shiftFunctionHandle;
00217
00218 SoCudaHandle* m_madFunctionHandle;
00219 };
00220
00221 #endif // SOCUDAARITHMETIC_H
00222
00223