NVIDIA CUDA計(jì)算統(tǒng)一設(shè)備架構(gòu)參考手冊2_第1頁
NVIDIA CUDA計(jì)算統(tǒng)一設(shè)備架構(gòu)參考手冊2_第2頁
NVIDIA CUDA計(jì)算統(tǒng)一設(shè)備架構(gòu)參考手冊2_第3頁
NVIDIA CUDA計(jì)算統(tǒng)一設(shè)備架構(gòu)參考手冊2_第4頁
NVIDIA CUDA計(jì)算統(tǒng)一設(shè)備架構(gòu)參考手冊2_第5頁
已閱讀5頁,還剩246頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

NVIDIACUDA

計(jì)算統(tǒng)一設(shè)備架構(gòu)

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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論