Skip to content

Move CUDA code related to SPH from SofaCUDA to a SofaSphFluid extension#13

Merged
fredroy merged 60 commits intosofa-framework:masterfrom
alxbilger:cudaextension
May 21, 2025
Merged

Move CUDA code related to SPH from SofaCUDA to a SofaSphFluid extension#13
fredroy merged 60 commits intosofa-framework:masterfrom
alxbilger:cudaextension

Conversation

@alxbilger
Copy link
Contributor

with git history

JeremieA and others added 30 commits June 28, 2012 18:13
cuda_dev is currently disabled, until it is also moved into a plugin.

 //partial sync (239/371 changes)//


Former-commit-id: 76938e8326b59943494ec613633530609a03c340
Former-commit-id: 8b8803f859d5c713990114c543ebb8707ed22edd
…e export/import declaration

Former-commit-id: 1bbcab170cc46708f160bc89f1d0bc3421ac704b
…ld Components. For now, geometric stiffnesses are neglicted.

Former-commit-id: db6c2747788da8432dd0135ba4e71899998492e2
Files in modules/sofa/component/ were organised only according to the
namespace hierarchy, this commit reorganizes files by project (in the
cmake sense, like, checkboxes in cmake-gui).

E.g. files in
  modules/sofa/component/SofaBaseAnimation/
are moved to
  modules/BaseAnimation/

Moreover, the "Sofa" prefix is dropped, and the directory structure in
each module is completely flattened, unless a module contains many files.

On the pragmatic side, this changes what you put in:
- include directives: <sofa/component/foo/bar/baz.h> -> <ModuleName/baz.h>
- linker dependencies: SofaBaseCollision -> BaseCollision

But fear not, this commit also provides a script to fix those:
$ ./scripts/fix-modules-includes.sh path/to/your/plugin
This should take care of most changes. Obviously, this will modify your
files, so needless to say, you should save your work beforehand.
It Works on My Machine. Hopefully, it will not wreak havoc on yours.

Oh, also, you should completely rebuild SOFA, because there is no way on
Earth the cmake scripts can handle this.



Former-commit-id: 8b197a3551423ab681a0cdc74b70c1c1d639f2da
Moving files around in modules/ might have been premature,
I prefer not to take any more risks and roll back for now.
I will commit again any other modifications that are reverted by this commit.



Former-commit-id: da094ca425052ca336158ecc49ddc1426aa03e6f
Former-commit-id: 590be91bbd1c142bc1f03957517f44a6fff1b7a3
(and getV(), getX0(), etc)


Former-commit-id: 979c9c168e3faa1bf68816fce2be4b8cb429ffbe
Fix minor issues.

Also, I commented some method specialisations in CudaParticleSource,
because those methods were removed from ParticleSource (they were
deprecated), and I have no idea how to translate them into the
non-deprecated versions.


Former-commit-id: 16734159e3a0d9df2dc02e3845eb7bc81c24468c
Former-commit-id: 723c140367e421db8cf8f91fb38b8b48305d85ad
Former-commit-id: a2f46566ffa73843be5fa1f6ae5320962c65e1c1
Former-commit-id: ce86fd7f466eb071eaa73e216960cd6bf583d591
Conflicts:
	extlibs/CGoGN/src/Topology/ihmap/ihm3.cpp

Former-commit-id: bd90f6f5076b6072958778eede88ae3523b2b94b
Former-commit-id: de8d090329fdadbc6aa0e35270098c7972114e74
Conflicts:
	applications/plugins/Flexible/Flexible_test/TetrahedronVolumeMapping_test.cpp
	applications/plugins/Flexible/deformationMapping/ImageDeformation.h
	applications/plugins/Flexible/mass/MassFromDensity.h
	applications/plugins/Flexible/shapeFunction/ShapeFunctionDiscretizer.h
	applications/plugins/image/ImageFilter.h
	applications/plugins/image/ImageOperation.h
	applications/plugins/image/MergeImages.h
	framework/sofa/helper/system/PluginManager.cpp
	framework/sofa/helper/system/PluginManager.h
	modules/sofa/simulation/simulation_test/graph/DAG_test.cpp

