|
302 | 302 | // thrust_get_temporary_buffer-NEXT: dpct::device_sys_tag device_sys; |
303 | 303 | // thrust_get_temporary_buffer-NEXT: ptr_and_size_t ptr_and_size = dpct::get_temporary_allocation<int>(device_sys, N); |
304 | 304 |
|
305 | | - |
| 305 | +// RUN: dpct --cuda-include-path="%cuda-path/include" --query-api-mapping=thrust::max --extra-arg="-std=c++14"| FileCheck %s -check-prefix=thrust_max |
| 306 | +// thrust_max: CUDA API: |
| 307 | +// thrust_max-NEXT: struct key_value { |
| 308 | +// thrust_max-NEXT: int key; |
| 309 | +// thrust_max-NEXT: int value; |
| 310 | +// thrust_max-NEXT: }; |
| 311 | +// thrust_max-NEXT: struct compare_key_value { |
| 312 | +// thrust_max-NEXT: __host__ __device__ bool operator()(key_value lhs, key_value rhs) { |
| 313 | +// thrust_max-NEXT: return lhs.key < rhs.key; |
| 314 | +// thrust_max-NEXT: } |
| 315 | +// thrust_max-NEXT: }; |
| 316 | +// thrust_max-NEXT: key_value a = {13, 0}; |
| 317 | +// thrust_max-NEXT: key_value b = {7, 1}; |
| 318 | +// thrust_max-NEXT: key_value smaller = thrust::max(a, b, compare_key_value()); |
| 319 | +// thrust_max-NEXT: int value = thrust::max(1, 2); |
| 320 | +// thrust_max-NEXT: Is migrated to: |
| 321 | +// thrust_max-NEXT: struct key_value { |
| 322 | +// thrust_max-NEXT: int key; |
| 323 | +// thrust_max-NEXT: int value; |
| 324 | +// thrust_max-NEXT: }; |
| 325 | +// thrust_max-NEXT: struct compare_key_value { |
| 326 | +// thrust_max-NEXT: bool operator()(key_value lhs, key_value rhs) { |
| 327 | +// thrust_max-NEXT: return lhs.key < rhs.key; |
| 328 | +// thrust_max-NEXT: } |
| 329 | +// thrust_max-NEXT: }; |
| 330 | +// thrust_max-NEXT: key_value a = {13, 0}; |
| 331 | +// thrust_max-NEXT: key_value b = {7, 1}; |
| 332 | +// thrust_max-NEXT: key_value smaller = std::max(a, b, compare_key_value()); |
| 333 | +// thrust_max-NEXT: int value = std::max(1, 2); |
| 334 | + |
| 335 | +// RUN: dpct --cuda-include-path="%cuda-path/include" --query-api-mapping=thrust::min --extra-arg="-std=c++14"| FileCheck %s -check-prefix=thrust_min |
| 336 | +// thrust_min: CUDA API: |
| 337 | +// thrust_min-NEXT: struct key_value { |
| 338 | +// thrust_min-NEXT: int key; |
| 339 | +// thrust_min-NEXT: int value; |
| 340 | +// thrust_min-NEXT: }; |
| 341 | +// thrust_min-NEXT: struct compare_key_value { |
| 342 | +// thrust_min-NEXT: __host__ __device__ bool operator()(key_value lhs, key_value rhs) { |
| 343 | +// thrust_min-NEXT: return lhs.key < rhs.key; |
| 344 | +// thrust_min-NEXT: } |
| 345 | +// thrust_min-NEXT: }; |
| 346 | +// thrust_min-NEXT: key_value a = {13, 0}; |
| 347 | +// thrust_min-NEXT: key_value b = {7, 1}; |
| 348 | +// thrust_min-NEXT: key_value smaller = thrust::min(a, b, compare_key_value()); |
| 349 | +// thrust_min-NEXT: int value = thrust::min(1, 2); |
| 350 | +// thrust_min-NEXT: Is migrated to: |
| 351 | +// thrust_min-NEXT: struct key_value { |
| 352 | +// thrust_min-NEXT: int key; |
| 353 | +// thrust_min-NEXT: int value; |
| 354 | +// thrust_min-NEXT: }; |
| 355 | +// thrust_min-NEXT: struct compare_key_value { |
| 356 | +// thrust_min-NEXT: bool operator()(key_value lhs, key_value rhs) { |
| 357 | +// thrust_min-NEXT: return lhs.key < rhs.key; |
| 358 | +// thrust_min-NEXT: } |
| 359 | +// thrust_min-NEXT: }; |
| 360 | +// thrust_min-NEXT: key_value a = {13, 0}; |
| 361 | +// thrust_min-NEXT: key_value b = {7, 1}; |
| 362 | +// thrust_min-NEXT: key_value smaller = std::min(a, b, compare_key_value()); |
| 363 | +// thrust_min-NEXT: int value = std::min(1, 2); |
0 commit comments