AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
SolverInterface.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
19#include <agx/Object.h>
20#include <agx/SolveAlgorithms.h>
21
23
24namespace agxGPU
25{
26
32 {
33 public:
34
35 enum SolverBackends : int {
36 AUTOMATIC = 0,
37 CUDA = 1
38 };
39
40 enum SolverKernel : int {
41 NONE = 0,
47 HYBRID_DRY_FRICTION
48 };
49
56 static SolverInterface* loadSolver(int backend, int device);
57
63 static void releaseSolver(SolverInterface* solver);
64
70 virtual bool isSupported() const = 0;
71
77
78
82 virtual agx::SolveKernel* getSolveKernel(int kernel) = 0;
83
87 int getDeviceIndex() const;
88
93
94 private:
95 int m_backendType;
96 int m_deviceIndex;
97 };
98
99
100
101}
#define AGXPHYSICS_EXPORT
Interface for primarily Iterative Solvers that can execute on GPU and be coupled to AGX solvers.
int getDeviceIndex() const
Get index of backend GPU device.
virtual agx::Task * getCopyToGpuTask()
Optional staging task that can prepare and copy some data to GPU before the Solver should run.
virtual bool isSupported() const =0
Query if solver can execute on current hardware.
int getSolverBackendType() const
Get backend type for solver.
static void releaseSolver(SolverInterface *solver)
Pass solver back to its originating backend library where it can be freed if reference counting allow...
virtual agx::SolveKernel * getSolveKernel(int kernel)=0
Request kernel for a solve stage.
static SolverInterface * loadSolver(int backend, int device)
Try to dynamically load a GPU backend.
A component is an object containing other objects, enabling hierarchical structuring.
Definition: Component.h:39
A representation of a generic task.
Definition: Task.h:57
Funcionality and abstractions for GPU computation.
Definition: agxGPU.h:25