Former-commit-id: 790d61b7f3e7e0f991f4c58a07194a10593ad6a3
Former-commit-id: 5ff4a74ef01aadbe93303d854540767f09fb78d4
Signed-off-by: Etienne Schmitt <etienne.schmitt@inria.fr>

Former-commit-id: 1d0c2181ba363fdf8c90534ce61d2829b154d74f
Signed-off-by: Etienne Schmitt <etienne.schmitt@inria.fr>

Former-commit-id: 4b6a6d51ae2391fa2a861c26575be03baf3522da
[all] Update licence year and version for future releases
[SofaKernel] Remove last direct calls of OpenGL in modules
In case these SOFA_DEV were usefull to you please make PR in which the removed
code is properly engineered (i.e no #ifdef).

If you don't think using #ifdef is bad don't hesitate to tell it to sofa-dev.
* Minor changes to ease automatic removal of SOFA_FLOAT.

* [all] remove all SOFA_DECL_CLASS & SOFA_LINK_CLASS

* [SofaCUDA] Remove comments that fails.

* [All] Clean blank lines + forgotten macros
[All] Run clang-tidy and update license headers
damienmarchal and others added 23 commits October 1, 2020 01:40
… master-with-upstream-integration

# Conflicts:
#	modules/SofaGraphComponent/SceneCheckAPIChange.h
… master-with-upstream-integration

# Conflicts:
#	modules/SofaGraphComponent/SceneCheckAPIChange.h
… master-with-upstream-integration

# Conflicts:
#	modules/SofaGraphComponent/SceneCheckAPIChange.h
…ve-sout-serr

# Conflicts:
#	applications/plugins/Compliant/odesolver/CompliantPseudoStaticSolver.inl
#	applications/plugins/image/ImageExporter.h
#	modules/SofaConstraint/LinearSolverConstraintCorrection.inl
#	modules/SofaGeneralEngine/IndicesFromValues.inl
#	modules/SofaNonUniformFem/src/SofaNonUniformFem/SparseGridRamificationTopology.cpp
…move-sout-serr

# Conflicts:
#	applications/plugins/Compliant/odesolver/CompliantPseudoStaticSolver.inl
#	applications/plugins/image/ImageExporter.h
#	modules/SofaConstraint/LinearSolverConstraintCorrection.inl
#	modules/SofaGeneralEngine/IndicesFromValues.inl
#	modules/SofaNonUniformFem/src/SofaNonUniformFem/SparseGridRamificationTopology.cpp
Bunch of removale of sout/serr in the whole code base.
Uniform size type to be same type as index_type

    move index_type to sofa namespace (in sofa/config.h)
    (was located in defaulttype before, does not really make sense)

So now :

    index_type is defined as sofa::index_type
    size_type is defined as sofa::size_type
* remove last use of SOFA_NO_OPENGL (except in sofaconfig/framework)

* update image

* add registration and distancegrid

* add sphfluid

* add eulerianfluid (along with a config.h.in)

* add simplegui

* add cuda

* revert eulerianfluid as sofa.gl is required anyway

* fix simplegui

* replace ifdef with if... ==1

* update some config.cmake.in

* image component was still using ogl without guards

* fix compilation for a bunch of plugins without Sofa.GL

* fix compilation

Co-authored-by: Guillaume Paran <guillaume.paran@sofa-framework.org>
…alParams, VisualParams and ConstraintParams (#1794)

* [SofaCore] Add forward declarations for parameters.

* [SofaSimulationCore] Add forward declaration.

* [all] Update all the code base to use forward declaration & opaque api.

* [SofaBaseMechanics] Updates two tests to use execparams::defaultInstance()

* [all] Remove commented code

* FIXUP

* [BulletCollisionDetection] Use mechanicalparams::defaultInstance()

* [plugins/PreassembledMass] Use mechanicalparams::defaultInstance()

* [all] Remove the Doxygen style comments "/// From sofa/core/fwd.h"

* [all] Rename asExecParam to dynamicCastToExecParam (to make it constant with other opaque cast nameing)

* [all] Unify all name for cast function.

The names are:
MyObject* castTo<MyObject>(Base*);
Base* castToBase(MyType*);
ExecParams* castToExecParams(OtherParam);

Co-authored-by: Guillaume Paran <guillaume.paran@sofa-framework.org>
* use correct headers/namespace for gl stuff

* apply to more plugins
* re-enable warnings when using compat headers

* sofaframework compiles

* sofabase compiles

* sofagl compiles

* modules compiles

* gui compiles

* tests compiles

* image

* plugins

* linux, plugins...

* physicsapi, cuda

* remove more uses

* compiles without sofa.compat

* compiles without sofa.compat with plugins

* Fix headlessrecorder

* fix geomagic

* fix sofaassimp

* fix imagetoolbox

* Fix compilation crash with masses

* Update SofaKernel/modules/Sofa.GL/src/sofa/gl/BasicShapes.h

Co-authored-by: Alex Bilger <alxbilger@users.noreply.github.com>

* restore compat in cmake

* fix compilation

* fix sparseldl

* [All] FIX deprecated includes "sofa/helper/ArgumentParser.h"

# Conflicts:
#	applications/projects/SofaFlowVR/Main.cpp
#	applications/projects/runSofa/Main.cpp
#	applications/tutorials/oneParticle/oneParticle.cpp

* [All] FIX deprecated includes "sofa/helper/ArgumentParser.h" (2)

Co-authored-by: Alex Bilger <alxbilger@users.noreply.github.com>
Co-authored-by: Guillaume Paran <guillaume.paran@sofa-framework.org>
* [SofaCUDA] Remove umul24 use

* [SofaCuda] Remove fastmul macro
** gather compat options in cmake files

* update tests

* clean cmake for compat and fix non-sofang modules (leftovers)

* fix compat and articulated plugin

* fix install file for cimgplugin and sofatest

* re-enable non-sofang module haptic and validation for non-compat mode

* fix haptic and validation tests

* fix sensable emu

* fix: force sofa.component to load everything

* fix msvc

* Apply suggestions from code review (cmake.in fixes)

Co-authored-by: Guillaume Paran <guillaume.paran@sofa-framework.org>

* fix cuda

* update plugins

* fix tests (scenecreator)

Co-authored-by: Frédérick ROY <fred.roy.mr@gmail.com>
Co-authored-by: Guillaume Paran <guillaume.paran@sofa-framework.org>
* Move to mapping folder

* Compatibility layer

* Usual module structure: moduleName/src/moduleName
* [SofaCUDA] Generalize the use of MessageDispatcher in SofaCUDA

* Remove non-required plugin in an example scene

---------

Co-authored-by: Paul Baksic <30337881+bakpaul@users.noreply.github.com>
* [all] Apply nested namespaces

* Fix compilation

* Revert nested namespaces on .cu files to fix compilation

* Fix bad refactoring
* fix compilation

* Fix compilation in tutorials

* Fix compilation plugin Assimp

* fix compilation again

* Fix compilation, especially using vec_id::write_access

* Complete compilation on Assimp

* fix compilation (cuda with sph)

* fix compilation (cuda with distancegrid)

* Update visitor names

* Fix compilation in OglVolumetricModel

---------

Co-authored-by: Frederick Roy <froy@lnrobo.com>
* Remove SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_IO_MESH

* Remove SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_VISUAL

* Remove SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_SETTING

* Cleaning : remove unnecessary includes

* forgotten VEC3STATE_AS_VISUALSTATE

* Remove SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_PLAYBACK

* fix compilation

* Remove SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_TOPOLOGY_CONTAINER_DYNAMIC

* Remove SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_ENGINE_GENERATE

* Remove ALL SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA*

* Disabling all v24.12 SOFA_ATTRIBUTE_DEPRECATED

* Disable all SOFA_HEADER_DEPRECATED and Fix older lifecycle forgotten

* Disable all SOFA_ATTRIBUTE_DEPRECATED

* forgotten setOriginalData

* complete removal of SparseCommon.cpp

* remove SOFAGENERALLOADER_HAVE_ZLIB compat

* Remove RemovedData d_draw

* fix compilation

* Fix PluginManager_Test

* Fix all uses of vec_id

* Fix compilation: macro didn't exists

* Fix scenes using plane definition in TrianglePressureForceField

---------

Co-authored-by: Frederick Roy <froy@lnrobo.com>
Co-authored-by: Paul Baksic <paul.baksic@outlook.fr>
Co-authored-by: Frederick Roy <fredroy@users.noreply.github.com>
@fredroy fredroy merged commit 294830c into sofa-framework:master May 21, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.