|
| 1 | +// ===------------------- math.cpp ---------- -*- C++ -* ------------------===// |
| 2 | +// |
| 3 | +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | +// See https://llvm.org/LICENSE.txt for license information. |
| 5 | +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | +// |
| 7 | +// |
| 8 | +// ===---------------------------------------------------------------------===// |
| 9 | + |
| 10 | +#include <dpct/dpct.hpp> |
| 11 | + |
| 12 | +int main() { |
| 13 | + double d; |
| 14 | + float f; |
| 15 | + int i; |
| 16 | + sycl::half h; |
| 17 | + sycl::half2 h2; |
| 18 | + unsigned u; |
| 19 | + dpct::fast_length(&f, i); |
| 20 | + dpct::length(&d, i); |
| 21 | + dpct::compare(h, h, std::equal_to<>()); |
| 22 | + dpct::compare(h2, h2, std::equal_to<>()); |
| 23 | + dpct::unordered_compare(h, h, std::equal_to<>()); |
| 24 | + dpct::unordered_compare(h2, h2, std::equal_to<>()); |
| 25 | + dpct::compare_both(h2, h2, std::equal_to<>()); |
| 26 | + dpct::unordered_compare_both(h2, h2, std::equal_to<>()); |
| 27 | + dpct::isnan(h2); |
| 28 | + dpct::vectorized_binary<sycl::short2>(u, u, dpct::abs_diff()); |
| 29 | + dpct::vectorized_binary<sycl::short2>(u, u, dpct::add_sat()); |
| 30 | + dpct::vectorized_binary<sycl::short2>(u, u, dpct::rhadd()); |
| 31 | + dpct::vectorized_binary<sycl::short2>(u, u, dpct::hadd()); |
| 32 | + dpct::vectorized_binary<sycl::short2>(u, u, dpct::maximum()); |
| 33 | + dpct::vectorized_binary<sycl::short2>(u, u, dpct::minimum()); |
| 34 | + dpct::vectorized_binary<sycl::short2>(u, u, dpct::sub_sat()); |
| 35 | + dpct::vectorized_unary<sycl::short2>(u, dpct::abs()); |
| 36 | + dpct::vectorized_sum_abs_diff<sycl::short2>(u, u); |
| 37 | + printf("test pass!\n"); |
| 38 | + return 0; |
| 39 | +} |
0 commit comments