Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ set(SYCL_MINOR_VERSION 7)
set(SYCL_PATCH_VERSION 0)
# Don't forget to re-enable sycl_symbols_windows.dump once we leave ABI-breaking
# window!
set(SYCL_DEV_ABI_VERSION 12)
set(SYCL_DEV_ABI_VERSION 13)
if (SYCL_ADD_DEV_VERSION_POSTFIX)
set(SYCL_VERSION_POSTFIX "-${SYCL_DEV_ABI_VERSION}")
endif()
Expand Down
4 changes: 2 additions & 2 deletions sycl/include/sycl/detail/builtins.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#define __SYCL_EXTERN_IT2_SAME(Ret, prefix, call, Arg)
#define __SYCL_EXTERN_IT3(Ret, prefix, call, Arg1, Arg2, Arg3)
#else
#define __FUNC_PREFIX_OCL
#define __FUNC_PREFIX_CORE
#define __FUNC_PREFIX_OCL sycl_host_
#define __FUNC_PREFIX_CORE sycl_host_
#define __SYCL_EXTERN_IT1(Ret, prefix, call, Arg) \
extern Ret __SYCL_PPCAT(prefix, call)(Arg)
#define __SYCL_EXTERN_IT2_SAME(Ret, prefix, call, Arg) \
Expand Down
146 changes: 84 additions & 62 deletions sycl/source/detail/builtins_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,132 +65,154 @@ template <typename T> inline T __sign(T x) {

// --------------- 4.13.5 Common functions. Host implementations ---------------
// fclamp
__SYCL_EXPORT s::cl_float fclamp(s::cl_float x, s::cl_float minval,
s::cl_float maxval) __NOEXC {
__SYCL_EXPORT s::cl_float sycl_host_fclamp(s::cl_float x, s::cl_float minval,
s::cl_float maxval) __NOEXC {
return __fclamp(x, minval, maxval);
}
__SYCL_EXPORT s::cl_double fclamp(s::cl_double x, s::cl_double minval,
s::cl_double maxval) __NOEXC {
__SYCL_EXPORT s::cl_double sycl_host_fclamp(s::cl_double x, s::cl_double minval,
s::cl_double maxval) __NOEXC {
return __fclamp(x, minval, maxval);
}
__SYCL_EXPORT s::cl_half fclamp(s::cl_half x, s::cl_half minval,
s::cl_half maxval) __NOEXC {
__SYCL_EXPORT s::cl_half sycl_host_fclamp(s::cl_half x, s::cl_half minval,
s::cl_half maxval) __NOEXC {
return __fclamp(x, minval, maxval);
}
MAKE_1V_2V_3V(fclamp, s::cl_float, s::cl_float, s::cl_float, s::cl_float)
MAKE_1V_2V_3V(fclamp, s::cl_double, s::cl_double, s::cl_double, s::cl_double)
MAKE_1V_2V_3V(fclamp, s::cl_half, s::cl_half, s::cl_half, s::cl_half)
MAKE_1V_2V_3V(sycl_host_fclamp, s::cl_float, s::cl_float, s::cl_float,
s::cl_float)
MAKE_1V_2V_3V(sycl_host_fclamp, s::cl_double, s::cl_double, s::cl_double,
s::cl_double)
MAKE_1V_2V_3V(sycl_host_fclamp, s::cl_half, s::cl_half, s::cl_half, s::cl_half)

// degrees
__SYCL_EXPORT s::cl_float degrees(s::cl_float radians) __NOEXC {
__SYCL_EXPORT s::cl_float sycl_host_degrees(s::cl_float radians) __NOEXC {
return __degrees(radians);
}
__SYCL_EXPORT s::cl_double degrees(s::cl_double radians) __NOEXC {
__SYCL_EXPORT s::cl_double sycl_host_degrees(s::cl_double radians) __NOEXC {
return __degrees(radians);
}
__SYCL_EXPORT s::cl_half degrees(s::cl_half radians) __NOEXC {
__SYCL_EXPORT s::cl_half sycl_host_degrees(s::cl_half radians) __NOEXC {
return __degrees(radians);
}
MAKE_1V(degrees, s::cl_float, s::cl_float)
MAKE_1V(degrees, s::cl_double, s::cl_double)
MAKE_1V(degrees, s::cl_half, s::cl_half)
MAKE_1V(sycl_host_degrees, s::cl_float, s::cl_float)
MAKE_1V(sycl_host_degrees, s::cl_double, s::cl_double)
MAKE_1V(sycl_host_degrees, s::cl_half, s::cl_half)

// fmin_common
__SYCL_EXPORT s::cl_float fmin_common(s::cl_float x, s::cl_float y) __NOEXC {
__SYCL_EXPORT s::cl_float sycl_host_fmin_common(s::cl_float x,
s::cl_float y) __NOEXC {
return std::fmin(x, y);
}
__SYCL_EXPORT s::cl_double fmin_common(s::cl_double x, s::cl_double y) __NOEXC {
__SYCL_EXPORT s::cl_double sycl_host_fmin_common(s::cl_double x,
s::cl_double y) __NOEXC {
return std::fmin(x, y);
}
__SYCL_EXPORT s::cl_half fmin_common(s::cl_half x, s::cl_half y) __NOEXC {
__SYCL_EXPORT s::cl_half sycl_host_fmin_common(s::cl_half x,
s::cl_half y) __NOEXC {
return std::fmin(x, y);
}
MAKE_1V_2V(fmin_common, s::cl_float, s::cl_float, s::cl_float)
MAKE_1V_2V(fmin_common, s::cl_double, s::cl_double, s::cl_double)
MAKE_1V_2V(fmin_common, s::cl_half, s::cl_half, s::cl_half)
MAKE_1V_2V(sycl_host_fmin_common, s::cl_float, s::cl_float, s::cl_float)
MAKE_1V_2V(sycl_host_fmin_common, s::cl_double, s::cl_double, s::cl_double)
MAKE_1V_2V(sycl_host_fmin_common, s::cl_half, s::cl_half, s::cl_half)

// fmax_common
__SYCL_EXPORT s::cl_float fmax_common(s::cl_float x, s::cl_float y) __NOEXC {
__SYCL_EXPORT s::cl_float sycl_host_fmax_common(s::cl_float x,
s::cl_float y) __NOEXC {
return std::fmax(x, y);
}
__SYCL_EXPORT s::cl_double fmax_common(s::cl_double x, s::cl_double y) __NOEXC {
__SYCL_EXPORT s::cl_double sycl_host_fmax_common(s::cl_double x,
s::cl_double y) __NOEXC {
return std::fmax(x, y);
}
__SYCL_EXPORT s::cl_half fmax_common(s::cl_half x, s::cl_half y) __NOEXC {
__SYCL_EXPORT s::cl_half sycl_host_fmax_common(s::cl_half x,
s::cl_half y) __NOEXC {
return std::fmax(x, y);
}
MAKE_1V_2V(fmax_common, s::cl_float, s::cl_float, s::cl_float)
MAKE_1V_2V(fmax_common, s::cl_double, s::cl_double, s::cl_double)
MAKE_1V_2V(fmax_common, s::cl_half, s::cl_half, s::cl_half)
MAKE_1V_2V(sycl_host_fmax_common, s::cl_float, s::cl_float, s::cl_float)
MAKE_1V_2V(sycl_host_fmax_common, s::cl_double, s::cl_double, s::cl_double)
MAKE_1V_2V(sycl_host_fmax_common, s::cl_half, s::cl_half, s::cl_half)

// mix
__SYCL_EXPORT s::cl_float mix(s::cl_float x, s::cl_float y,
s::cl_float a) __NOEXC {
__SYCL_EXPORT s::cl_float sycl_host_mix(s::cl_float x, s::cl_float y,
s::cl_float a) __NOEXC {
return __mix(x, y, a);
}
__SYCL_EXPORT s::cl_double mix(s::cl_double x, s::cl_double y,
s::cl_double a) __NOEXC {
__SYCL_EXPORT s::cl_double sycl_host_mix(s::cl_double x, s::cl_double y,
s::cl_double a) __NOEXC {
return __mix(x, y, a);
}
__SYCL_EXPORT s::cl_half mix(s::cl_half x, s::cl_half y, s::cl_half a) __NOEXC {
__SYCL_EXPORT s::cl_half sycl_host_mix(s::cl_half x, s::cl_half y,
s::cl_half a) __NOEXC {
return __mix(x, y, a);
}
MAKE_1V_2V_3V(mix, s::cl_float, s::cl_float, s::cl_float, s::cl_float)
MAKE_1V_2V_3V(mix, s::cl_double, s::cl_double, s::cl_double, s::cl_double)
MAKE_1V_2V_3V(mix, s::cl_half, s::cl_half, s::cl_half, s::cl_half)
MAKE_1V_2V_3V(sycl_host_mix, s::cl_float, s::cl_float, s::cl_float, s::cl_float)
MAKE_1V_2V_3V(sycl_host_mix, s::cl_double, s::cl_double, s::cl_double,
s::cl_double)
MAKE_1V_2V_3V(sycl_host_mix, s::cl_half, s::cl_half, s::cl_half, s::cl_half)

// radians
__SYCL_EXPORT s::cl_float radians(s::cl_float degrees) __NOEXC {
__SYCL_EXPORT s::cl_float sycl_host_radians(s::cl_float degrees) __NOEXC {
return __radians(degrees);
}
__SYCL_EXPORT s::cl_double radians(s::cl_double degrees) __NOEXC {
__SYCL_EXPORT s::cl_double sycl_host_radians(s::cl_double degrees) __NOEXC {
return __radians(degrees);
}
__SYCL_EXPORT s::cl_half radians(s::cl_half degrees) __NOEXC {
__SYCL_EXPORT s::cl_half sycl_host_radians(s::cl_half degrees) __NOEXC {
return __radians(degrees);
}
MAKE_1V(radians, s::cl_float, s::cl_float)
MAKE_1V(radians, s::cl_double, s::cl_double)
MAKE_1V(radians, s::cl_half, s::cl_half)
MAKE_1V(sycl_host_radians, s::cl_float, s::cl_float)
MAKE_1V(sycl_host_radians, s::cl_double, s::cl_double)
MAKE_1V(sycl_host_radians, s::cl_half, s::cl_half)

// step
__SYCL_EXPORT s::cl_float step(s::cl_float edge, s::cl_float x) __NOEXC {
__SYCL_EXPORT s::cl_float sycl_host_step(s::cl_float edge,
s::cl_float x) __NOEXC {
return __step(edge, x);
}
__SYCL_EXPORT s::cl_double step(s::cl_double edge, s::cl_double x) __NOEXC {
__SYCL_EXPORT s::cl_double sycl_host_step(s::cl_double edge,
s::cl_double x) __NOEXC {
return __step(edge, x);
}
__SYCL_EXPORT s::cl_half step(s::cl_half edge, s::cl_half x) __NOEXC {
__SYCL_EXPORT s::cl_half sycl_host_step(s::cl_half edge, s::cl_half x) __NOEXC {
return __step(edge, x);
}
MAKE_1V_2V(step, s::cl_float, s::cl_float, s::cl_float)
MAKE_1V_2V(step, s::cl_double, s::cl_double, s::cl_double)
MAKE_1V_2V(step, s::cl_half, s::cl_half, s::cl_half)
MAKE_1V_2V(sycl_host_step, s::cl_float, s::cl_float, s::cl_float)
MAKE_1V_2V(sycl_host_step, s::cl_double, s::cl_double, s::cl_double)
MAKE_1V_2V(sycl_host_step, s::cl_half, s::cl_half, s::cl_half)

// smoothstep
__SYCL_EXPORT s::cl_float smoothstep(s::cl_float edge0, s::cl_float edge1,
s::cl_float x) __NOEXC {
__SYCL_EXPORT s::cl_float sycl_host_smoothstep(s::cl_float edge0,
s::cl_float edge1,
s::cl_float x) __NOEXC {
return __smoothstep(edge0, edge1, x);
}
__SYCL_EXPORT s::cl_double smoothstep(s::cl_double edge0, s::cl_double edge1,
s::cl_double x) __NOEXC {
__SYCL_EXPORT s::cl_double sycl_host_smoothstep(s::cl_double edge0,
s::cl_double edge1,
s::cl_double x) __NOEXC {
return __smoothstep(edge0, edge1, x);
}
__SYCL_EXPORT s::cl_half smoothstep(s::cl_half edge0, s::cl_half edge1,
s::cl_half x) __NOEXC {
__SYCL_EXPORT s::cl_half
sycl_host_smoothstep(s::cl_half edge0, s::cl_half edge1, s::cl_half x) __NOEXC {
return __smoothstep(edge0, edge1, x);
}
MAKE_1V_2V_3V(smoothstep, s::cl_float, s::cl_float, s::cl_float, s::cl_float)
MAKE_1V_2V_3V(smoothstep, s::cl_double, s::cl_double, s::cl_double,
MAKE_1V_2V_3V(sycl_host_smoothstep, s::cl_float, s::cl_float, s::cl_float,
s::cl_float)
MAKE_1V_2V_3V(sycl_host_smoothstep, s::cl_double, s::cl_double, s::cl_double,
s::cl_double)
MAKE_1V_2V_3V(smoothstep, s::cl_half, s::cl_half, s::cl_half, s::cl_half)
MAKE_1V_2V_3V(sycl_host_smoothstep, s::cl_half, s::cl_half, s::cl_half,
s::cl_half)

// sign
__SYCL_EXPORT s::cl_float sign(s::cl_float x) __NOEXC { return __sign(x); }
__SYCL_EXPORT s::cl_double sign(s::cl_double x) __NOEXC { return __sign(x); }
__SYCL_EXPORT s::cl_half sign(s::cl_half x) __NOEXC { return __sign(x); }
MAKE_1V(sign, s::cl_float, s::cl_float)
MAKE_1V(sign, s::cl_double, s::cl_double)
MAKE_1V(sign, s::cl_half, s::cl_half)
__SYCL_EXPORT s::cl_float sycl_host_sign(s::cl_float x) __NOEXC {
return __sign(x);
}
__SYCL_EXPORT s::cl_double sycl_host_sign(s::cl_double x) __NOEXC {
return __sign(x);
}
__SYCL_EXPORT s::cl_half sycl_host_sign(s::cl_half x) __NOEXC {
return __sign(x);
}
MAKE_1V(sycl_host_sign, s::cl_float, s::cl_float)
MAKE_1V(sycl_host_sign, s::cl_double, s::cl_double)
MAKE_1V(sycl_host_sign, s::cl_half, s::cl_half)

} // namespace __host_std
Loading