Skip to content

Commit 3506325

Browse files
authored
[SYCL] Add sycl wrappers for fp conversions. (#9431)
This PR adds C++ wrappers in intel math header for type conversion functions provided in SYCL libdevice. The function names align with CUDA correspondence but we don't use "__" prefix in function name. For example, CUDA __double2float_ru maps to sycl::ext::intel::math::double2float_ru. --------- Signed-off-by: jinge90 <[email protected]>
1 parent c4db251 commit 3506325

File tree

8 files changed

+1547
-448
lines changed

8 files changed

+1547
-448
lines changed

sycl/include/sycl/ext/intel/math.hpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//==------------- math.hpp - Intel specific math API -----------------------==//
1+
//==-------------- math.hpp - Intel specific math API ----------------------==//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -9,11 +9,6 @@
99
//===----------------------------------------------------------------------===//
1010

1111
#pragma once
12-
#include <sycl/builtins.hpp>
13-
#include <sycl/ext/intel/math/imf_half_trivial.hpp>
14-
#include <sycl/ext/intel/math/imf_simd.hpp>
15-
#include <sycl/half_type.hpp>
16-
#include <type_traits>
1712

1813
// _iml_half_internal is internal representation for fp16 type used in intel
1914
// math device library. The definition here should align with definition in
@@ -24,6 +19,14 @@ using _iml_half_internal = _Float16;
2419
using _iml_half_internal = uint16_t;
2520
#endif
2621

22+
#include <sycl/builtins.hpp>
23+
#include <sycl/ext/intel/math/imf_fp_conversions.hpp>
24+
#include <sycl/ext/intel/math/imf_half_trivial.hpp>
25+
#include <sycl/ext/intel/math/imf_simd.hpp>
26+
#include <sycl/ext/oneapi/bfloat16.hpp>
27+
#include <sycl/half_type.hpp>
28+
#include <type_traits>
29+
2730
extern "C" {
2831
float __imf_saturatef(float);
2932
float __imf_copysignf(float, float);

0 commit comments

Comments
 (0)