mycuda.cpp

Go to the documentation of this file.
00001 /******************************************************************************
00002 *       SOFA, Simulation Open-Framework Architecture, version 1.0 beta 3      *
00003 *                (c) 2006-2008 MGH, INRIA, USTL, UJF, CNRS                    *
00004 *                                                                             *
00005 * This library is free software; you can redistribute it and/or modify it     *
00006 * under the terms of the GNU Lesser General Public License as published by    *
00007 * the Free Software Foundation; either version 2.1 of the License, or (at     *
00008 * your option) any later version.                                             *
00009 *                                                                             *
00010 * This library is distributed in the hope that it will be useful, but WITHOUT *
00011 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
00012 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
00013 * for more details.                                                           *
00014 *                                                                             *
00015 * You should have received a copy of the GNU Lesser General Public License    *
00016 * along with this library; if not, write to the Free Software Foundation,     *
00017 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.          *
00018 *******************************************************************************
00019 *                               SOFA :: Modules                               *
00020 *                                                                             *
00021 * Authors: The SOFA Team and external contributors (see Authors.txt)          *
00022 *                                                                             *
00023 * Contact information: contact@sofa-framework.org                             *
00024 ******************************************************************************/
00025 #include <sofa/helper/system/config.h>
00026 #include <iostream>
00027 #include <fstream>
00028 #include <stdarg.h>
00029 #include <stdio.h>
00030 #include <stdlib.h>
00031 
00032 #include "mycuda.h"
00033 
00034 namespace sofa
00035 {
00036 namespace gpu
00037 {
00038 namespace cuda
00039 {
00040 
00041 SOFA_LINK_CLASS(CudaFixedConstraint)
00042 SOFA_LINK_CLASS(CudaMechanicalObject)
00043 SOFA_LINK_CLASS(CudaSpringForceField)
00044 SOFA_LINK_CLASS(CudaUniformMass)
00045 SOFA_LINK_CLASS(CudaPlaneForceField)
00046 SOFA_LINK_CLASS(CudaSphereForceField)
00047 SOFA_LINK_CLASS(CudaEllipsoidForceField)
00048 SOFA_LINK_CLASS(CudaIdentityMapping)
00049 SOFA_LINK_CLASS(CudaBarycentricMapping)
00050 SOFA_LINK_CLASS(CudaRigidMapping)
00051 SOFA_LINK_CLASS(CudaSubsetMapping)
00052 SOFA_LINK_CLASS(CudaDistanceGridCollisionModel)
00053 SOFA_LINK_CLASS(CudaTetrahedronFEMForceField)
00054 SOFA_LINK_CLASS(CudaCollision)
00055 SOFA_LINK_CLASS(CudaCollisionDetection)
00056 SOFA_LINK_CLASS(CudaPointModel)
00057 SOFA_LINK_CLASS(CudaTestForceField)
00058 SOFA_LINK_CLASS(CudaVisualModel)
00059 SOFA_LINK_CLASS(CudaOglTetrahedralModel)
00060 
00061 
00062 extern "C"
00063 {
00064 //MycudaVerboseLevel mycudaVerboseLevel = LOG_ERR;
00065 MycudaVerboseLevel mycudaVerboseLevel = LOG_INFO;
00066 //MycudaVerboseLevel mycudaVerboseLevel = LOG_TRACE;
00067 }
00068 
00069 void mycudaLogError(int err, const char* src)
00070 {
00071     std::cerr << "CUDA: Error "<<err<<" returned from "<<src<<".\n";
00072     exit(1);
00073 }
00074 
00075 int myprintf(const char* fmt, ...)
00076 {
00077     va_list args;
00078     va_start( args, fmt );
00079     int r = vfprintf( stderr, fmt, args );
00080     va_end( args );
00081     return r;
00082 }
00083 
00084 const char* mygetenv(const char* name)
00085 {
00086     return getenv(name);
00087 }
00088 
00089 } // namespace cuda
00090 } // namespace gpu
00091 } // namespace sofa

Generated on Sun Nov 23 04:05:45 2008 for Sofa by  doxygen 1.5.7.1