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 SOCUDAAPI_H
00024 #define SOCUDAAPI_H
00025
00026 #include <Inventor/SbBasic.h>
00027
00028 #include <Inventor/cuda/SoCuda.h>
00029
00030 class SoCudaHandle;
00031 class SoCudaBufferObject;
00032
00090 class SoCudaApi
00091 {
00092
00093 public:
00094
00105 static SoCuda::SoCudaError setParameter( SoCudaHandle* handle, SoCudaBufferObject* pointer );
00106
00119 static SoCuda::SoCudaError setBlockShape( SoCudaHandle* handle, int x, int y, int z );
00120
00121
00133 static SoCuda::SoCudaError setSharedMemorySize( SoCudaHandle* handle, int size );
00134
00135
00146 static SoCuda::SoCudaError setParameter( SoCudaHandle* handle, const void* pointer );
00147
00157 static SoCuda::SoCudaError setParameter( SoCudaHandle* handle, char value );
00158
00159
00169 static SoCuda::SoCudaError setParameter( SoCudaHandle* handle, unsigned char value );
00170
00180 static SoCuda::SoCudaError setParameter( SoCudaHandle* handle, short value );
00181
00191 static SoCuda::SoCudaError setParameter( SoCudaHandle* handle, unsigned short value );
00192
00202 static SoCuda::SoCudaError setParameter( SoCudaHandle* handle, long value );
00203
00213 static SoCuda::SoCudaError setParameter( SoCudaHandle* handle, unsigned long value );
00214
00224 static SoCuda::SoCudaError setParameter( SoCudaHandle* handle, int value );
00225
00235 static SoCuda::SoCudaError setParameter( SoCudaHandle* handle, unsigned int value );
00236
00246 static SoCuda::SoCudaError setParameter( SoCudaHandle* handle, float value );
00247
00257 static SoCuda::SoCudaError setParameter( SoCudaHandle* handle, double value );
00258
00268 static SoCuda::SoCudaError resetParameters( SoCudaHandle* handle );
00269
00279 static SoCuda::SoCudaError launch( SoCudaHandle* handle, int gridWidth, int gridHeight );
00280
00281
00282 private:
00283
00284
00290 static SoCudaHandle* createHandle();
00291
00297 static void freeHandle( SoCudaHandle* handle );
00298
00299
00300 static SoCuda::SoCudaError loadFunction( SoCudaHandle* handle, const SbString& filename, const SbString& functionName );
00301
00302 static SoCuda::SoCudaError findFunction( SoCudaHandle* handle, const void* moduleData, const SbString& functionName );
00303
00304 private:
00305 template<typename T> static int alignParameter(int baseOffset);
00306 template<typename T> static SoCuda::SoCudaError setCudaParameter( SoCudaHandle* handle, T value );
00307 };
00308
00309 #endif // SOCUDAAPI_H
00310
00311
00312