Skip to content

Instantly share code, notes, and snippets.

@pawelKondzior
Created January 30, 2017 22:46
Show Gist options
  • Select an option

  • Save pawelKondzior/c42d8792bb6ad886d6a8596fe001c8da to your computer and use it in GitHub Desktop.

Select an option

Save pawelKondzior/c42d8792bb6ad886d6a8596fe001c8da to your computer and use it in GitHub Desktop.

Revisions

  1. pawelKondzior created this gist Jan 30, 2017.
    12 changes: 12 additions & 0 deletions .cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    [Cudafy]
    public static void thekernel(GThread thread, VectorStruct[] a, VectorStruct[] b, VectorStruct[] c)
    {
    int tid = thread.threadIdx.x;
    if (tid < N)
    {
    c[tid].x = a[tid].x + b[tid].x;
    c[tid].y = a[tid].y + b[tid].y;
    c[tid].z = a[tid].z + b[tid].z;
    }

    }