Skip to content

Commit c534600

Browse files
committed
[RAJA] Use Index_type for iterator index type instead of hardcoding int
1 parent 3331f62 commit c534600

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

RAJAStream.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void RAJAStream<T>::init_arrays(T initA, T initB, T initC)
5353
T* RAJA_RESTRICT a = d_a;
5454
T* RAJA_RESTRICT b = d_b;
5555
T* RAJA_RESTRICT c = d_c;
56-
forall<policy>(index_set, [=] RAJA_DEVICE (int index)
56+
forall<policy>(index_set, [=] RAJA_DEVICE (RAJA::Index_type index)
5757
{
5858
a[index] = initA;
5959
b[index] = initB;
@@ -75,7 +75,7 @@ void RAJAStream<T>::copy()
7575
{
7676
T* RAJA_RESTRICT a = d_a;
7777
T* RAJA_RESTRICT c = d_c;
78-
forall<policy>(index_set, [=] RAJA_DEVICE (int index)
78+
forall<policy>(index_set, [=] RAJA_DEVICE (RAJA::Index_type index)
7979
{
8080
c[index] = a[index];
8181
});
@@ -87,7 +87,7 @@ void RAJAStream<T>::mul()
8787
T* RAJA_RESTRICT b = d_b;
8888
T* RAJA_RESTRICT c = d_c;
8989
const T scalar = startScalar;
90-
forall<policy>(index_set, [=] RAJA_DEVICE (int index)
90+
forall<policy>(index_set, [=] RAJA_DEVICE (RAJA::Index_type index)
9191
{
9292
b[index] = scalar*c[index];
9393
});
@@ -99,7 +99,7 @@ void RAJAStream<T>::add()
9999
T* RAJA_RESTRICT a = d_a;
100100
T* RAJA_RESTRICT b = d_b;
101101
T* RAJA_RESTRICT c = d_c;
102-
forall<policy>(index_set, [=] RAJA_DEVICE (int index)
102+
forall<policy>(index_set, [=] RAJA_DEVICE (RAJA::Index_type index)
103103
{
104104
c[index] = a[index] + b[index];
105105
});
@@ -112,7 +112,7 @@ void RAJAStream<T>::triad()
112112
T* RAJA_RESTRICT b = d_b;
113113
T* RAJA_RESTRICT c = d_c;
114114
const T scalar = startScalar;
115-
forall<policy>(index_set, [=] RAJA_DEVICE (int index)
115+
forall<policy>(index_set, [=] RAJA_DEVICE (RAJA::Index_type index)
116116
{
117117
a[index] = b[index] + scalar*c[index];
118118
});
@@ -126,7 +126,7 @@ T RAJAStream<T>::dot()
126126

127127
RAJA::ReduceSum<reduce_policy, T> sum(0.0);
128128

129-
forall<policy>(index_set, [=] RAJA_DEVICE (int index)
129+
forall<policy>(index_set, [=] RAJA_DEVICE (RAJA::Index_type index)
130130
{
131131
sum += a[index] * b[index];
132132
});

0 commit comments

Comments
 (0)