[RAJA] Parallel first touch

This commit is contained in:
James Price 2016-11-01 16:18:43 +00:00
parent 9acdba8b76
commit 3045208aae

View File

@ -21,6 +21,12 @@ RAJAStream<T>::RAJAStream(const unsigned int ARRAY_SIZE, const int device_index)
d_a = new T[ARRAY_SIZE];
d_b = new T[ARRAY_SIZE];
d_c = new T[ARRAY_SIZE];
forall<policy>(index_set, [=] RAJA_DEVICE (int index)
{
d_a[index] = 0.0;
d_b[index] = 0.0;
d_c[index] = 0.0;
});
#else
cudaMallocManaged((void**)&d_a, sizeof(T)*ARRAY_SIZE, cudaMemAttachGlobal);
cudaMallocManaged((void**)&d_b, sizeof(T)*ARRAY_SIZE, cudaMemAttachGlobal);