Download testing/distance.cu from camenduru/thrust: direct link, hf CLI and curl.
- Browser
- Download file 565 Bytes
-
https://huggingface.co/camenduru/thrust/resolve/main/testing/distance.cu
- Command line
-
hf download hf://camenduru/thrust/testing/distance.cu
-
curl -L -o distance.cu https://huggingface.co/camenduru/thrust/resolve/main/testing/distance.cu
565 Bytes
| // TODO expand this with other iterator types (forward, bidirectional, etc.) | |
| template <typename Vector> | |
| void TestDistance(void) | |
| { | |
| typedef typename Vector::iterator Iterator; | |
| Vector v(100); | |
| Iterator i = v.begin(); | |
| ASSERT_EQUAL(thrust::distance(i, v.end()), 100); | |
| i++; | |
| ASSERT_EQUAL(thrust::distance(i, v.end()), 99); | |
| i += 49; | |
| ASSERT_EQUAL(thrust::distance(i, v.end()), 50); | |
| ASSERT_EQUAL(thrust::distance(i, i), 0); | |
| } | |
| DECLARE_VECTOR_UNITTEST(TestDistance); | |