Cuda Api Reference Manual

Cuda Api Reference Manual

CUDA API REFERENCE MANUAL October 2012 Version 5.0 Contents 1 API synchronization behavior1 1.1 Memcpy..................................................1 1.1.1 Synchronous...........................................1 1.1.2 Asynchronous..........................................1 1.2 Memset..................................................2 1.3 Kernel Launches.............................................2 2 Deprecated List 3 3 Module Index 11 3.1 Modules.................................................. 11 4 Data Structure Index 13 4.1 Data Structures.............................................. 13 5 Module Documentation 15 5.1 Device Management........................................... 15 5.1.1 Detailed Description....................................... 16 5.1.2 Function Documentation..................................... 16 5.1.2.1 cudaChooseDevice.................................. 16 5.1.2.2 cudaDeviceGetAttribute................................ 17 5.1.2.3 cudaDeviceGetByPCIBusId.............................. 20 5.1.2.4 cudaDeviceGetCacheConfig.............................. 20 5.1.2.5 cudaDeviceGetLimit.................................. 21 5.1.2.6 cudaDeviceGetPCIBusId............................... 21 5.1.2.7 cudaDeviceGetSharedMemConfig.......................... 22 5.1.2.8 cudaDeviceReset................................... 22 5.1.2.9 cudaDeviceSetCacheConfig.............................. 23 5.1.2.10 cudaDeviceSetLimit.................................. 23 5.1.2.11 cudaDeviceSetSharedMemConfig........................... 24 ii CONTENTS 5.1.2.12 cudaDeviceSynchronize................................ 25 5.1.2.13 cudaGetDevice..................................... 25 5.1.2.14 cudaGetDeviceCount................................. 26 5.1.2.15 cudaGetDeviceProperties............................... 26 5.1.2.16 cudaIpcCloseMemHandle............................... 30 5.1.2.17 cudaIpcGetEventHandle................................ 30 5.1.2.18 cudaIpcGetMemHandle................................ 30 5.1.2.19 cudaIpcOpenEventHandle............................... 31 5.1.2.20 cudaIpcOpenMemHandle............................... 31 5.1.2.21 cudaSetDevice..................................... 32 5.1.2.22 cudaSetDeviceFlags.................................. 33 5.1.2.23 cudaSetValidDevices................................. 34 5.2 Thread Management [DEPRECATED].................................. 35 5.2.1 Detailed Description....................................... 35 5.2.2 Function Documentation..................................... 35 5.2.2.1 cudaThreadExit.................................... 35 5.2.2.2 cudaThreadGetCacheConfig.............................. 36 5.2.2.3 cudaThreadGetLimit.................................. 36 5.2.2.4 cudaThreadSetCacheConfig.............................. 37 5.2.2.5 cudaThreadSetLimit.................................. 38 5.2.2.6 cudaThreadSynchronize................................ 39 5.3 Error Handling.............................................. 40 5.3.1 Detailed Description....................................... 40 5.3.2 Function Documentation..................................... 40 5.3.2.1 cudaGetErrorString.................................. 40 5.3.2.2 cudaGetLastError................................... 40 5.3.2.3 cudaPeekAtLastError................................. 41 5.4 Stream Management........................................... 42 5.4.1 Detailed Description....................................... 42 5.4.2 Typedef Documentation..................................... 42 5.4.2.1 cudaStreamCallback_t................................. 42 5.4.3 Function Documentation..................................... 43 5.4.3.1 cudaStreamAddCallback............................... 43 5.4.3.2 cudaStreamCreate................................... 43 5.4.3.3 cudaStreamCreateWithFlags............................. 44 5.4.3.4 cudaStreamDestroy.................................. 44 5.4.3.5 cudaStreamQuery................................... 45 Generated for NVIDIA CUDA Library by Doxygen CONTENTS iii 5.4.3.6 cudaStreamSynchronize................................ 45 5.4.3.7 cudaStreamWaitEvent................................. 45 5.5 Event Management............................................ 47 5.5.1 Detailed Description....................................... 47 5.5.2 Function Documentation..................................... 47 5.5.2.1 cudaEventCreate.................................... 47 5.5.2.2 cudaEventCreateWithFlags.............................. 48 5.5.2.3 cudaEventDestroy................................... 48 5.5.2.4 cudaEventElapsedTime................................ 49 5.5.2.5 cudaEventQuery.................................... 49 5.5.2.6 cudaEventRecord................................... 50 5.5.2.7 cudaEventSynchronize................................ 50 5.6 Execution Control............................................. 51 5.6.1 Detailed Description....................................... 51 5.6.2 Function Documentation..................................... 51 5.6.2.1 cudaConfigureCall................................... 51 5.6.2.2 cudaFuncGetAttributes................................ 52 5.6.2.3 cudaFuncSetCacheConfig............................... 52 5.6.2.4 cudaFuncSetSharedMemConfig............................ 53 5.6.2.5 cudaLaunch...................................... 54 5.6.2.6 cudaSetDoubleForDevice............................... 54 5.6.2.7 cudaSetDoubleForHost................................ 55 5.6.2.8 cudaSetupArgument.................................. 55 5.7 Memory Management........................................... 56 5.7.1 Detailed Description....................................... 59 5.7.2 Function Documentation..................................... 60 5.7.2.1 cudaArrayGetInfo................................... 60 5.7.2.2 cudaFree........................................ 60 5.7.2.3 cudaFreeArray..................................... 60 5.7.2.4 cudaFreeHost..................................... 61 5.7.2.5 cudaFreeMipmappedArray.............................. 61 5.7.2.6 cudaGetMipmappedArrayLevel............................ 62 5.7.2.7 cudaGetSymbolAddress................................ 62 5.7.2.8 cudaGetSymbolSize.................................. 63 5.7.2.9 cudaHostAlloc..................................... 63 5.7.2.10 cudaHostGetDevicePointer.............................. 64 5.7.2.11 cudaHostGetFlags................................... 65 Generated for NVIDIA CUDA Library by Doxygen iv CONTENTS 5.7.2.12 cudaHostRegister................................... 65 5.7.2.13 cudaHostUnregister.................................. 66 5.7.2.14 cudaMalloc...................................... 66 5.7.2.15 cudaMalloc3D..................................... 67 5.7.2.16 cudaMalloc3DArray.................................. 67 5.7.2.17 cudaMallocArray................................... 69 5.7.2.18 cudaMallocHost.................................... 70 5.7.2.19 cudaMallocMipmappedArray............................. 70 5.7.2.20 cudaMallocPitch.................................... 72 5.7.2.21 cudaMemcpy..................................... 73 5.7.2.22 cudaMemcpy2D.................................... 73 5.7.2.23 cudaMemcpy2DArrayToArray............................ 74 5.7.2.24 cudaMemcpy2DAsync................................ 75 5.7.2.25 cudaMemcpy2DFromArray.............................. 75 5.7.2.26 cudaMemcpy2DFromArrayAsync.......................... 76 5.7.2.27 cudaMemcpy2DToArray............................... 77 5.7.2.28 cudaMemcpy2DToArrayAsync............................ 78 5.7.2.29 cudaMemcpy3D.................................... 79 5.7.2.30 cudaMemcpy3DAsync................................ 80 5.7.2.31 cudaMemcpy3DPeer................................. 81 5.7.2.32 cudaMemcpy3DPeerAsync.............................. 82 5.7.2.33 cudaMemcpyArrayToArray.............................. 82 5.7.2.34 cudaMemcpyAsync.................................. 83 5.7.2.35 cudaMemcpyFromArray............................... 84 5.7.2.36 cudaMemcpyFromArrayAsync............................ 84 5.7.2.37 cudaMemcpyFromSymbol.............................. 85 5.7.2.38 cudaMemcpyFromSymbolAsync........................... 86 5.7.2.39 cudaMemcpyPeer................................... 86 5.7.2.40 cudaMemcpyPeerAsync................................ 87 5.7.2.41 cudaMemcpyToArray................................. 88 5.7.2.42 cudaMemcpyToArrayAsync.............................. 88 5.7.2.43 cudaMemcpyToSymbol................................ 89 5.7.2.44 cudaMemcpyToSymbolAsync............................. 90 5.7.2.45 cudaMemGetInfo................................... 90 5.7.2.46 cudaMemset...................................... 91 5.7.2.47 cudaMemset2D.................................... 91 5.7.2.48 cudaMemset2DAsync................................. 92 Generated for NVIDIA CUDA Library by Doxygen CONTENTS v 5.7.2.49 cudaMemset3D.................................... 92 5.7.2.50 cudaMemset3DAsync................................. 93 5.7.2.51 cudaMemsetAsync.................................. 94 5.7.2.52 make_cudaExtent................................... 94 5.7.2.53 make_cudaPitchedPtr................................. 94 5.7.2.54 make_cudaPos..................................... 95 5.8 Unified Addressing............................................ 96 5.8.1 Detailed Description....................................... 96 5.8.2 Overview............................................. 96 5.8.3 Supported Platforms....................................... 96 5.8.4 Looking Up Information from Pointer Values.........................

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    680 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us