mycuda.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef MYCUDA_H
00026 #define MYCUDA_H
00027
00028 #include <string.h>
00029
00030 #if defined(__cplusplus)
00031 namespace sofa
00032 {
00033 namespace gpu
00034 {
00035 namespace cuda
00036 {
00037 #endif
00038
00039 extern "C" {
00040 extern int mycudaInit(int device=-1);
00041 extern void mycudaMalloc(void **devPtr, size_t size);
00042 extern void mycudaMallocPitch(void **devPtr, size_t* pitch, size_t width, size_t height);
00043 extern void mycudaFree(void *devPtr);
00044 extern void mycudaMallocHost(void **hostPtr, size_t size);
00045 extern void mycudaFreeHost(void *hostPtr);
00046
00047 extern void mycudaMemcpyHostToDevice(void *dst, const void *src, size_t count);
00048 extern void mycudaMemcpyDeviceToDevice(void *dst, const void *src, size_t count);
00049 extern void mycudaMemcpyDeviceToHost(void *dst, const void *src, size_t count);
00050 extern void mycudaMemcpyHostToDevice2D(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height);
00051 extern void mycudaMemcpyDeviceToDevice2D(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height);
00052 extern void mycudaMemcpyDeviceToHost2D(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height);
00053
00054 extern void mycudaGLRegisterBufferObject(int id);
00055 extern void mycudaGLUnregisterBufferObject(int id);
00056
00057 extern void mycudaGLMapBufferObject(void** ptr, int id);
00058 extern void mycudaGLUnmapBufferObject(int id);
00059
00060 extern void mycudaLogError(int err, const char* src);
00061 extern int myprintf(const char* fmt, ...);
00062 extern const char* mygetenv(const char* name);
00063
00064 enum MycudaVerboseLevel
00065 {
00066 LOG_NONE = 0,
00067 LOG_ERR = 1,
00068 LOG_INFO = 2,
00069 LOG_TRACE = 3
00070 };
00071
00072 extern MycudaVerboseLevel mycudaVerboseLevel;
00073 }
00074
00075
00076 #if defined(__cplusplus)
00077 }
00078 }
00079 }
00080 #endif
00081
00082 #endif