This section lists the package's public functionality that directly corresponds to functionality of the CUDA driver API. In general, the abstractions stay close to those of the CUDA driver API, so for more information on certain library calls you can consult the CUDA driver API reference.
The documentation is grouped according to the modules of the driver API.
CUDAdrv.CuError
CUDAdrv.name(::CuError)
CUDAdrv.description(::CuError)
CUDAdrv.version()
CUDAdrv.CuDevice
CUDAdrv.devices
CUDAdrv.name(::CuDevice)
CUDAdrv.totalmem(::CuDevice)
CUDAdrv.attribute
Certain common attributes are exposed by additional convenience functions:
CUDAdrv.capability(::CuDevice)
CUDAdrv.warpsize(::CuDevice)
CUDAdrv.CuContext
CUDAdrv.destroy!(::CuContext)
CUDAdrv.CuCurrentContext
CUDAdrv.activate(::CuContext)
CUDAdrv.synchronize()
CUDAdrv.device(::CuContext)
CUDAdrv.CuPrimaryContext
CUDAdrv.CuContext(::CuPrimaryContext)
CUDAdrv.isactive(::CuPrimaryContext)
CUDAdrv.flags(::CuPrimaryContext)
CUDAdrv.setflags!(::CuPrimaryContext, ::CUDAdrv.CUctx_flags)
CUDAdrv.unsafe_reset!(::CuPrimaryContext, ::Bool)
CUDAdrv.CuModule
CUDAdrv.CuFunction
CUDAdrv.CuGlobal
CUDAdrv.eltype(::CuGlobal)
Base.getindex(::CuGlobal)
Base.setindex!(::CuGlobal{T}, ::T) where {T}
CUDAdrv.CuLink
CUDAdrv.add_data!
CUDAdrv.add_file!
CUDAdrv.CuLinkImage
CUDAdrv.complete
CUDAdrv.CuModule(::CUDAdrv.CuLinkImage, args...)
Three kinds of memory buffers can be allocated: device memory, host memory, and unified
memory. Each of these buffers can be allocated by calling alloc
with the type of buffer as
first argument, and freed by calling free
. Certain buffers have specific methods defined.
CUDAdrv.Mem.DeviceBuffer
CUDAdrv.Mem.alloc(::Type{Mem.DeviceBuffer}, ::Integer)
CUDAdrv.Mem.HostBuffer
CUDAdrv.Mem.alloc(::Type{Mem.HostBuffer}, ::Integer, flags)
CUDAdrv.Mem.register(::Type{Mem.HostBuffer}, ::Ptr, ::Integer, flags)
CUDAdrv.Mem.unregister(::Mem.HostBuffer)
CUDAdrv.Mem.UnifiedBuffer
CUDAdrv.Mem.alloc(::Type{Mem.UnifiedBuffer}, ::Integer, ::CUDAdrv.CUmemAttach_flags)
CUDAdrv.Mem.prefetch(::Mem.UnifiedBuffer, bytes::Integer; device, stream)
CUDAdrv.Mem.advise(::Mem.UnifiedBuffer, ::CUDAdrv.CUmem_advise, ::Integer; device)
To work with these buffers, you need to convert
them to a Ptr
or CuPtr
. Several
methods then work with these raw pointers:
CUDAdrv.available_memory
CUDAdrv.total_memory
CUDAdrv.CuStream
CUDAdrv.CuDefaultStream
CUDAdrv.synchronize(::CuStream)
CUDAdrv.CuEvent
CUDAdrv.record
CUDAdrv.synchronize(::CuEvent)
CUDAdrv.elapsed
CUDAdrv.@elapsed
CUDAdrv.CuDim3
CUDAdrv.cudacall
CUDAdrv.launch
CUDAdrv.@profile
CUDAdrv.Profile.start
CUDAdrv.Profile.stop