MeshLib C Docs
Loading...
Searching...
No Matches
MRCudaBasic.h File Reference
#include <MRCCuda/exports.h>
#include <MRCMisc/common.h>
#include <stdbool.h>
#include <stddef.h>

Go to the source code of this file.

Functions

MRC_CUDA_API const int * MR_Cuda_DeviceInfo_Get_driverVersion (const MR_Cuda_DeviceInfo *_this)
MRC_CUDA_API void MR_Cuda_DeviceInfo_Set_driverVersion (MR_Cuda_DeviceInfo *_this, int value)
MRC_CUDA_API int * MR_Cuda_DeviceInfo_GetMutable_driverVersion (MR_Cuda_DeviceInfo *_this)
MRC_CUDA_API const int * MR_Cuda_DeviceInfo_Get_runtimeVersion (const MR_Cuda_DeviceInfo *_this)
MRC_CUDA_API void MR_Cuda_DeviceInfo_Set_runtimeVersion (MR_Cuda_DeviceInfo *_this, int value)
MRC_CUDA_API int * MR_Cuda_DeviceInfo_GetMutable_runtimeVersion (MR_Cuda_DeviceInfo *_this)
MRC_CUDA_API const int * MR_Cuda_DeviceInfo_Get_computeMajor (const MR_Cuda_DeviceInfo *_this)
MRC_CUDA_API void MR_Cuda_DeviceInfo_Set_computeMajor (MR_Cuda_DeviceInfo *_this, int value)
MRC_CUDA_API int * MR_Cuda_DeviceInfo_GetMutable_computeMajor (MR_Cuda_DeviceInfo *_this)
MRC_CUDA_API const int * MR_Cuda_DeviceInfo_Get_computeMinor (const MR_Cuda_DeviceInfo *_this)
MRC_CUDA_API void MR_Cuda_DeviceInfo_Set_computeMinor (MR_Cuda_DeviceInfo *_this, int value)
MRC_CUDA_API int * MR_Cuda_DeviceInfo_GetMutable_computeMinor (MR_Cuda_DeviceInfo *_this)
MRC_CUDA_API const size_t * MR_Cuda_DeviceInfo_Get_totalGlobalMem (const MR_Cuda_DeviceInfo *_this)
MRC_CUDA_API void MR_Cuda_DeviceInfo_Set_totalGlobalMem (MR_Cuda_DeviceInfo *_this, size_t value)
MRC_CUDA_API size_t * MR_Cuda_DeviceInfo_GetMutable_totalGlobalMem (MR_Cuda_DeviceInfo *_this)
MRC_CUDA_API const MR_std_stringMR_Cuda_DeviceInfo_Get_name (const MR_Cuda_DeviceInfo *_this)
MRC_CUDA_API void MR_Cuda_DeviceInfo_Set_name (MR_Cuda_DeviceInfo *_this, const char *value, const char *value_end)
MRC_CUDA_API MR_std_stringMR_Cuda_DeviceInfo_GetMutable_name (MR_Cuda_DeviceInfo *_this)
MRC_CUDA_API MR_Cuda_DeviceInfoMR_Cuda_DeviceInfo_DefaultConstruct (void)
MRC_CUDA_API MR_Cuda_DeviceInfoMR_Cuda_DeviceInfo_DefaultConstructArray (size_t num_elems)
MRC_CUDA_API MR_Cuda_DeviceInfoMR_Cuda_DeviceInfo_ConstructFrom (int driverVersion, int runtimeVersion, int computeMajor, int computeMinor, size_t totalGlobalMem, const char *name, const char *name_end)
MRC_CUDA_API const MR_Cuda_DeviceInfoMR_Cuda_DeviceInfo_OffsetPtr (const MR_Cuda_DeviceInfo *ptr, ptrdiff_t i)
MRC_CUDA_API MR_Cuda_DeviceInfoMR_Cuda_DeviceInfo_OffsetMutablePtr (MR_Cuda_DeviceInfo *ptr, ptrdiff_t i)
MRC_CUDA_API MR_Cuda_DeviceInfoMR_Cuda_DeviceInfo_ConstructFromAnother (MR_PassBy _other_pass_by, MR_Cuda_DeviceInfo *_other)
MRC_CUDA_API void MR_Cuda_DeviceInfo_Destroy (const MR_Cuda_DeviceInfo *_this)
 Destroys a heap-allocated instance of MR_Cuda_DeviceInfo. Does nothing if the pointer is null.
