9#ifndef MRVIEWER_NO_VOXELS
22class MRVIEWER_CLASS CudaAccessor
34#ifndef MRVIEWER_NO_VOXELS
42 MRVIEWER_API
static void setCudaAvailable(
bool val,
int maxDriverVersion,
int runtimeVersion,
int computeMajor,
int computeMinor );
48#ifndef MRVIEWER_NO_VOXELS
85#ifndef MRVIEWER_NO_VOXELS
123 CudaAccessor() =
default;
124 ~CudaAccessor() =
default;
126 static CudaAccessor& instance_();
128 bool isCudaAvailable_ =
false;
129 int maxDriverVersion_ = 0;
130 int runtimeVersion_ = 0;
131 int computeMajor_ = 0;
132 int computeMinor_ = 0;
137#ifndef MRVIEWER_NO_VOXELS
static void setCudaFreeMemoryFunc(CudaFreeMemoryFunc freeMemFunc)
static int getComputeCapabilityMajor()
Returns Compute Capability major version of current device.
static bool isCudaSupportedByPlarform()
static int getCudaRuntimeVersion()
Returns version of current runtime.
static void setCudaAvailable(bool val, int maxDriverVersion, int runtimeVersion, int computeMajor, int computeMinor)
setup functions
static bool isCudaAvailable()
Returns true if CUDA is available on this computer.
static size_t fromGridMemory(const Mesh &mesh, const Vector3i &dims)
static size_t selfIntersectionsMemory(const Mesh &mesh)
returns amount of required GPU memory for CudaFastWindingNumber::calcSelfIntersections operation
std::function< std::unique_ptr< IComputeToolDistance >()> CudaComputeToolDistanceConstructor
Returns specific implementation of IComputeToolDistance interface that computes on GPU.
Definition MRCudaAccessor.h:38
double volume(const MeshTopology &topology, const VertCoords &points, const FaceBitSet *region=nullptr)
MRVOXELS_CLASS SimpleVolumeMinMax
Definition MRVoxelsFwd.h:35
std::function< std::unique_ptr< IFastWindingNumber >(const Mesh &)> CudaFwnConstructor
Returns specific implementation of IFastWindingNumber interface that computes windings on GPU.
Definition MRCudaAccessor.h:28
static CudaPointsToDistanceVolumeByPartsCallback getCudaPointsToDistanceVolumeByPartsCallback()
Returns cuda implementation of PointsToDistanceVolumeByPartsCallback.
static int getCudaMaxDriverSupportedVersion()
Returns maximum supported by driver version.
static std::unique_ptr< IPointsProjector > getCudaPointsProjector()
Returns cuda implementation of IPointsProjector.
static void setCudaPointsProjectorConstructor(CudaPointsProjectorConstructor ppCtor)
tl::expected< T, E > Expected
Definition MRExpected.h:31
static void setCudaPointsToDistanceVolumeCallback(CudaPointsToDistanceVolumeCallback callback)
std::function< Expected< SimpleVolumeMinMax >(const PointCloud &cloud, const PointsToDistanceVolumeParams ¶ms)> CudaPointsToDistanceVolumeCallback
Definition MRCudaAccessor.h:35
static std::unique_ptr< IFastWindingNumber > getCudaFastWindingNumber(const Mesh &mesh)
Returns cuda implementation of IFastWindingNumber.
static void setCudaMeshProjectorConstructor(CudaMeshProjectorConstructor mpCtor)
static void setCudaComputeToolDistanceConstructor(CudaComputeToolDistanceConstructor ctdCtor)
static size_t fromVectorMemory(const Mesh &mesh, size_t inputSize)
returns amount of required GPU memory for CudaFastWindingNumber::calcFromVector operation
std::function< size_t()> CudaFreeMemoryFunc
Returns amount of free memory on GPU.
Definition MRCudaAccessor.h:26
static std::unique_ptr< IComputeToolDistance > getCudaComputeToolDistance()
Returns CUDA implementation of IComputeToolDistance.
std::function< std::unique_ptr< IPointsToMeshProjector >()> CudaMeshProjectorConstructor
Returns specific implementation of IPointsToMeshProjector interface projects on GPU.
Definition MRCudaAccessor.h:30
std::function< Expected< void >(const PointCloud &cloud, const PointsToDistanceVolumeParams ¶ms, std::function< Expected< void >(const SimpleVolumeMinMax &volume, int zOffset)> addPart, int layerOverlap)> CudaPointsToDistanceVolumeByPartsCallback
Definition MRCudaAccessor.h:36
static CudaPointsToDistanceVolumeCallback getCudaPointsToDistanceVolumeCallback()
Returns cuda implementation of PointsToDistanceVolumeCallback.
static void setCudaFastWindingNumberConstructor(CudaFwnConstructor fwnCtor)
static size_t getCudaFreeMemory()
Returns number of free bytes on cuda.
static void setCudaPointsToDistanceVolumeByPartsCallback(CudaPointsToDistanceVolumeByPartsCallback callback)
std::function< std::unique_ptr< IPointsProjector >()> CudaPointsProjectorConstructor
Returns specific implementation of IPointsProjector interface projects on GPU.
Definition MRCudaAccessor.h:32
static size_t pointsToDistanceVolumeMemory(const PointCloud &pointCloud, const Vector3i &dims, const VertNormals *ptNormals)
returns amount of required GPU memory for Cuda::pointsToDistanceVolume
static int getComputeCapabilityMinor()
Returns Compute Capability minor version of current device.
static std::unique_ptr< IPointsToMeshProjector > getCudaPointsToMeshProjector()
Returns cuda implementation of IPointsToMeshProjector.
static size_t fastWindingNumberMeshMemory(const Mesh &mesh)
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRPointCloud.h:17
Definition MRPointsToDistanceVolume.h:16