NVIDIA CUDA计算统一设备架构参考手册2_第1页
NVIDIA CUDA计算统一设备架构参考手册2_第2页
NVIDIA CUDA计算统一设备架构参考手册2_第3页
NVIDIA CUDA计算统一设备架构参考手册2_第4页
NVIDIA CUDA计算统一设备架构参考手册2_第5页
已阅读5页,还剩246页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

NVIDIACUDA

计算统一设备架构

DeviceArchitecture

参考手册

Version2.0

2008年6月

目录

1RuntimeApiReference1

1.1DeviceManagementRT......................................................................................................................................2

1.1.1cudaGetDeviceCount..............................................................................................................................3

1.1.2cudaSetDevice........................................................................................................................................4

1.1.3cudaGetDevice........................................................................................................................................5

1.1.4cudaGetDeviceProperties.......................................................................................................................6

1.1.5cudaChooseDevice.................................................................................................................................8

1.2ThreadManagementRT......................................................................................................................................9

1.2.1cudaThrcadSynchronize...........................................................................................................................10

1.2.2cudaThreadExit........................................................................................................................................11

1.3StreamManagementRT.......................................................................................................................................12

1.3.1cudaStreamCreate....................................................................................................................................13

1.3.2cudaStreamQuery....................................................................................................................................14

1.3.3cudaStreamSynchronize.........................................................................................................................15

1.3.4cudaStreamDestroy.................................................................................................................................16

1.4EventManagementRT.........................................................................................................................................17

1.4.1cudaEventCreate......................................................................................................................................18

1.4.2cudaEventRecord.....................................................................................................................................19

1.4.3cudaEventQuery.....................................................................................................................................20

1.4.4cudaEventSynchronize...........................................................................................................................21

1.4.5cudaEventDestroy...................................................................................................................................22

1.4.6cudaEventElapsedTime..........................................................................................................................23

1.5MemoryManagementRT...................................................................................................................................24

1.5.1cudaMalloc..............................................................................................................................................25

1.5.2cudaMallocPitch.....................................................................................................................................26

1.5.3cudaFree...................................................................................................................................................27

1.5.4cudaMallocArray....................................................................................................................................28

1.5.5cudaFreeArray........................................................................................................................................29

1.5.6cudaMallocHost......................................................................................................................................30

1.5.7cudaFreeHost..........................................................................................................................................31

1.5.8cudaMemset............................................................................................................................................32

1.5.9cudaMemset2D.......................................................................................................................................33

ii

1.5.10cudaMemcpy......................................................................................................................................34

1.5.11cudaMemcpy2D.................................................................................................................................35

1.5.12cudaMemcpyToArray........................................................................................................................36

1.5.13cudaMemcpy2DToArray...................................................................................................................37

1.5.14cudaMemcpyFromArray...................................................................................................................38

1.5.15cudaMemcpy2DFromArray..............................................................................................................39

1.5.16cudaMemcpyArrayToArray..............................................................................................................40

1.5.17cudaMemcpy2DArrayToArray........................................................................................................41

1.5.18cudaMemcpyToSymbol....................................................................................................................42

1.5.19cudaMemcpyFromSymbol................................................................................................................43

1.5.20cudaGetSymbolAddress....................................................................................................................44

1.5.21cudaGetSymbolSize...........................................................................................................................45

1.5.22cudaMalloc3D...................................................................................................................................46

1.5.23cudaMalloc3DArray..........................................................................................................................48

1.5.24cudaMemset3D..................................................................................................................................50

1.5.25cudaMemcpy3D.................................................................................................................................52

1.6TextureReferenceManagementRT.................................................................................................................54

1.6.1LowLevelApi.......................................................................................................................................55

1.6.2HighLevelApi.......................................................................................................................................63

1.7ExecutionControlRT.......................................................................................................................................68

1.7.1cudaConfigureCall................................................................................................................................69

1.7.2cudaLaunch..........................................................................................................................................70

1.7.3cudaSetupArgument............................................................................................................................71

1.8OpenGlInteroperabilityRT.............................................................................................................................72

1.8.1cudaGLSetGLDevice...........................................................................................................................73

1.8.2cudaGLRegisterBufferObject..............................................................................................................74

1.8.3cudaGLMapBufferObject....................................................................................................................75

1.8.4cudaGLUnmapBufferObject...............................................................................................................76

1.8.5cudaGLUnregisterBufferObject.........................................................................................................77

1.9Direct3dlnteroperabilityRT............................................................................................................................78

1.9.1cudaD3D9SetDirect3DDevice.............................................................................................................79

1.9.2cudaD3D9GetDirect3DDevice............................................................................................................80

1.9.3cudaD3D9RegisterResource................................................................................................................81

1.9.4cudaD3D9UnregisterResource...........................................................................................................83

ii

1.9.5cudaD3D9MapResources......................................................................................................................84

1.9.6cudaD3D9UnmapResources..................................................................................................................85

1.9.7cudaD3D9ResourceSetMapFlags.........................................................................................................86

1.9.8cudaD3D9ResourceGetSurfaceDimensions........................................................................................88

1.9.9cudaD3D9ResourceGetMappedPointer................................................................................................89

1.9.10cudaD3D9ResourceGetMappedSize...................................................................................................90

1.9.11cudaD3D9ResourceGetMappedPitch.................................................................................................91

1.9.12cudaD3D9Begin..................................................................................................................................92

1.9.13cudaD3D9End.....................................................................................................................................93

1.9.14cudaD3D9RegisterVertexBuffer........................................................................................................94

1.9.15cudaD3D9MapVertexBuffer..............................................................................................................95

1.9.16cudaD3D9UnmapVertexBuffer..........................................................................................................96