MRC_CUDA_API void MR_Cuda_DeviceInfo_DestroyArray (const MR_Cuda_DeviceInfo *_this)
 Destroys a heap-allocated array of MR_Cuda_DeviceInfo. Does nothing if the pointer is null.
MRC_CUDA_API MR_Cuda_DeviceInfoMR_Cuda_DeviceInfo_AssignFromAnother (MR_Cuda_DeviceInfo *_this, MR_PassBy _other_pass_by, MR_Cuda_DeviceInfo *_other)
MRC_CUDA_API bool MR_Cuda_DeviceInfo_fitForComputations (const MR_Cuda_DeviceInfo *_this)
MRC_CUDA_API MR_expected_MR_Cuda_DeviceInfo_std_stringMR_Cuda_getDeviceInfo (void)
MRC_CUDA_API bool MR_Cuda_isCudaAvailable (int *driverVersion, int *runtimeVersion, int *computeMajor, int *computeMinor)
MRC_CUDA_API size_t MR_Cuda_getCudaAvailableMemory (void)
MRC_CUDA_API size_t MR_Cuda_getCudaSafeMemoryLimit (void)
MRC_CUDA_API size_t MR_Cuda_maxBufferSize (size_t availableBytes, size_t elementCount, size_t elementBytes)
MRC_CUDA_API size_t MR_Cuda_maxBufferSizeAlignedByBlock_MR_Vector2i (size_t availableBytes, const MR_Vector2i *blockDims, size_t elementBytes)
MRC_CUDA_API size_t MR_Cuda_maxBufferSizeAlignedByBlock_MR_Vector3i (size_t availableBytes, const MR_Vector3i *blockDims, size_t elementBytes)

Function Documentation

◆ MR_Cuda_DeviceInfo_AssignFromAnother()

MRC_CUDA_API MR_Cuda_DeviceInfo * MR_Cuda_DeviceInfo_AssignFromAnother ( MR_Cuda_DeviceInfo * _this,
MR_PassBy _other_pass_by,
MR_Cuda_DeviceInfo * _other )

Generated from method MR::Cuda::DeviceInfo::operator=. Parameter _this can not be null. It is a single object. The reference to things referred to by the parameter _other (if any) might be preserved in this object. The returned pointer will never be null. It is non-owning, do NOT destroy it. When this function is called, this object will drop any object references it held previously.

◆ MR_Cuda_DeviceInfo_ConstructFrom()

MRC_CUDA_API MR_Cuda_DeviceInfo * MR_Cuda_DeviceInfo_ConstructFrom ( int driverVersion,
int runtimeVersion,
int computeMajor,
int computeMinor,
size_t totalGlobalMem,
const char * name,
const char * name_end )

Constructs MR::Cuda::DeviceInfo elementwise. The reference to the parameter totalGlobalMem might be preserved in the constructed object. Parameter name can not be null. If name_end is null, then name is assumed to be null-terminated. The reference to the parameter name might be preserved in the constructed object. Never returns null. Returns an instance allocated on the heap! Must call MR_Cuda_DeviceInfo_Destroy() to free it when you're done using it. When this function is called, this object will drop any object references it held previously.

◆ MR_Cuda_DeviceInfo_ConstructFromAnother()

MRC_CUDA_API MR_Cuda_DeviceInfo * MR_Cuda_DeviceInfo_ConstructFromAnother ( MR_PassBy _other_pass_by,
MR_Cuda_DeviceInfo * _other )

Generated from constructor MR::Cuda::DeviceInfo::DeviceInfo. The reference to things referred to by the parameter _other (if any) might be preserved in the constructed object. Never returns null. Returns an instance allocated on the heap! Must call MR_Cuda_DeviceInfo_Destroy() to free it when you're done using it.

◆ MR_Cuda_DeviceInfo_DefaultConstruct()

MRC_CUDA_API MR_Cuda_DeviceInfo * MR_Cuda_DeviceInfo_DefaultConstruct ( void )

Constructs an empty (default-constructed) instance. Never returns null. Returns an instance allocated on the heap! Must call MR_Cuda_DeviceInfo_Destroy() to free it when you're done using it.

◆ MR_Cuda_DeviceInfo_DefaultConstructArray()

MRC_CUDA_API MR_Cuda_DeviceInfo * MR_Cuda_DeviceInfo_DefaultConstructArray ( size_t num_elems)

Constructs an array of empty (default-constructed) instances, of the specified size. Will never return null. The array must be destroyed using MR_Cuda_DeviceInfo_DestroyArray(). Use MR_Cuda_DeviceInfo_OffsetMutablePtr() and MR_Cuda_DeviceInfo_OffsetPtr() to access the array elements.

◆ MR_Cuda_DeviceInfo_Destroy()

MRC_CUDA_API void MR_Cuda_DeviceInfo_Destroy ( const MR_Cuda_DeviceInfo * _this)

Destroys a heap-allocated instance of MR_Cuda_DeviceInfo. Does nothing if the pointer is null.

◆ MR_Cuda_DeviceInfo_DestroyArray()

MRC_CUDA_API void MR_Cuda_DeviceInfo_DestroyArray ( const MR_Cuda_DeviceInfo * _this)

Destroys a heap-allocated array of MR_Cuda_DeviceInfo. Does nothing if the pointer is null.

◆ MR_Cuda_DeviceInfo_fitForComputations()

MRC_CUDA_API bool MR_Cuda_DeviceInfo_fitForComputations ( const MR_Cuda_DeviceInfo * _this)

returns true if all versions pass the checks Generated from method MR::Cuda::DeviceInfo::fitForComputations. Parameter _this can not be null. It is a single object.

◆ MR_Cuda_DeviceInfo_Get_computeMajor()

MRC_CUDA_API const int * MR_Cuda_DeviceInfo_Get_computeMajor ( const MR_Cuda_DeviceInfo * _this)

compute capability major version Returns a pointer to a member variable of class MR::Cuda::DeviceInfo named computeMajor. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it. The reference to this object might be preserved as the return value.

◆ MR_Cuda_DeviceInfo_Get_computeMinor()

MRC_CUDA_API const int * MR_Cuda_DeviceInfo_Get_computeMinor ( const MR_Cuda_DeviceInfo * _this)

compute capability minor version Returns a pointer to a member variable of class MR::Cuda::DeviceInfo named computeMinor. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it. The reference to this object might be preserved as the return value.

◆ MR_Cuda_DeviceInfo_Get_driverVersion()

MRC_CUDA_API const int * MR_Cuda_DeviceInfo_Get_driverVersion ( const MR_Cuda_DeviceInfo * _this)

maximum CUDA version supported by the driver Returns a pointer to a member variable of class MR::Cuda::DeviceInfo named driverVersion. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it. The reference to this object might be preserved as the return value.

◆ MR_Cuda_DeviceInfo_Get_name()

MRC_CUDA_API const MR_std_string * MR_Cuda_DeviceInfo_Get_name ( const MR_Cuda_DeviceInfo * _this)

name of the device Returns a pointer to a member variable of class MR::Cuda::DeviceInfo named name. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it. The reference to this object might be preserved as the return value.

◆ MR_Cuda_DeviceInfo_Get_runtimeVersion()

MRC_CUDA_API const int * MR_Cuda_DeviceInfo_Get_runtimeVersion ( const MR_Cuda_DeviceInfo * _this)

application's CUDA version Returns a pointer to a member variable of class MR::Cuda::DeviceInfo named runtimeVersion. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it. The reference to this object might be preserved as the return value.

◆ MR_Cuda_DeviceInfo_Get_totalGlobalMem()

MRC_CUDA_API const size_t * MR_Cuda_DeviceInfo_Get_totalGlobalMem ( const MR_Cuda_DeviceInfo * _this)

global memory on device in bytes (not all is available for our process) Returns a pointer to a member variable of class MR::Cuda::DeviceInfo named totalGlobalMem. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it. The reference to this object might be preserved as the return value.

◆ MR_Cuda_DeviceInfo_GetMutable_computeMajor()

MRC_CUDA_API int * MR_Cuda_DeviceInfo_GetMutable_computeMajor ( MR_Cuda_DeviceInfo * _this)

compute capability major version Returns a mutable pointer to a member variable of class MR::Cuda::DeviceInfo named computeMajor. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it. The reference to this object might be preserved as the return value.

◆ MR_Cuda_DeviceInfo_GetMutable_computeMinor()

MRC_CUDA_API int * MR_Cuda_DeviceInfo_GetMutable_computeMinor ( MR_Cuda_DeviceInfo * _this)

compute capability minor version Returns a mutable pointer to a member variable of class MR::Cuda::DeviceInfo named computeMinor. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it. The reference to this object might be preserved as the return value.

◆ MR_Cuda_DeviceInfo_GetMutable_driverVersion()

MRC_CUDA_API int * MR_Cuda_DeviceInfo_GetMutable_driverVersion ( MR_Cuda_DeviceInfo * _this)

maximum CUDA version supported by the driver Returns a mutable pointer to a member variable of class MR::Cuda::DeviceInfo named driverVersion. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it. The reference to this object might be preserved as the return value.

◆ MR_Cuda_DeviceInfo_GetMutable_name()

MRC_CUDA_API MR_std_string * MR_Cuda_DeviceInfo_GetMutable_name ( MR_Cuda_DeviceInfo * _this)

name of the device Returns a mutable pointer to a member variable of class MR::Cuda::DeviceInfo named name. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it. The reference to this object might be preserved as the return value.

◆ MR_Cuda_DeviceInfo_GetMutable_runtimeVersion()

MRC_CUDA_API int * MR_Cuda_DeviceInfo_GetMutable_runtimeVersion ( MR_Cuda_DeviceInfo * _this)

application's CUDA version Returns a mutable pointer to a member variable of class MR::Cuda::DeviceInfo named runtimeVersion. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it. The reference to this object might be preserved as the return value.

◆ MR_Cuda_DeviceInfo_GetMutable_totalGlobalMem()

MRC_CUDA_API size_t * MR_Cuda_DeviceInfo_GetMutable_totalGlobalMem ( MR_Cuda_DeviceInfo * _this)

global memory on device in bytes (not all is available for our process) Returns a mutable pointer to a member variable of class MR::Cuda::DeviceInfo named totalGlobalMem. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it. The reference to this object might be preserved as the return value.

◆ MR_Cuda_DeviceInfo_OffsetMutablePtr()

MRC_CUDA_API MR_Cuda_DeviceInfo * MR_Cuda_DeviceInfo_OffsetMutablePtr ( MR_Cuda_DeviceInfo * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element. The reference to the parameter ptr might be preserved in the return value.

◆ MR_Cuda_DeviceInfo_OffsetPtr()

MRC_CUDA_API const MR_Cuda_DeviceInfo * MR_Cuda_DeviceInfo_OffsetPtr ( const MR_Cuda_DeviceInfo * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element. The reference to the parameter ptr might be preserved in the return value.

◆ MR_Cuda_DeviceInfo_Set_computeMajor()

MRC_CUDA_API void MR_Cuda_DeviceInfo_Set_computeMajor ( MR_Cuda_DeviceInfo * _this,
int value )

compute capability major version Modifies a member variable of class MR::Cuda::DeviceInfo named computeMajor. Parameter _this can not be null. It is a single object. When this function is called, this object will drop object references it held previously in computeMajor.

◆ MR_Cuda_DeviceInfo_Set_computeMinor()

MRC_CUDA_API void MR_Cuda_DeviceInfo_Set_computeMinor ( MR_Cuda_DeviceInfo * _this,
int value )

compute capability minor version Modifies a member variable of class MR::Cuda::DeviceInfo named computeMinor. Parameter _this can not be null. It is a single object. When this function is called, this object will drop object references it held previously in computeMinor.

◆ MR_Cuda_DeviceInfo_Set_driverVersion()

MRC_CUDA_API void MR_Cuda_DeviceInfo_Set_driverVersion ( MR_Cuda_DeviceInfo * _this,
int value )

maximum CUDA version supported by the driver Modifies a member variable of class MR::Cuda::DeviceInfo named driverVersion. Parameter _this can not be null. It is a single object. When this function is called, this object will drop object references it held previously in driverVersion.

◆ MR_Cuda_DeviceInfo_Set_name()

MRC_CUDA_API void MR_Cuda_DeviceInfo_Set_name ( MR_Cuda_DeviceInfo * _this,
const char * value,
const char * value_end )

name of the device Modifies a member variable of class MR::Cuda::DeviceInfo named name. Parameter _this can not be null. It is a single object. Parameter value can not be null. If value_end is null, then value is assumed to be null-terminated. The reference to the parameter value might be preserved in this object in element name. When this function is called, this object will drop object references it held previously in name.

◆ MR_Cuda_DeviceInfo_Set_runtimeVersion()

MRC_CUDA_API void MR_Cuda_DeviceInfo_Set_runtimeVersion ( MR_Cuda_DeviceInfo * _this,
int value )

application's CUDA version Modifies a member variable of class MR::Cuda::DeviceInfo named runtimeVersion. Parameter _this can not be null. It is a single object. When this function is called, this object will drop object references it held previously in runtimeVersion.

◆ MR_Cuda_DeviceInfo_Set_totalGlobalMem()

MRC_CUDA_API void MR_Cuda_DeviceInfo_Set_totalGlobalMem ( MR_Cuda_DeviceInfo * _this,
size_t value )

global memory on device in bytes (not all is available for our process) Modifies a member variable of class MR::Cuda::DeviceInfo named totalGlobalMem. Parameter _this can not be null. It is a single object. The reference to the parameter value might be preserved in this object in element totalGlobalMem. When this function is called, this object will drop object references it held previously in totalGlobalMem.

◆ MR_Cuda_getCudaAvailableMemory()

MRC_CUDA_API size_t MR_Cuda_getCudaAvailableMemory ( void )

Returns available GPU memory in bytes Generated from function MR::Cuda::getCudaAvailableMemory.

◆ MR_Cuda_getCudaSafeMemoryLimit()

MRC_CUDA_API size_t MR_Cuda_getCudaSafeMemoryLimit ( void )

Returns maximum safe amount of free GPU memory that will be used for dynamic-sized buffers Generated from function MR::Cuda::getCudaSafeMemoryLimit.

◆ MR_Cuda_getDeviceInfo()

MRC_CUDA_API MR_expected_MR_Cuda_DeviceInfo_std_string * MR_Cuda_getDeviceInfo ( void )

Returns an error if CUDA is not available Generated from function MR::Cuda::getDeviceInfo. Never returns null. Returns an instance allocated on the heap! Must call MR_expected_MR_Cuda_DeviceInfo_std_string_Destroy() to free it when you're done using it.

◆ MR_Cuda_isCudaAvailable()

MRC_CUDA_API bool MR_Cuda_isCudaAvailable ( int * driverVersion,
int * runtimeVersion,
int * computeMajor,
int * computeMinor )

Returns true if Cuda is present on this GPU optional out maximum driver supported version optional out current runtime version optional out compute capability major version optional out compute capability minor version Generated from function MR::Cuda::isCudaAvailable. Parameter driverVersion defaults to a null pointer in C++. Parameter runtimeVersion defaults to a null pointer in C++. Parameter computeMajor defaults to a null pointer in C++. Parameter computeMinor defaults to a null pointer in C++.

◆ MR_Cuda_maxBufferSize()

MRC_CUDA_API size_t MR_Cuda_maxBufferSize ( size_t availableBytes,
size_t elementCount,
size_t elementBytes )

Returns maximum buffer size in elements that can be allocated with given memory limit Generated from function MR::Cuda::maxBufferSize.

◆ MR_Cuda_maxBufferSizeAlignedByBlock_MR_Vector2i()

MRC_CUDA_API size_t MR_Cuda_maxBufferSizeAlignedByBlock_MR_Vector2i ( size_t availableBytes,
const MR_Vector2i * blockDims,
size_t elementBytes )

Returns maximum buffer size in elements that can be allocated with given memory limit The size is aligned to the block dimensions Generated from function MR::Cuda::maxBufferSizeAlignedByBlock. Parameter blockDims can not be null. It is a single object.

◆ MR_Cuda_maxBufferSizeAlignedByBlock_MR_Vector3i()

MRC_CUDA_API size_t MR_Cuda_maxBufferSizeAlignedByBlock_MR_Vector3i ( size_t availableBytes,
const MR_Vector3i * blockDims,
size_t elementBytes )

Generated from function MR::Cuda::maxBufferSizeAlignedByBlock. Parameter blockDims can not be null. It is a single object.