cuda_runtime

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 2 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateStream

func CreateStream() (Stream, CudaError)

func CreateStreamWithFlags

func CreateStreamWithFlags(flags CudaStreamCreateFlags) (Stream, CudaError)

func GetDefaultDeviceContext

func GetDefaultDeviceContext() (DeviceContext, CudaError)

Types

type CudaError

type CudaError int32

CudaErrorT as declared in include/driver_types.h:2868

const (
	CudaSuccess                             CudaError = iota
	CudaErrorInvalidValue                   CudaError = 1
	CudaErrorMemoryAllocation               CudaError = 2
	CudaErrorInitializationError            CudaError = 3
	CudaErrorCudartUnloading                CudaError = 4
	CudaErrorProfilerDisabled               CudaError = 5
	CudaErrorProfilerNotInitialized         CudaError = 6
	CudaErrorProfilerAlreadyStarted         CudaError = 7
	CudaErrorProfilerAlreadyStopped         CudaError = 8
	CudaErrorInvalidConfiguration           CudaError = 9
	CudaErrorInvalidPitchValue              CudaError = 12
	CudaErrorInvalidSymbol                  CudaError = 13
	CudaErrorInvalidHostPointer             CudaError = 16
	CudaErrorInvalidDevicePointer           CudaError = 17
	CudaErrorInvalidTexture                 CudaError = 18
	CudaErrorInvalidTextureBinding          CudaError = 19
	CudaErrorInvalidChannelDescriptor       CudaError = 20
	CudaErrorInvalidMemcpyDirection         CudaError = 21
	CudaErrorAddressOfConstant              CudaError = 22
	CudaErrorTextureFetchFailed             CudaError = 23
	CudaErrorTextureNotBound                CudaError = 24
	CudaErrorSynchronizationError           CudaError = 25
	CudaErrorInvalidFilterSetting           CudaError = 26
	CudaErrorInvalidNormSetting             CudaError = 27
	CudaErrorMixedDeviceExecution           CudaError = 28
	CudaErrorNotYetImplemented              CudaError = 31
	CudaErrorMemoryValueTooLarge            CudaError = 32
	CudaErrorStubLibrary                    CudaError = 34
	CudaErrorInsufficientDriver             CudaError = 35
	CudaErrorCallRequiresNewerDriver        CudaError = 36
	CudaErrorInvalidSurface                 CudaError = 37
	CudaErrorDuplicateVariableName          CudaError = 43
	CudaErrorDuplicateTextureName           CudaError = 44
	CudaErrorDuplicateSurfaceName           CudaError = 45
	CudaErrorDevicesUnavailable             CudaError = 46
	CudaErrorIncompatibleDriverContext      CudaError = 49
	CudaErrorMissingConfiguration           CudaError = 52
	CudaErrorPriorLaunchFailure             CudaError = 53
	CudaErrorLaunchMaxDepthExceeded         CudaError = 65
	CudaErrorLaunchFileScopedTex            CudaError = 66
	CudaErrorLaunchFileScopedSurf           CudaError = 67
	CudaErrorSyncDepthExceeded              CudaError = 68
	CudaErrorLaunchPendingCountExceeded     CudaError = 69
	CudaErrorInvalidDeviceFunction          CudaError = 98
	CudaErrorNoDevice                       CudaError = 100
	CudaErrorInvalidDevice                  CudaError = 101
	CudaErrorDeviceNotLicensed              CudaError = 102
	CudaErrorSoftwareValidityNotEstablished CudaError = 103
	CudaErrorStartupFailure                 CudaError = 127
	CudaErrorInvalidKernelImage             CudaError = 200
	CudaErrorDeviceUninitialized            CudaError = 201
	CudaErrorMapBufferObjectFailed          CudaError = 205
	CudaErrorUnmapBufferObjectFailed        CudaError = 206
	CudaErrorArrayIsMapped                  CudaError = 207
	CudaErrorAlreadyMapped                  CudaError = 208
	CudaErrorNoKernelImageForDevice         CudaError = 209
	CudaErrorAlreadyAcquired                CudaError = 210
	CudaErrorNotMapped                      CudaError = 211
	CudaErrorNotMappedAsArray               CudaError = 212
	CudaErrorNotMappedAsPointer             CudaError = 213
	CudaErrorECCUncorrectable               CudaError = 214
	CudaErrorUnsupportedLimit               CudaError = 215
	CudaErrorDeviceAlreadyInUse             CudaError = 216
	CudaErrorPeerAccessUnsupported          CudaError = 217
	CudaErrorInvalidPtx                     CudaError = 218
	CudaErrorInvalidGraphicsContext         CudaError = 219
	CudaErrorNvlinkUncorrectable            CudaError = 220
	CudaErrorJitCompilerNotFound            CudaError = 221
	CudaErrorUnsupportedPtxVersion          CudaError = 222
	CudaErrorJitCompilationDisabled         CudaError = 223
	CudaErrorUnsupportedExecAffinity        CudaError = 224
	CudaErrorUnsupportedDevSideSync         CudaError = 225
	CudaErrorInvalidSource                  CudaError = 300
	CudaErrorFileNotFound                   CudaError = 301
	CudaErrorSharedObjectSymbolNotFound     CudaError = 302
	CudaErrorSharedObjectInitFailed         CudaError = 303
	CudaErrorOperatingSystem                CudaError = 304
	CudaErrorInvalidResourceHandle          CudaError = 400
	CudaErrorIllegalState                   CudaError = 401
	CudaErrorLossyQuery                     CudaError = 402
	CudaErrorSymbolNotFound                 CudaError = 500
	CudaErrorNotReady                       CudaError = 600
	CudaErrorIllegalAddress                 CudaError = 700
	CudaErrorLaunchOutOfResources           CudaError = 701
	CudaErrorLaunchTimeout                  CudaError = 702
	CudaErrorLaunchIncompatibleTexturing    CudaError = 703
	CudaErrorPeerAccessAlreadyEnabled       CudaError = 704
	CudaErrorPeerAccessNotEnabled           CudaError = 705
	CudaErrorSetOnActiveProcess             CudaError = 708
	CudaErrorContextIsDestroyed             CudaError = 709
	CudaErrorAssert                         CudaError = 710
	CudaErrorTooManyPeers                   CudaError = 711
	CudaErrorHostMemoryAlreadyRegistered    CudaError = 712
	CudaErrorHostMemoryNotRegistered        CudaError = 713
	CudaErrorHardwareStackError             CudaError = 714
	CudaErrorIllegalInstruction             CudaError = 715
	CudaErrorMisalignedAddress              CudaError = 716
	CudaErrorInvalidAddressSpace            CudaError = 717
	CudaErrorInvalidPc                      CudaError = 718
	CudaErrorLaunchFailure                  CudaError = 719
	CudaErrorCooperativeLaunchTooLarge      CudaError = 720
	CudaErrorNotPermitted                   CudaError = 800
	CudaErrorNotSupported                   CudaError = 801
	CudaErrorSystemNotReady                 CudaError = 802
	CudaErrorSystemDriverMismatch           CudaError = 803
	CudaErrorCompatNotSupportedOnDevice     CudaError = 804
	CudaErrorMpsConnectionFailed            CudaError = 805
	CudaErrorMpsRpcFailure                  CudaError = 806
	CudaErrorMpsServerNotReady              CudaError = 807
	CudaErrorMpsMaxClientsReached           CudaError = 808
	CudaErrorMpsMaxConnectionsReached       CudaError = 809
	CudaErrorMpsClientTerminated            CudaError = 810
	CudaErrorCdpNotSupported                CudaError = 811
	CudaErrorCdpVersionMismatch             CudaError = 812
	CudaErrorStreamCaptureUnsupported       CudaError = 900
	CudaErrorStreamCaptureInvalidated       CudaError = 901
	CudaErrorStreamCaptureMerge             CudaError = 902
	CudaErrorStreamCaptureUnmatched         CudaError = 903
	CudaErrorStreamCaptureUnjoined          CudaError = 904
	CudaErrorStreamCaptureIsolation         CudaError = 905
	CudaErrorStreamCaptureImplicit          CudaError = 906
	CudaErrorCapturedEvent                  CudaError = 907
	CudaErrorStreamCaptureWrongThread       CudaError = 908
	CudaErrorTimeout                        CudaError = 909
	CudaErrorGraphExecUpdateFailure         CudaError = 910
	CudaErrorExternalDevice                 CudaError = 911
	CudaErrorInvalidClusterSize             CudaError = 912
	CudaErrorUnknown                        CudaError = 999
	CudaErrorApiFailureBase                 CudaError = 10000
)

