Show / Hide Table of Contents

    Class PrimaryContext

    The primary context unique per device and it's shared with CUDA runtime API. Those functions allows seemless integration with other libraries using CUDA.

    Inheritance
    System.Object
    CudaContext
    PrimaryContext
    Implements
    System.IDisposable
    Inherited Members
    CudaContext._context
    CudaContext._device
    CudaContext._deviceID
    CudaContext.disposed
    CudaContext.Dispose()
    CudaContext.AddZeroToArray(Byte[])
    CudaContext.GetAPIVersionOfCurrentContext()
    CudaContext.Synchronize()
    CudaContext.PushContext()
    CudaContext.PopContext()
    CudaContext.SetCurrent()
    CudaContext.SetSharedMemConfig(CUsharedconfig)
    CudaContext.GetSharedMemConfig()
    CudaContext.LoadModule(String)
    CudaContext.LoadModulePTX(String, CUJITOption[], Object[])
    CudaContext.LoadModulePTX(String, CudaJitOptionCollection)
    CudaContext.LoadModulePTX(String)
    CudaContext.LoadModulePTX(Byte[], CudaJitOptionCollection)
    CudaContext.LoadModulePTX(Byte[], CUJITOption[], Object[])
    CudaContext.LoadModulePTX(Stream, CUJITOption[], Object[])
    CudaContext.LoadModulePTX(Stream, CudaJitOptionCollection)
    CudaContext.LoadModulePTX(Byte[])
    CudaContext.LoadModulePTX(Stream)
    CudaContext.LoadKernel(String, String)
    CudaContext.LoadKernelPTX(String, String, CUJITOption[], Object[])
    CudaContext.LoadKernelPTX(String, String, CudaJitOptionCollection)
    CudaContext.LoadKernelPTX(String, String)
    CudaContext.LoadKernelPTX(Byte[], String, CUJITOption[], Object[])
    CudaContext.LoadKernelPTX(Byte[], String, CudaJitOptionCollection)
    CudaContext.LoadKernelPTX(Stream, String, CUJITOption[], Object[])
    CudaContext.LoadKernelPTX(Stream, String, CudaJitOptionCollection)
    CudaContext.LoadKernelPTX(Byte[], String)
    CudaContext.LoadKernelPTX(Stream, String)
    CudaContext.LoadModuleFatBin(Byte[])
    CudaContext.LoadModuleFatBin(Stream)
    CudaContext.LoadKernelFatBin(Byte[], String)
    CudaContext.LoadKernelFatBin(Stream, String)
    CudaContext.UnloadModule(CUmodule)
    CudaContext.UnloadKernel(CudaKernel)
    CudaContext.AllocateMemory(SizeT)
    CudaContext.ClearMemory(CUdeviceptr, Byte, SizeT)
    CudaContext.ClearMemory(CUdeviceptr, UInt16, SizeT)
    CudaContext.ClearMemory(CUdeviceptr, UInt32, SizeT)
    CudaContext.ClearMemory(CUdeviceptr, Byte, SizeT, SizeT, SizeT)
    CudaContext.ClearMemory(CUdeviceptr, UInt16, SizeT, SizeT, SizeT)
    CudaContext.ClearMemory(CUdeviceptr, UInt32, SizeT, SizeT, SizeT)
    CudaContext.ClearMemoryAsync(CUdeviceptr, Byte, SizeT, CUstream)
    CudaContext.ClearMemoryAsync(CUdeviceptr, UInt16, SizeT, CUstream)
    CudaContext.ClearMemoryAsync(CUdeviceptr, UInt32, SizeT, CUstream)
    CudaContext.ClearMemoryAsync(CUdeviceptr, Byte, SizeT, SizeT, SizeT, CUstream)
    CudaContext.ClearMemoryAsync(CUdeviceptr, UInt16, SizeT, SizeT, SizeT, CUstream)
    CudaContext.ClearMemoryAsync(CUdeviceptr, UInt32, SizeT, SizeT, SizeT, CUstream)
    CudaContext.FreeMemory(CUdeviceptr)
    CudaContext.GetTotalDeviceMemorySize()
    CudaContext.GetFreeDeviceMemorySize()
    CudaContext.DeviceCanAccessPeer(CudaContext)
    CudaContext.GetCacheConfig()
    CudaContext.SetCacheConfig(CUFuncCache)
    CudaContext.CopyToDevice(CUdeviceptr, IntPtr, SizeT)
    CudaContext.CopyToDevice<T>(CUdeviceptr, T[])
    CudaContext.CopyToDevice<T>(CUdeviceptr, T)
    CudaContext.CopyToDevice(CUdeviceptr, Byte[])
    CudaContext.CopyToDevice(CUdeviceptr, Double[])
    CudaContext.CopyToDevice(CUdeviceptr, Single[])
    CudaContext.CopyToDevice(CUdeviceptr, Int32[])
    CudaContext.CopyToDevice(CUdeviceptr, Int64[])
    CudaContext.CopyToDevice(CUdeviceptr, SByte[])
    CudaContext.CopyToDevice(CUdeviceptr, Int16[])
    CudaContext.CopyToDevice(CUdeviceptr, UInt32[])
    CudaContext.CopyToDevice(CUdeviceptr, UInt64[])
    CudaContext.CopyToDevice(CUdeviceptr, UInt16[])
    CudaContext.CopyToDevice(CUdeviceptr, dim3[])
    CudaContext.CopyToDevice(CUdeviceptr, char1[])
    CudaContext.CopyToDevice(CUdeviceptr, char2[])
    CudaContext.CopyToDevice(CUdeviceptr, char3[])
    CudaContext.CopyToDevice(CUdeviceptr, char4[])
    CudaContext.CopyToDevice(CUdeviceptr, uchar1[])
    CudaContext.CopyToDevice(CUdeviceptr, uchar2[])
    CudaContext.CopyToDevice(CUdeviceptr, uchar3[])
    CudaContext.CopyToDevice(CUdeviceptr, uchar4[])
    CudaContext.CopyToDevice(CUdeviceptr, short1[])
    CudaContext.CopyToDevice(CUdeviceptr, short2[])
    CudaContext.CopyToDevice(CUdeviceptr, short3[])
    CudaContext.CopyToDevice(CUdeviceptr, short4[])
    CudaContext.CopyToDevice(CUdeviceptr, ushort1[])
    CudaContext.CopyToDevice(CUdeviceptr, ushort2[])
    CudaContext.CopyToDevice(CUdeviceptr, ushort3[])
    CudaContext.CopyToDevice(CUdeviceptr, ushort4[])
    CudaContext.CopyToDevice(CUdeviceptr, int1[])
    CudaContext.CopyToDevice(CUdeviceptr, int2[])
    CudaContext.CopyToDevice(CUdeviceptr, int3[])
    CudaContext.CopyToDevice(CUdeviceptr, int4[])
    CudaContext.CopyToDevice(CUdeviceptr, uint1[])
    CudaContext.CopyToDevice(CUdeviceptr, uint2[])
    CudaContext.CopyToDevice(CUdeviceptr, uint3[])
    CudaContext.CopyToDevice(CUdeviceptr, uint4[])
    CudaContext.CopyToDevice(CUdeviceptr, long1[])
    CudaContext.CopyToDevice(CUdeviceptr, long2[])
    CudaContext.CopyToDevice(CUdeviceptr, long3[])
    CudaContext.CopyToDevice(CUdeviceptr, long4[])
    CudaContext.CopyToDevice(CUdeviceptr, ulong1[])
    CudaContext.CopyToDevice(CUdeviceptr, ulong2[])
    CudaContext.CopyToDevice(CUdeviceptr, ulong3[])
    CudaContext.CopyToDevice(CUdeviceptr, ulong4[])
    CudaContext.CopyToDevice(CUdeviceptr, float1[])
    CudaContext.CopyToDevice(CUdeviceptr, float2[])
    CudaContext.CopyToDevice(CUdeviceptr, float3[])
    CudaContext.CopyToDevice(CUdeviceptr, float4[])
    CudaContext.CopyToDevice(CUdeviceptr, double1[])
    CudaContext.CopyToDevice(CUdeviceptr, double2[])
    CudaContext.CopyToDevice(CUdeviceptr, cuDoubleComplex[])
    CudaContext.CopyToDevice(CUdeviceptr, cuDoubleReal[])
    CudaContext.CopyToDevice(CUdeviceptr, cuFloatComplex[])
    CudaContext.CopyToDevice(CUdeviceptr, cuFloatReal[])
    CudaContext.CopyToDevice(CUdeviceptr, Byte)
    CudaContext.CopyToDevice(CUdeviceptr, Double)
    CudaContext.CopyToDevice(CUdeviceptr, Single)
    CudaContext.CopyToDevice(CUdeviceptr, Int32)
    CudaContext.CopyToDevice(CUdeviceptr, Int64)
    CudaContext.CopyToDevice(CUdeviceptr, SByte)
    CudaContext.CopyToDevice(CUdeviceptr, Int16)
    CudaContext.CopyToDevice(CUdeviceptr, UInt32)
    CudaContext.CopyToDevice(CUdeviceptr, UInt64)
    CudaContext.CopyToDevice(CUdeviceptr, UInt16)
    CudaContext.CopyToDevice(CUdeviceptr, dim3)
    CudaContext.CopyToDevice(CUdeviceptr, char1)
    CudaContext.CopyToDevice(CUdeviceptr, char2)
    CudaContext.CopyToDevice(CUdeviceptr, char3)
    CudaContext.CopyToDevice(CUdeviceptr, char4)
    CudaContext.CopyToDevice(CUdeviceptr, uchar1)
    CudaContext.CopyToDevice(CUdeviceptr, uchar2)
    CudaContext.CopyToDevice(CUdeviceptr, uchar3)
    CudaContext.CopyToDevice(CUdeviceptr, uchar4)
    CudaContext.CopyToDevice(CUdeviceptr, short1)
    CudaContext.CopyToDevice(CUdeviceptr, short2)
    CudaContext.CopyToDevice(CUdeviceptr, short3)
    CudaContext.CopyToDevice(CUdeviceptr, short4)
    CudaContext.CopyToDevice(CUdeviceptr, ushort1)
    CudaContext.CopyToDevice(CUdeviceptr, ushort2)
    CudaContext.CopyToDevice(CUdeviceptr, ushort3)
    CudaContext.CopyToDevice(CUdeviceptr, ushort4)
    CudaContext.CopyToDevice(CUdeviceptr, int1)
    CudaContext.CopyToDevice(CUdeviceptr, int2)
    CudaContext.CopyToDevice(CUdeviceptr, int3)
    CudaContext.CopyToDevice(CUdeviceptr, int4)
    CudaContext.CopyToDevice(CUdeviceptr, uint1)
    CudaContext.CopyToDevice(CUdeviceptr, uint2)
    CudaContext.CopyToDevice(CUdeviceptr, uint3)
    CudaContext.CopyToDevice(CUdeviceptr, uint4)
    CudaContext.CopyToDevice(CUdeviceptr, long1)
    CudaContext.CopyToDevice(CUdeviceptr, long2)
    CudaContext.CopyToDevice(CUdeviceptr, long3)
    CudaContext.CopyToDevice(CUdeviceptr, long4)
    CudaContext.CopyToDevice(CUdeviceptr, ulong1)
    CudaContext.CopyToDevice(CUdeviceptr, ulong2)
    CudaContext.CopyToDevice(CUdeviceptr, ulong3)
    CudaContext.CopyToDevice(CUdeviceptr, ulong4)
    CudaContext.CopyToDevice(CUdeviceptr, float1)
    CudaContext.CopyToDevice(CUdeviceptr, float2)
    CudaContext.CopyToDevice(CUdeviceptr, float3)
    CudaContext.CopyToDevice(CUdeviceptr, float4)
    CudaContext.CopyToDevice(CUdeviceptr, double1)
    CudaContext.CopyToDevice(CUdeviceptr, double2)
    CudaContext.CopyToDevice(CUdeviceptr, cuDoubleComplex)
    CudaContext.CopyToDevice(CUdeviceptr, cuDoubleReal)
    CudaContext.CopyToDevice(CUdeviceptr, cuFloatComplex)
    CudaContext.CopyToDevice(CUdeviceptr, cuFloatReal)
    CudaContext.CopyToHost<T>(T[], CUdeviceptr)
    CudaContext.CopyToHost<T>(T, CUdeviceptr)
    CudaContext.CopyToHost(Byte[], CUdeviceptr)
    CudaContext.CopyToHost(Double[], CUdeviceptr)
    CudaContext.CopyToHost(Single[], CUdeviceptr)
    CudaContext.CopyToHost(Int32[], CUdeviceptr)
    CudaContext.CopyToHost(IntPtr, CUdeviceptr, UInt32)
    CudaContext.CopyToHost(Int64[], CUdeviceptr)
    CudaContext.CopyToHost(SByte[], CUdeviceptr)
    CudaContext.CopyToHost(Int16[], CUdeviceptr)
    CudaContext.CopyToHost(UInt32[], CUdeviceptr)
    CudaContext.CopyToHost(UInt64[], CUdeviceptr)
    CudaContext.CopyToHost(UInt16[], CUdeviceptr)
    CudaContext.CopyToHost(dim3[], CUdeviceptr)
    CudaContext.CopyToHost(char1[], CUdeviceptr)
    CudaContext.CopyToHost(char2[], CUdeviceptr)
    CudaContext.CopyToHost(char3[], CUdeviceptr)
    CudaContext.CopyToHost(char4[], CUdeviceptr)
    CudaContext.CopyToHost(uchar1[], CUdeviceptr)
    CudaContext.CopyToHost(uchar2[], CUdeviceptr)
    CudaContext.CopyToHost(uchar3[], CUdeviceptr)
    CudaContext.CopyToHost(uchar4[], CUdeviceptr)
    CudaContext.CopyToHost(short1[], CUdeviceptr)
    CudaContext.CopyToHost(short2[], CUdeviceptr)
    CudaContext.CopyToHost(short3[], CUdeviceptr)
    CudaContext.CopyToHost(short4[], CUdeviceptr)
    CudaContext.CopyToHost(ushort1[], CUdeviceptr)
    CudaContext.CopyToHost(ushort2[], CUdeviceptr)
    CudaContext.CopyToHost(ushort3[], CUdeviceptr)
    CudaContext.CopyToHost(ushort4[], CUdeviceptr)
    CudaContext.CopyToHost(int1[], CUdeviceptr)
    CudaContext.CopyToHost(int2[], CUdeviceptr)
    CudaContext.CopyToHost(int3[], CUdeviceptr)
    CudaContext.CopyToHost(int4[], CUdeviceptr)
    CudaContext.CopyToHost(uint1[], CUdeviceptr)
    CudaContext.CopyToHost(uint2[], CUdeviceptr)
    CudaContext.CopyToHost(uint3[], CUdeviceptr)
    CudaContext.CopyToHost(uint4[], CUdeviceptr)
    CudaContext.CopyToHost(long1[], CUdeviceptr)
    CudaContext.CopyToHost(long2[], CUdeviceptr)
    CudaContext.CopyToHost(long3[], CUdeviceptr)
    CudaContext.CopyToHost(long4[], CUdeviceptr)
    CudaContext.CopyToHost(ulong1[], CUdeviceptr)
    CudaContext.CopyToHost(ulong2[], CUdeviceptr)
    CudaContext.CopyToHost(ulong3[], CUdeviceptr)
    CudaContext.CopyToHost(ulong4[], CUdeviceptr)
    CudaContext.CopyToHost(float1[], CUdeviceptr)
    CudaContext.CopyToHost(float2[], CUdeviceptr)
    CudaContext.CopyToHost(float3[], CUdeviceptr)
    CudaContext.CopyToHost(float4[], CUdeviceptr)
    CudaContext.CopyToHost(double1[], CUdeviceptr)
    CudaContext.CopyToHost(double2[], CUdeviceptr)
    CudaContext.CopyToHost(cuDoubleComplex[], CUdeviceptr)
    CudaContext.CopyToHost(cuDoubleReal[], CUdeviceptr)
    CudaContext.CopyToHost(cuFloatComplex[], CUdeviceptr)
    CudaContext.CopyToHost(cuFloatReal[], CUdeviceptr)
    CudaContext.CopyToHost(Byte, CUdeviceptr)
    CudaContext.CopyToHost(Double, CUdeviceptr)
    CudaContext.CopyToHost(Single, CUdeviceptr)
    CudaContext.CopyToHost(Int32, CUdeviceptr)
    CudaContext.CopyToHost(Int64, CUdeviceptr)
    CudaContext.CopyToHost(SByte, CUdeviceptr)
    CudaContext.CopyToHost(Int16, CUdeviceptr)
    CudaContext.CopyToHost(UInt32, CUdeviceptr)
    CudaContext.CopyToHost(UInt64, CUdeviceptr)
    CudaContext.CopyToHost(UInt16, CUdeviceptr)
    CudaContext.CopyToHost(dim3, CUdeviceptr)
    CudaContext.CopyToHost(char1, CUdeviceptr)
    CudaContext.CopyToHost(char2, CUdeviceptr)
    CudaContext.CopyToHost(char3, CUdeviceptr)
    CudaContext.CopyToHost(char4, CUdeviceptr)
    CudaContext.CopyToHost(uchar1, CUdeviceptr)
    CudaContext.CopyToHost(uchar2, CUdeviceptr)
    CudaContext.CopyToHost(uchar3, CUdeviceptr)
    CudaContext.CopyToHost(uchar4, CUdeviceptr)
    CudaContext.CopyToHost(short1, CUdeviceptr)
    CudaContext.CopyToHost(short2, CUdeviceptr)
    CudaContext.CopyToHost(short3, CUdeviceptr)
    CudaContext.CopyToHost(short4, CUdeviceptr)
    CudaContext.CopyToHost(ushort1, CUdeviceptr)
    CudaContext.CopyToHost(ushort2, CUdeviceptr)
    CudaContext.CopyToHost(ushort3, CUdeviceptr)
    CudaContext.CopyToHost(ushort4, CUdeviceptr)
    CudaContext.CopyToHost(int1, CUdeviceptr)
    CudaContext.CopyToHost(int2, CUdeviceptr)
    CudaContext.CopyToHost(int3, CUdeviceptr)
    CudaContext.CopyToHost(int4, CUdeviceptr)
    CudaContext.CopyToHost(uint1, CUdeviceptr)
    CudaContext.CopyToHost(uint2, CUdeviceptr)
    CudaContext.CopyToHost(uint3, CUdeviceptr)
    CudaContext.CopyToHost(uint4, CUdeviceptr)
    CudaContext.CopyToHost(long1, CUdeviceptr)
    CudaContext.CopyToHost(long2, CUdeviceptr)
    CudaContext.CopyToHost(long3, CUdeviceptr)
    CudaContext.CopyToHost(long4, CUdeviceptr)
    CudaContext.CopyToHost(ulong1, CUdeviceptr)
    CudaContext.CopyToHost(ulong2, CUdeviceptr)
    CudaContext.CopyToHost(ulong3, CUdeviceptr)
    CudaContext.CopyToHost(ulong4, CUdeviceptr)
    CudaContext.CopyToHost(float1, CUdeviceptr)
    CudaContext.CopyToHost(float2, CUdeviceptr)
    CudaContext.CopyToHost(float3, CUdeviceptr)
    CudaContext.CopyToHost(float4, CUdeviceptr)
    CudaContext.CopyToHost(double1, CUdeviceptr)
    CudaContext.CopyToHost(double2, CUdeviceptr)
    CudaContext.CopyToHost(cuDoubleComplex, CUdeviceptr)
    CudaContext.CopyToHost(cuDoubleReal, CUdeviceptr)
    CudaContext.CopyToHost(cuFloatComplex, CUdeviceptr)
    CudaContext.CopyToHost(cuFloatReal, CUdeviceptr)
    CudaContext.GetDeviceName()
    CudaContext.GetDeviceComputeCapability()
    CudaContext.GetDeviceInfo()
    CudaContext.GetStreamPriorityRange(Int32, Int32)
    CudaContext.GetLimit(CULimit)
    CudaContext.SetLimit(CULimit, SizeT)
    CudaContext.CreateOpenGLContext(Int32, CUCtxFlags)
    CudaContext.GetOpenGLDevices(CUGLDeviceList)
    CudaContext.GetDirectXDevices(IntPtr, CUd3dXDeviceList, CudaContext.DirectXVersion)
    CudaContext.GetDirect3DDevice(CudaContext.DirectXVersion)
    CudaContext.GetDeviceName(Int32)
    CudaContext._ConvertSMVer2Cores(Int32, Int32)
    CudaContext.GetMaxGflopsDevice()
    CudaContext.GetMaxGflopsDeviceId()
    CudaContext.GetDeviceComputeCapability(Int32)
    CudaContext.GetDriverVersion()
    CudaContext.GetDeviceInfo(Int32)
    CudaContext.GetDeviceCount()
    CudaContext.EnablePeerAccess(CudaContext)
    CudaContext.DisablePeerAccess(CudaContext)
    CudaContext.GetDeviceInfo(CUdevice)
    CudaContext.GetCUdevice(Int32)
    CudaContext.ProfilerInitialize(String, String, CUoutputMode)
    CudaContext.ProfilerStart()
    CudaContext.ProfilerStop()
    CudaContext.Context
    CudaContext.Device
    CudaContext.DeviceId
    CudaContext.IsContextOwner
    CudaContext.Flags
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: ManagedCuda
    Assembly: ManagedCuda.dll
    Syntax
    public class PrimaryContext : CudaContext, IDisposable

    Constructors

    | Improve this Doc View Source

    PrimaryContext()

    Create a new instace of managed Cuda. Retains the primary cuda context of device with ID 0.

    Declaration
    public PrimaryContext()
    | Improve this Doc View Source

    PrimaryContext(Int32)

    Create a new instace of managed Cuda. Retains the primary cuda context of device with ID deviceId. Using SchedAuto

    Declaration
    public PrimaryContext(int deviceId)
    Parameters
    Type Name Description
    System.Int32 deviceId

    DeviceID

    Methods

    | Improve this Doc View Source

    Dispose(Boolean)

    For IDisposable. Releases the wrapped primary context

    Declaration
    protected override void Dispose(bool fDisposing)
    Parameters
    Type Name Description
    System.Boolean fDisposing
    Overrides
    CudaContext.Dispose(Boolean)
    | Improve this Doc View Source

    Finalize()

    For dispose

    Declaration
    protected void Finalize()
    | Improve this Doc View Source

    GetState(CUdevice, out CUCtxFlags, out Boolean)

    Get the state of the primary context

    Returns in flags the flags for the primary context of device, and in active whether it is active. See ::cuDevicePrimaryCtxSetFlags for flag values.

    Declaration
    public static void GetState(CUdevice device, out CUCtxFlags flags, out bool active)
    Parameters
    Type Name Description
    CUdevice device

    Device to get primary context flags for

    CUCtxFlags flags

    Pointer to store flags

    System.Boolean active

    Pointer to store context state

    | Improve this Doc View Source

    GetState(Int32, out CUCtxFlags, out Boolean)

    Get the state of the primary context

    Returns in flags the flags for the primary context of device, and in active whether it is active. See ::cuDevicePrimaryCtxSetFlags for flag values.

    Declaration
    public static void GetState(int deviceID, out CUCtxFlags flags, out bool active)
    Parameters
    Type Name Description
    System.Int32 deviceID

    Device to get primary context flags for

    CUCtxFlags flags

    Pointer to store flags

    System.Boolean active

    Pointer to store context state

    | Improve this Doc View Source

    Reset(CUdevice)

    Destroy all allocations and reset all state on the primary context

    Explicitly destroys and cleans up all resources associated with the current device in the current process.

    Note that it is responsibility of the calling function to ensure that no other module in the process is using the device any more. For that reason it is recommended to use ::cuDevicePrimaryCtxRelease() in most cases. However it is safe for other modules to call ::cuDevicePrimaryCtxRelease() even after resetting the device.

    Declaration
    public static void Reset(CUdevice device)
    Parameters
    Type Name Description
    CUdevice device

    Device for which primary context is destroyed

    | Improve this Doc View Source

    Reset(Int32)

    Destroy all allocations and reset all state on the primary context

    Explicitly destroys and cleans up all resources associated with the current device in the current process.

    Note that it is responsibility of the calling function to ensure that no other module in the process is using the device any more. For that reason it is recommended to use ::cuDevicePrimaryCtxRelease() in most cases. However it is safe for other modules to call ::cuDevicePrimaryCtxRelease() even after resetting the device.

    Declaration
    public static void Reset(int deviceID)
    Parameters
    Type Name Description
    System.Int32 deviceID

    Device for which primary context is destroyed

    | Improve this Doc View Source

    SetFlags(CUdevice, CUCtxFlags)

    Set flags for the primary context

    Sets the flags for the primary context on the device overwriting perviously set ones. If the primary context is already created ::CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE is returned.

    The three LSBs of the \p flags parameter can be used to control how the OS thread, which owns the CUDA context at the time of an API call, interacts with the OS scheduler when waiting for results from the GPU. Only one of the scheduling flags can be set when creating a context.

    Declaration
    public static void SetFlags(CUdevice device, CUCtxFlags flags)
    Parameters
    Type Name Description
    CUdevice device

    Device for which the primary context flags are set

    CUCtxFlags flags

    New flags for the device

    | Improve this Doc View Source

    SetFlags(Int32, CUCtxFlags)

    Set flags for the primary context

    Sets the flags for the primary context on the device overwriting perviously set ones. If the primary context is already created ::CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE is returned.

    The three LSBs of the \p flags parameter can be used to control how the OS thread, which owns the CUDA context at the time of an API call, interacts with the OS scheduler when waiting for results from the GPU. Only one of the scheduling flags can be set when creating a context.

    Declaration
    public static void SetFlags(int deviceID, CUCtxFlags flags)
    Parameters
    Type Name Description
    System.Int32 deviceID

    Device for which the primary context flags are set

    CUCtxFlags flags

    New flags for the device

    Implements

    System.IDisposable
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX