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

Use std::iota in CUDATestDriver::target_devices #1249

Merged
merged 2 commits into from
Aug 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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