CudaErrorT enumeration from include/driver_types.h:2868

func CopyFromDevice

func CopyFromDevice(hostDst, deviceSrc unsafe.Pointer, size uint) (unsafe.Pointer, CudaError)

func CopyFromDeviceAsync

func CopyFromDeviceAsync(hostDst, deviceSrc unsafe.Pointer, size uint, stream CudaStream) CudaError

func CopyToDevice

func CopyToDevice(deviceDst, hostSrc unsafe.Pointer, size uint) (unsafe.Pointer, CudaError)

func CopyToDeviceAsync

func CopyToDeviceAsync(deviceDst, hostSrc unsafe.Pointer, size uint, stream CudaStream) CudaError

func DestroyStream

func DestroyStream(stream *Stream) CudaError

func Free

func Free(devicePtr unsafe.Pointer) CudaError

func FreeAsync

func FreeAsync(devicePtr unsafe.Pointer, stream Stream) CudaError

func GetDeviceCount

func GetDeviceCount() (int, CudaError)

func GetLastError

func GetLastError() CudaError

func Malloc

func Malloc(size uint) (unsafe.Pointer, CudaError)

func MallocAsync

func MallocAsync(size uint, stream CudaStream) (unsafe.Pointer, CudaError)

func SetDevice

func SetDevice(device int) CudaError

