|
267 | 267 | // thrust_make_zip_iterator-NEXT: typedef dpct::device_vector<float>::iterator float_iterator; |
268 | 268 | // thrust_make_zip_iterator-NEXT: typedef std::tuple<int_iterator, float_iterator> iterator_tuple; |
269 | 269 | // thrust_make_zip_iterator-NEXT: dpct::zip_iterator<iterator_tuple> ret = oneapi::dpl::make_zip_iterator(std::make_tuple(int_in.begin(), float_in.begin())); |
| 270 | + |
| 271 | +// RUN: dpct --cuda-include-path="%cuda-path/include" --query-api-mapping=thrust::max --extra-arg="-std=c++14"| FileCheck %s -check-prefix=thrust_max |
| 272 | +// thrust_max: CUDA API: |
| 273 | +// thrust_max-NEXT: struct key_value { |
| 274 | +// thrust_max-NEXT: int key; |
| 275 | +// thrust_max-NEXT: int value; |
| 276 | +// thrust_max-NEXT: }; |
| 277 | +// thrust_max-NEXT: struct compare_key_value { |
| 278 | +// thrust_max-NEXT: __host__ __device__ bool operator()(key_value lhs, key_value rhs) { |
| 279 | +// thrust_max-NEXT: return lhs.key < rhs.key; |
| 280 | +// thrust_max-NEXT: } |
| 281 | +// thrust_max-NEXT: }; |
| 282 | +// thrust_max-NEXT: key_value a = {13, 0}; |
| 283 | +// thrust_max-NEXT: key_value b = {7, 1}; |
| 284 | +// thrust_max-NEXT: key_value smaller = thrust::max(a, b, compare_key_value()); |
| 285 | +// thrust_max-NEXT: int value = thrust::max(1, 2); |
| 286 | +// thrust_max-NEXT: Is migrated to: |
| 287 | +// thrust_max-NEXT: struct key_value { |
| 288 | +// thrust_max-NEXT: int key; |
| 289 | +// thrust_max-NEXT: int value; |
| 290 | +// thrust_max-NEXT: }; |
| 291 | +// thrust_max-NEXT: struct compare_key_value { |
| 292 | +// thrust_max-NEXT: bool operator()(key_value lhs, key_value rhs) { |
| 293 | +// thrust_max-NEXT: return lhs.key < rhs.key; |
| 294 | +// thrust_max-NEXT: } |
| 295 | +// thrust_max-NEXT: }; |
| 296 | +// thrust_max-NEXT: key_value a = {13, 0}; |
| 297 | +// thrust_max-NEXT: key_value b = {7, 1}; |
| 298 | +// thrust_max-NEXT: key_value smaller = std::max(a, b, compare_key_value()); |
| 299 | +// thrust_max-NEXT: int value = std::max(1, 2); |
| 300 | + |
| 301 | +// RUN: dpct --cuda-include-path="%cuda-path/include" --query-api-mapping=thrust::min --extra-arg="-std=c++14"| FileCheck %s -check-prefix=thrust_min |
| 302 | +// thrust_min: CUDA API: |
| 303 | +// thrust_min-NEXT: struct key_value { |
| 304 | +// thrust_min-NEXT: int key; |
| 305 | +// thrust_min-NEXT: int value; |
| 306 | +// thrust_min-NEXT: }; |
| 307 | +// thrust_min-NEXT: struct compare_key_value { |
| 308 | +// thrust_min-NEXT: __host__ __device__ bool operator()(key_value lhs, key_value rhs) { |
| 309 | +// thrust_min-NEXT: return lhs.key < rhs.key; |
| 310 | +// thrust_min-NEXT: } |
| 311 | +// thrust_min-NEXT: }; |
| 312 | +// thrust_min-NEXT: key_value a = {13, 0}; |
| 313 | +// thrust_min-NEXT: key_value b = {7, 1}; |
| 314 | +// thrust_min-NEXT: key_value smaller = thrust::min(a, b, compare_key_value()); |
| 315 | +// thrust_min-NEXT: int value = thrust::min(1, 2); |
| 316 | +// thrust_min-NEXT: Is migrated to: |
| 317 | +// thrust_min-NEXT: struct key_value { |
| 318 | +// thrust_min-NEXT: int key; |
| 319 | +// thrust_min-NEXT: int value; |
| 320 | +// thrust_min-NEXT: }; |
| 321 | +// thrust_min-NEXT: struct compare_key_value { |
| 322 | +// thrust_min-NEXT: bool operator()(key_value lhs, key_value rhs) { |
| 323 | +// thrust_min-NEXT: return lhs.key < rhs.key; |
| 324 | +// thrust_min-NEXT: } |
| 325 | +// thrust_min-NEXT: }; |
| 326 | +// thrust_min-NEXT: key_value a = {13, 0}; |
| 327 | +// thrust_min-NEXT: key_value b = {7, 1}; |
| 328 | +// thrust_min-NEXT: key_value smaller = std::min(a, b, compare_key_value()); |
| 329 | +// thrust_min-NEXT: int value = std::min(1, 2); |
0 commit comments