1.9.17cudaD3D9UnregisterVertexBuffer.....................................................................................................97

1.9.18cudaD3D9GetDevice...........................................................................................................................98

LlOErrorHandlingRT............................................................................................................................................99

1.10.1cudaGetLastError................................................................................................................................100

1.10.2cudaGetErrorString............................................................................................................................102

2DriverApiReference103

2.1Initialization......................................................................................................................................................104

2.1.1culnit......................................................................................................................................................105

2.2DeviceManagement..........................................................................................................................................106

2.2.1cuDeviceComputeCapability...............................................................................................................107

2.2.2cuDeviceGet.........................................................................................................................................108

2.2.3cuDeviceGetAttribute..........................................................................................................................109

2.2.4cuDeviceGetCount..............................................................................................................................111

2.2.5cuDeviceGetName...............................................................................................................................112

2.2.6cuDeviceGetProperties........................................................................................................................113

2.2.7cuDeviceTotalMem............................................................................................................................115

2.3ContextManagement.......................................................................................................................................116

2.3.1cuCtxAttach.........................................................................................................................................117

2.3.2cuCtxCreate..........................................................................................................................................118

2.3.3cuCtxDetach.........................................................................................................................................120

2.3.4cuCtxGetDevice...................................................................................................................................121

v

2.3.5cuCtxPopCurrent.................................................................................................................................122

2.3.6cuCtxPushCurrent..............................................................................................................................123

2.3.7cuCtxSynchronize...............................................................................................................................124

2.4ModuleManagement........................................................................................................................................125

2.4.1cuModuleGetFunction..........................................................................................................................126

2.4.2cuModuleGetGlobal...........................................................................................................................127

2.4.3cuModuleGetTexRef...........................................................................................................................128

2.4.4cuModuleLoad.....................................................................................................................................129

2.4.5cuModuleLoadData.............................................................................................................................130

2.4.6cuModuleLoadFatBinary....................................................................................................................131

2.4.7cuModuleUnload.................................................................................................................................132

2.5StreamManagement.........................................................................................................................................133

2.5.1cuStreamCreate...................................................................................................................................134

2.5.2cuStreamDestroy.................................................................................................................................135

2.5.3cuStreamQuery.....................................................................................................................................136

2.5.4cuStreamDestroy................................................................................................................................137

2.6EventManagement...........................................................................................................................................138

2.6.1cuEventCreate......................................................................................................................................139

2.6.2cuEventDestroy....................................................................................................................................140

2.6.3cuEventElapsedTime...........................................................................................................................141

2.6.4cuEventQuery.......................................................................................................................................142

2.6.5cuEventRecord.....................................................................................................................................143

2.6.6cuEventSynchronize............................................................................................................................144

2.7ExecutionControl.............................................................................................................................................145

2.7.1cuLaunch..............................................................................................................................................146

2.7.2cuLaunchGrid.......................................................................................................................................147

2.7.3cuParamSetSize....................................................................................................................................148

2.7.4cuParamSetTexRef..............................................................................................................................149

2.7.5cuParamSetf........................................................................................................................................150

2.7.6cuParamSeti..........................................................................................................................................151

2.7.7cuParamSetv........................................................................................................................................152

2.7.8cuFuncSetBlockShape........................................................................................................................153

2.7.9cuFuncSetSharedSize.........................................................................................................................154

2.8MemoryManagement.......................................................................................................................................155

v

2.8.1cuArrayCreate......................................................................................................................................156

2.8.2cuArrayDestroy....................................................................................................................................158

2.8.3cuArrayGetDescriptor.........................................................................................................................159

2.8.4cuMemAlloc.......................................................................................................................................160

2.8.5cuMemAllocHost.................................................................................................................................161

2.8.6cuMemAllocPitch.................................................................................................................................162

2.8.7cuMemFree...........................................................................................................................................164

2.8.8cuMemFreeHost...................................................................................................................................165

2.8.9cuMemGetAddressRange....................................................................................................................166

2.8.10cuMemGetlnfb...................................................................................................................................167

2.8.11cuMemcpy2D.....................................................................................................................................168

2.8.12cuMemcpy3D.....................................................................................................................................171

2.8.13cuMemcpyAtoA.................................................................................................................................174

2.8.14cuMemcpyAtoD................................................................................................................................175

2.8.15cuMemcpyAtoH...............................................................................................................................176

2.8.16cuMemcpyDtoA.................................................................................................................................177

2.8.17cuMemcpyDtoD.................................................................................................................................178

2.8.18cuMemcpyDtoH...............................................................................................................................179

2.8.19cuMemcpyHtoA.................................................................................................................................180

2.8.20cuMemcpyHtoD...............................................................................................................................181

2.8.21cuMemset...........................................................................................................................................182

2.8.22cuMemset2D......................................................................................................................................183

2.9TextureReferenceManagement..........................................................................................................................184

2.9.1cuTexRefCreate....................................................................................................................................185

2.9.2cuTexRefDestroy..................................................................................................................................186

2.9.3cuTexRefGetAddress..........................................................................................................................187

2.9.4cuTexRefGetAddressMode.................................................................................................................188

2.9.5cuTexRefGctArray..............................................................................................................................189

2.9.6cuTexRefGetFilterMode......................................................................................................................190

2.9.7cuTexRefGetFlags................................................................................................................................191

2.9.8cuTexRefGetFormat............................................................................................................................192

2.9.9cuTexRefSetAddress...........................................................................................................................193

2.9.10cuTexRefSetAddressMode..............................................................................................................194

2.9.11cuTexRefSetArray.............................................................................................................................195

v

2.9.12cuTexRefSetFilterMode..........................................................................................

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论