NVIDIA CUDA

Serial

int main()
{
    float *A, *B, *C;
    for (int i = 0; i < sizeof(C); i++)
    {
        C[i] = A[i] + B[i];
    }
    return 0;
}

Parallel

__global__ void vecAdd(float* A, float* B, float* C)
{
int i = threadIdx.x;
C[i] = A[i] + B[i];
}
int main()
{
// Kernel invocation
vecAdd<<<1, N>>>(A, B, C);
}
Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • Technorati
  • Furl
  • Live
  • NewsVine
  • Sk-rt
  • Slashdot
  • StumbleUpon
  • YahooMyWeb
  • E-mail this story to a friend!
  • Mixx
  • Reddit

0 Responses to “NVIDIA CUDA”


  1. No Comments

Leave a Reply

You must login to post a comment.