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 _SO_OPENCL_API_H_
00024 #define _SO_OPENCL_API_H_
00025
00026 #include <Inventor/SbBasic.h>
00027 #include <Inventor/SbVec.h>
00028 #include <Inventor/OpenCL/SoOpenCL.h>
00029
00030 class SoOpenCLHandle;
00031
00083 class INVENTOROPENCL_API SoOpenCLApi
00084 {
00085
00086 public:
00087
00098 static SoOpenCL::SoOpenCLError setParameter( SoOpenCLHandle* handle, const void* pointer );
00099
00109 static SoOpenCL::SoOpenCLError setParameter( SoOpenCLHandle* handle, char value );
00110
00111
00121 static SoOpenCL::SoOpenCLError setParameter( SoOpenCLHandle* handle, unsigned char value );
00122
00132 static SoOpenCL::SoOpenCLError setParameter( SoOpenCLHandle* handle, short value );
00133
00143 static SoOpenCL::SoOpenCLError setParameter( SoOpenCLHandle* handle, unsigned short value );
00144
00154 static SoOpenCL::SoOpenCLError setParameter( SoOpenCLHandle* handle, long value );
00155
00165 static SoOpenCL::SoOpenCLError setParameter( SoOpenCLHandle* handle, unsigned long value );
00166
00176 static SoOpenCL::SoOpenCLError setParameter( SoOpenCLHandle* handle, int value );
00177
00187 static SoOpenCL::SoOpenCLError setParameter( SoOpenCLHandle* handle, unsigned int value );
00188
00198 static SoOpenCL::SoOpenCLError setParameter( SoOpenCLHandle* handle, float value );
00199
00209 static SoOpenCL::SoOpenCLError setParameter( SoOpenCLHandle* handle, double value );
00210
00220 static SoOpenCL::SoOpenCLError resetParameters( SoOpenCLHandle* handle );
00221
00232 static SoOpenCL::SoOpenCLError launch(
00233 SoOpenCLHandle* handle,
00234 const SbVec3i32& globalWorkSize,
00235 const SbVec3i32& localWorkSize
00236 );
00237
00238
00239 private:
00240
00241
00247 static SoOpenCLHandle* createHandle();
00248
00254 static void freeHandle( SoOpenCLHandle* handle );
00255
00256
00257 static SoOpenCL::SoOpenCLError loadFunction( SoOpenCLHandle* handle, const SbString& filename, const SbString& functionName );
00258
00259 static SoOpenCL::SoOpenCLError findFunction( SoOpenCLHandle* handle, const void* moduleData, const SbString& functionName );
00260
00261 private:
00262 template<typename T> static SoOpenCL::SoOpenCLError setOpenCLParameter( SoOpenCLHandle* handle, T value );
00263 };
00264
00265 #endif // _SO_OPENCL_API_H_
00266
00267
00268