Department of Mathematics

CUDA: Threaded Programming

CUDA ICE

Write and call a kernel to evaluate the matrix product \[\left(\frac1{h^2}\right) \begin{bmatrix} -2 & 1 & 0 & 0 & \dots & 0\\ 1 & -2 & 1 & 0 & \dots & 0\\ 0 & 1 & -1 & 1 & \dots & 0\\ \vdots & &&& \ddots & \vdots\\ 0 & \dots & &0&1&-2\\ \end{bmatrix} u = v, \] Where \(h\) is the distance between the uniformly spaced points of a partition on [0,1].

Recall that the matrix product represents an estimate of the second derivative of a function with values \(u_i\) at the points \(x_i\) of the partition. You can use this code as a starting point for your program. In that case all you need to do is fill in a few lines.

I am trying to learn something about CUDA computing. This is my blog patch for that. I'll post things that I want to keep handy here, and perhaps at some time in the future this will become the core of a seminar site.



Department of Mathematics, PO Box 643113, Neill Hall 103, Washington State University, Pullman WA 99164-3113, 509-335-3926, Contact Us
Copyright © 2009-14 Kevin Cooper