Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Use std::iota in CUDATestDriver::target_devices
Browse files Browse the repository at this point in the history
  • Loading branch information
mfrancis95 authored and alliepiper committed Aug 13, 2020
1 parent 441a98f commit ed6b727
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions testing/unittest/cuda/testframework.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <unittest/cuda/testframework.h>
#include <thrust/system/cuda/memory.h>
#include <cuda_runtime.h>
#include <numeric>

__global__ void dummy_kernel() {}

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

result.resize(count);
// XXX iota is not available in c++03
for(int i = 0; i < count; ++i)
result[i] = i;
std::iota(result.begin(), result.end(), 0);
}
else
{
Expand Down

0 comments on commit ed6b727

Please sign in to comment.