This is an archive of the discontinued LLVM Phabricator instance.

[HIP] Fix HIP rounding math intrinsics
ClosedPublic

Authored by ashi1 on Oct 22 2020, 8:11 AM.

Details

Reviewers
yaxunl
b-sumner
Summary

The ocml_*_rte_f32 and ocml_*_rte_f64 functions are not
available if OCML_BASIC_ROUNDED_OPERATIONS is not defined.

Diff Detail

Event Timeline

ashi1 requested review of this revision.Oct 22 2020, 8:11 AM
ashi1 created this revision.
b-sumner added inline comments.Oct 22 2020, 8:26 AM
clang/lib/Headers/__clang_hip_math.h
1152

All of these should be implemented with the appropriate version of __ocml_div_rtX_f64

1161

This intrinsic is far too inaccurate. Just use 1.0 / __x

ashi1 updated this revision to Diff 299990.Oct 22 2020, 8:38 AM
ashi1 marked 2 inline comments as done.

Updated the rcp rounded functions to use div and default to use 1.0 / __x.

ashi1 updated this revision to Diff 299994.Oct 22 2020, 8:42 AM

Looks good to me.

yaxunl accepted this revision.Oct 22 2020, 8:56 AM

LGTM. Thanks.

This revision is now accepted and ready to land.Oct 22 2020, 8:56 AM