Skip to content

[SYCL][libdevice] Add max/min for all types to dl specific file #10625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2023
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
41 changes: 41 additions & 0 deletions libdevice/imf/imf_fp32_dl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,45 @@ int __devicelib_imf_min(int x, int y) { return x < y ? x : y; }

DEVICE_EXTERN_C_INLINE
int __devicelib_imf_hadd(int x, int y) { return __shadd(x, y); }

DEVICE_EXTERN_C_INLINE
long long int __devicelib_imf_llmax(long long int x, long long int y) {
return __imax(x, y);
}

DEVICE_EXTERN_C_INLINE
long long int __devicelib_imf_llmin(long long int x, long long int y) {
return __imin(x, y);
}

DEVICE_EXTERN_C_INLINE
unsigned long long int __devicelib_imf_ullmax(unsigned long long int x,
unsigned long long int y) {
return __imax(x, y);
}

DEVICE_EXTERN_C_INLINE
unsigned long long int __devicelib_imf_ullmin(unsigned long long int x,
unsigned long long int y) {
return __imin(x, y);
}

DEVICE_EXTERN_C_INLINE
unsigned int __devicelib_imf_umax(unsigned int x, unsigned int y) {
return __imax(x, y);
}

DEVICE_EXTERN_C_INLINE
unsigned int __devicelib_imf_umin(unsigned int x, unsigned int y) {
return __imin(x, y);
}

DEVICE_EXTERN_C_INLINE float __devicelib_imf_fmaxf(float a, float b) {
return __fmax(a, b);
}

DEVICE_EXTERN_C_INLINE float __devicelib_imf_fminf(float a, float b) {
return __fmin(a, b);
}

#endif /*__LIBDEVICE_IMF_ENABLED__*/
8 changes: 8 additions & 0 deletions libdevice/imf/imf_fp64_dl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@ DEVICE_EXTERN_C_INLINE double __devicelib_imf_fabs(double x) {
return __fabs(x);
}

DEVICE_EXTERN_C_INLINE double __devicelib_imf_fmax(double a, double b) {
return __fmax(a, b);
}

DEVICE_EXTERN_C_INLINE double __devicelib_imf_fmin(double a, double b) {
return __fmin(a, b);
}

#endif /*__LIBDEVICE_IMF_ENABLED__*/
8 changes: 0 additions & 8 deletions libdevice/imf/imf_inline_fp32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,6 @@ DEVICE_EXTERN_C_INLINE float __devicelib_imf_rsqrtf(float a) {

DEVICE_EXTERN_C_INLINE float __devicelib_imf_invf(float a) { return 1.0f / a; }

DEVICE_EXTERN_C_INLINE float __devicelib_imf_fmaxf(float a, float b) {
return __fmax(a, b);
}

DEVICE_EXTERN_C_INLINE float __devicelib_imf_fminf(float a, float b) {
return __fmin(a, b);
}

DEVICE_EXTERN_C_INLINE float __devicelib_imf_copysignf(float a, float b) {
return __copysign(a, b);
}
Expand Down
8 changes: 0 additions & 8 deletions libdevice/imf/imf_inline_fp64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ DEVICE_EXTERN_C_INLINE double __devicelib_imf_rsqrt(double a) {

DEVICE_EXTERN_C_INLINE double __devicelib_imf_inv(double a) { return 1.0 / a; }

DEVICE_EXTERN_C_INLINE double __devicelib_imf_fmax(double a, double b) {
return __fmax(a, b);
}

DEVICE_EXTERN_C_INLINE double __devicelib_imf_fmin(double a, double b) {
return __fmin(a, b);
}

DEVICE_EXTERN_C_INLINE double __devicelib_imf_copysign(double a, double b) {
return __copysign(a, b);
}
Expand Down
32 changes: 0 additions & 32 deletions libdevice/imf_utils/integer_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,36 +174,4 @@ unsigned long long int __devicelib_imf_umul64hi(unsigned long long int x,
#endif
}

DEVICE_EXTERN_C_INLINE
long long int __devicelib_imf_llmax(long long int x, long long int y) {
return __imax(x, y);
;
}

DEVICE_EXTERN_C_INLINE
long long int __devicelib_imf_llmin(long long int x, long long int y) {
return __imin(x, y);
}

DEVICE_EXTERN_C_INLINE
unsigned long long int __devicelib_imf_ullmax(unsigned long long int x,
unsigned long long int y) {
return __imax(x, y);
}

DEVICE_EXTERN_C_INLINE
unsigned long long int __devicelib_imf_ullmin(unsigned long long int x,
unsigned long long int y) {
return __imin(x, y);
}

DEVICE_EXTERN_C_INLINE
unsigned int __devicelib_imf_umax(unsigned int x, unsigned int y) {
return __imax(x, y);
}

DEVICE_EXTERN_C_INLINE
unsigned int __devicelib_imf_umin(unsigned int x, unsigned int y) {
return __imin(x, y);
}
#endif //__LIBDEVICE_IMF_ENABLED__