diff --git a/applications/plugins/SofaCUDA/CMakeLists.txt b/applications/plugins/SofaCUDA/CMakeLists.txt index cede9c498cc..f29c3455bc7 100644 --- a/applications/plugins/SofaCUDA/CMakeLists.txt +++ b/applications/plugins/SofaCUDA/CMakeLists.txt @@ -14,6 +14,7 @@ set(SOFACUDA_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/SofaCUDA") set(HEADER_FILES config.h.in + init.h ### Common sofa/gpu/cuda/CudaBaseVector.h @@ -99,7 +100,7 @@ set(HEADER_FILES set(SOURCE_FILES ### Common - main.cpp + init.cpp sofa/gpu/cuda/CudaBaseVector.cpp sofa/gpu/cuda/mycuda.cpp diff --git a/applications/plugins/SofaCUDA/main.cpp b/applications/plugins/SofaCUDA/init.cpp similarity index 98% rename from applications/plugins/SofaCUDA/main.cpp rename to applications/plugins/SofaCUDA/init.cpp index 51db7fa51c0..14a5c7c1a75 100644 --- a/applications/plugins/SofaCUDA/main.cpp +++ b/applications/plugins/SofaCUDA/init.cpp @@ -20,6 +20,7 @@ * Contact information: contact@sofa-framework.org * ******************************************************************************/ #include +#include #include #include @@ -40,7 +41,7 @@ SOFA_GPU_CUDA_API bool moduleIsInitialized(); bool isModuleInitialized = false; -void initExternalModule() +void init() { static bool first = true; if (first) @@ -50,6 +51,11 @@ void initExternalModule() } } +void initExternalModule() +{ + init(); +} + const char* getModuleName() { return "SofaCUDA"; diff --git a/applications/plugins/SofaCUDA/init.h b/applications/plugins/SofaCUDA/init.h new file mode 100644 index 00000000000..63695159787 --- /dev/null +++ b/applications/plugins/SofaCUDA/init.h @@ -0,0 +1,27 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program is free software; you can redistribute it and/or modify it * +* under the terms of the GNU Lesser General Public License as published by * +* the Free Software Foundation; either version 2.1 of the License, or (at * +* your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, but WITHOUT * +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * +* for more details. * +* * +* You should have received a copy of the GNU Lesser General Public License * +* along with this program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#pragma once +#include +namespace sofa::gpu::cuda +{ +SOFA_GPU_CUDA_API void init(); +} // namespace sofa::gpu::cuda