X hits on this document

Powerpoint document

The Missouri S&T CS GPU Cluster - page 10 / 18

63 views

0 shares

0 downloads

0 comments

10 / 18

E.g. Host invokes kernel on a device

// Kernel definition, runs a copy on every thread

__global__ void vectorAdd( float* A, float* B, float* C )

{ ...

}

int main(int argc, char** argv)

{

 dim3 blockSize(16, 16); // 256 threads per block (up to 3D)

 dim3 gridSize(4, 2);    // 8 blocks in the grid (up to 2D)

 // Invoke the kernel on the device (GPU)

 vectorAdd<<<gridSize, blockSize>>>(A, B, C);

 ... // Continue running on host (CPU) when device is done

}

Document info
Document views63
Page views63
Page last viewedTue Jan 24 09:21:48 UTC 2017
Pages18
Paragraphs213
Words1253

Comments