Make a copy kernel using the private variables

This commit is contained in:
Tom Deakin 2016-04-26 14:34:25 +01:00
parent 1a259d4fc8
commit 0bf68f9909
3 changed files with 9 additions and 7 deletions

View File

@ -11,7 +11,7 @@ __global__ void copy_kernel(const T * a, T * c)
template <class T>
void CUDAStream<T>::copy()
{
copy<<<1024, 1024>>>(a, c);
copy_kernel<<<1024, 1024>>>(d_a, d_c);
}
template <class T>

View File

@ -5,16 +5,17 @@
template <class T>
class CUDAStream : public Stream<T>
{
public:
void copy();
void add();
void mul();
void triad();
private:
// Device side pointers to arrays
T *d_a;
T *d_b;
T *d_c;
public:
void copy();
void add();
void mul();
void triad();
};

View File

@ -16,6 +16,7 @@ int main(int argc, char *argv[])
Stream<double> *stream;
stream = new CUDAStream<double>();
stream->copy();
delete[] stream;