Skip to content

Commit ed6b727

Browse files
mfrancis95alliepiper
authored andcommitted
Use std::iota in CUDATestDriver::target_devices
1 parent 441a98f commit ed6b727

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

testing/unittest/cuda/testframework.cu

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <unittest/cuda/testframework.h>
33
#include <thrust/system/cuda/memory.h>
44
#include <cuda_runtime.h>
5+
#include <numeric>
56

67
__global__ void dummy_kernel() {}
78

@@ -80,9 +81,7 @@ std::vector<int> CUDATestDriver::target_devices(const ArgumentMap &kwargs)
8081
cudaGetDeviceCount(&count);
8182

8283
result.resize(count);
83-
// XXX iota is not available in c++03
84-
for(int i = 0; i < count; ++i)
85-
result[i] = i;
84+
std::iota(result.begin(), result.end(), 0);
8685
}
8786
else
8887
{

0 commit comments

Comments
 (0)