     cudaCheck(cudaGLUnmapBufferObject((GLuint)id),"cudaGLUnmapBufferObject");
 }
 
+#endif
+
 #if defined(__cplusplus)
 } // namespace cuda
 } // namespace gpu


#include <sofa/helper/BackTrace.h>

#if defined(__cplusplus)
namespace sofa
{

namespace cuda
{
#endif

#ifdef NO_CUDA

bool cudaCheck(cudaError_t, const char*)
{
    return true;
}

bool cudaInitCalled = false;

int mycudaInit(int)
{
    cudaInitCalled = true;
    return 0;
}

void mycudaMalloc(void **devPtr, size_t)
{
    *devPtr = NULL;
}

void mycudaMallocPitch(void **devPtr, size_t*, size_t, size_t)
{
    *devPtr = NULL;
}

void mycudaFree(void *)
{
}

void mycudaMallocHost(void **hostPtr, size_t size)
{
    *hostPtr = malloc(size);
}

void mycudaFreeHost(void *hostPtr)
{
    free(hostPtr);
}

void mycudaMemcpyHostToDevice(void *, const void *, size_t)
{
}

void mycudaMemcpyDeviceToDevice(void *, const void *, size_t)
{
}

void mycudaMemcpyDeviceToHost(void *, const void *, size_t)
{
}

void mycudaMemcpyHostToDevice2D(void *, size_t, const void *, size_t, size_t, size_t)
{
}

void mycudaMemcpyDeviceToDevice2D(void *, size_t, const void *, size_t, size_t, size_t )
{
}

void mycudaMemcpyDeviceToHost2D(void *, size_t, const void *, size_t, size_t, size_t)
{
}

void mycudaGLRegisterBufferObject(int)
{
}

void mycudaGLUnregisterBufferObject(int)
{
}

void mycudaGLMapBufferObject(void** ptr, int)
{
    *ptr = NULL;
}

void mycudaGLUnmapBufferObject(int)
{
}

#else

bool cudaCheck(cudaError_t err, const char* src="?")
{
