12.07.2015 Views

NVIDIA CUDA

NVIDIA CUDA

NVIDIA CUDA

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.20 Context Management 1033.20 Context ManagementFunctions• CUresult cuCtxAttach (CUcontext ∗pCtx, unsigned int Flags)Increment a context’s usage-count.• CUresult cuCtxCreate (CUcontext ∗pCtx, unsigned int Flags, CUdevice dev)Create a <strong>CUDA</strong> context.• CUresult cuCtxDestroy (CUcontext ctx)Destroy the current context or a floating <strong>CUDA</strong> context.• CUresult cuCtxDetach (CUcontext pCtx)Decrement a context’s usage-count.• CUresult cuCtxGetDevice (CUdevice ∗device)Returns the device ID for the current context.• CUresult cuCtxPopCurrent (CUcontext ∗pCtx)Pops the current <strong>CUDA</strong> context from the current CPU thread.• CUresult cuCtxPushCurrent (CUcontext NewCtx)Pushes a floating context on the current CPU thread.• CUresult cuCtxSynchronize (void)Block for a context’s tasks to complete.3.20.1 Detailed DescriptionThis section describes the context management functions of the low-level <strong>CUDA</strong> driver application programminginterface.3.20.2 Function Documentation3.20.2.1 CUresult cuCtxAttach (CUcontext ∗ pCtx, unsigned int Flags)Increments the usage count of the context and passes back a context handle in ∗pCtx that must be passed to cuCtxDetach()when the application is done with the context. cuCtxAttach() fails if there is no context current to thethread.Currently, the Flags parameter must be 0.Parameters:pCtx - Returned context handle of the current contextFlags - Context attach flags (must be 0)Generated on Wed Apr 1 16:11:42 2009 for <strong>NVIDIA</strong> <strong>CUDA</strong> Library by Doxygen

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!