func SynchronizeStream

func SynchronizeStream(stream *Stream) CudaError

type CudaEvent

type CudaEvent C.cudaEvent_t

CudaEvent as declared in include/driver_types.h:2878

type CudaMemPool

type CudaMemPool C.cudaMemPool_t

CudaMemPool as declared in include/driver_types.h:2928

type CudaMemcpyKind

type CudaMemcpyKind C.uint
const (
	// CudaMemcpyHostToHost as declared in include/driver_types.h:1219
	CudaMemcpyHostToHost CudaMemcpyKind = iota
	// CudaMemcpyHostToDevice as declared in include/driver_types.h:1220
	CudaMemcpyHostToDevice CudaMemcpyKind = 1
	// CudaMemcpyDeviceToHost as declared in include/driver_types.h:1221
	CudaMemcpyDeviceToHost CudaMemcpyKind = 2
	// CudaMemcpyDeviceToDevice as declared in include/driver_types.h:1222
	CudaMemcpyDeviceToDevice CudaMemcpyKind = 3
	// CudaMemcpyDefault as declared in include/driver_types.h:1223
	CudaMemcpyDefault CudaMemcpyKind = 4
)

type CudaStream

type CudaStream C.cudaStream_t

CudaStream as declared in include/driver_types.h:2873

type CudaStreamCreateFlags

type CudaStreamCreateFlags C.uint
const (
	// CudaStreamDefault as defined in include/driver_types.h:98
	CudaStreamDefault CudaStreamCreateFlags = iota
	// CudaStreamNonBlocking as defined in include/driver_types.h:99
	CudaStreamNonBlocking CudaStreamCreateFlags = 1
)

type CudaStreamWaitFlags

type CudaStreamWaitFlags C.uint
const (
	// CudaEventWaitDefault as defined in include/driver_types.h:129
	CudaEventWaitDefault CudaStreamWaitFlags = iota
	// CudaEventWaitExternal as defined in include/driver_types.h:130
	CudaEventWaitExternal CudaStreamWaitFlags = 1
)

type DeviceContext

type DeviceContext struct {
	/// Stream to use. Default value: 0.
	Stream *Stream // Assuming the type is provided by a CUDA binding crate

	/// Index of the currently used GPU. Default value: 0.
	DeviceId uint

	/// Mempool to use. Default value: 0.
	// TODO: use cuda_bindings.CudaMemPool as type
	Mempool uint // Assuming the type is provided by a CUDA binding crate
}

type Stream

type Stream = CudaStream

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL