Yaxun (Sam) Liu
808dae6813
Enable template max and min for HIP-Clang ( #2028 )
...
It was for HCC only. HIP-Clang also needs it for __fp16 since AMDMIGraphX uses it.
Change-Id: Id49322b7b89ef799accdf6b47627a6fce51d1ab5
2020-04-24 12:30:28 -07:00
Yaxun (Sam) Liu
4af2106d10
Fix ambiguity of fma for _Float16 for libc++ ( #1976 )
...
libc++ defines fma as template function for auto promotion of mixed-type
arguments. libc++ does not handle _Float16 as _Float16 is not a supported
type by C++ standard. As such, it is unlikely we can commit our fix for
_Float16 to libc++ trunk.
Therefore we handle _Float16 with a template specialization of
__numeric_type in HIP headers.
Change-Id: If01960a657ebf1a7a67463cdcf66fab7458dff3c
2020-04-06 15:35:18 +05:30
Yaxun (Sam) Liu
7aa7a4ce22
Fix assert for windows. ( #1329 )
...
MSVC assert.h has no guard for include once. The macro assert overrides
device assert definition. Do not include it for device compilation.
2019-08-16 02:13:33 +00:00
Yaxun Sam Liu
278007218a
Fix nan for windows
2019-02-27 12:33:26 -05:00
Yaxun Sam Liu
ee4ce7ae49
Fix nan() for windows
2019-02-07 17:29:36 -05:00
Maneesh Gupta
50a12f1ce1
Merge pull request #863 from aaronenyeshi/add-dot-instructions
...
Add Dot functions as amd_mixed_dot function
2019-01-29 06:01:01 +05:30
Aaron Enye Shi
ede494bd5f
Fix mixed dot for Jenkins rocm_2_0
2019-01-24 22:48:35 +00:00
Aaron Enye Shi
712a4cbdc2
Use correct OCKL native vector types
2019-01-22 22:31:19 +00:00
Aaron Enye Shi
8bf588bdb1
Allow hip-clang to use amd_mixed_dot as well
2019-01-22 16:21:16 +00:00
Maneesh Gupta
dd9bea7d25
Map more instrincis to ocml native
...
Change-Id: I54e55d5902931bafdabd0956e4e8c1d7b39f7173
2019-01-15 19:40:37 +05:30
Aaron Enye Shi
22f7570774
Add backwards compatibility to dot funcs
2019-01-14 23:14:49 +00:00
Aaron Enye Shi
f0b114ee1c
Move fp16 dot functions to hip_fp16
2019-01-14 21:50:32 +00:00
Maneesh Gupta
2b9d52b210
Switch to faster ocml variants for trig instrinsics
...
Change-Id: If62821e2fe1b0da91ad1b8c5580ebf1a009405e9
2019-01-14 13:01:57 +05:30
Aaron Enye Shi
aae1f4f96e
Add Dot functions as amd_mixed_dot function
...
Introduce the Dot functions which are available in the device library. Forward those prototypes, and introduce HIP API to expose the usage of the dot functions.
2019-01-11 23:31:02 +00:00
Aaron Enye Shi
58dfeff27a
Add *_rn functions back into HIP intrinsics
...
Add back the round-to-nearest-even intrinsics back to HIP math
intrinsics as it caused regression.
2018-12-18 19:31:54 +00:00
Aaron Enye Shi
0cfaa52d15
Guard rcp rounded implementation as well
...
Since rcp implementations of non-default rounded versions are not correct or supported in OCML, guard them using the same macro OCML_BASIC_ROUNDED_OPERATIONS. Also update the docs and tests.
2018-11-06 19:53:28 +00:00
Aaron Enye Shi
e59c33250a
Guard the OCML rounded operations instead
...
Instead of commenting all these functions out, guard the functions with a macro OCML_BASIC_ROUNDED_OPERATIONS.
2018-11-06 16:32:14 +00:00
Aaron Enye Shi
2b108a2cfd
Remove non-working non-default-rounded math apis
...
In ROCm-Device-Libs, they have dropped the non-default-rounded versions of add, sub, mul, div, sqrt and fma. Therefore, ocml has removed the rte, rtp, rtn, and rtz counterparts. This will remove the same math APIs in HIP for _ru, _rd, _rn, and _rz.
2018-11-05 22:34:16 +00:00
Maneesh Gupta
4a00b244a3
Merge pull request #705 from ROCm-Developer-Tools/feature_minimal_changes_for_hc_next
...
Feature minimal changes for hc next
2018-10-19 06:58:31 +05:30
Alex Voicu
5ccaf2fa7d
Dumb workaround is still needed, so add it back.
2018-10-18 15:33:46 +01:00
Alex Voicu
ca375cb8c5
Re-sync with upstream.
2018-10-10 11:43:49 +01:00
Aaron Enye Shi
77c07d4118
Use sinf and cosf from ocml device libs
...
Using llvm_amdgcn builtin fails to produce accurate values, we should move to using the ocml device library versions.
2018-09-25 19:31:39 +00:00
Maneesh Gupta
3d67c9f952
Merge pull request #614 from ROCm-Developer-Tools/fma
...
Add overloading resolution functions for fma
2018-09-20 13:38:03 +05:30
Yaxun Sam Liu
a5c961e26c
Silent warnings about duplicate static keyword
...
static is already in __DEVICE__, so should be removed.
2018-09-19 10:39:45 -04:00
Yaxun Sam Liu
bd622a4b4a
Add fma function with float and _Float16 arguments
2018-09-19 09:59:33 -04:00
Yaxun Sam Liu
cf184460e9
Fix build failure of hipTestHalf and hipTestIncludeMath for hip-clang
2018-09-18 21:00:15 -04:00
Alex Voicu
c6720e882b
Align with HC Next.
2018-09-17 11:50:29 +03:00
Aaron Enye Shi
6b811ca6d1
Fix Tensorflow ambiguous min issue
2018-09-13 23:16:20 +00:00
Aaron Enye Shi
894cbdd749
Avoid AMP-retrict call to CPU-restrict
2018-09-12 14:54:31 +00:00
Aaron Enye Shi
ffd89dde9c
Avoid host min func conflict with gcc min
2018-09-11 18:48:31 +00:00
Aaron Enye Shi
0121ec13aa
Use templates for min to prevent ambiguity
2018-09-11 18:21:54 +00:00
Yaxun Sam Liu
b8a0c14171
Fix __HIP_ARCH_* not defined after including math_functions.h
...
hcc_detail/math_functions.h used to include hcc_detail/hip_runtime.h.
Removing it has caused regression in TensorFlow 1.8.
Put it back for backward compatibiliity.
2018-08-08 08:55:28 -04:00
Yaxun Sam Liu
dacb18414e
Fix declaration conflict when hip/math_functions.h is included first
...
This fixes build failure in TensorFlow 1.8 for HCC
2018-08-07 15:44:59 -04:00
Yaxun (Sam) Liu
80438035c2
Support std::complex for hip-clang
2018-07-18 00:08:04 -04:00
Alex Voicu
6c7a64efa2
Removes use of unimplemented OCML functionality.
2018-06-25 19:16:27 +01:00
Alex Voicu
8bfcb22c57
Rename for minimal confusion.
2018-06-01 22:55:33 +01:00
Alex Voicu
ebd6d49cd2
Fix typos / address review comments.
2018-06-01 16:20:21 +01:00
Alex Voicu
ab4b2a650b
Re-sync with upstream. Add integer abs.
2018-05-31 16:38:00 +01:00
Alex Voicu
59db16fd36
Switch to using ROCDL directly, as opposed to via HC. Add missing bits.
2018-05-31 03:17:26 +01:00
Jorghi12
6e2b9d0547
Update math_functions.h
...
CUDA also has a function named labs.
2018-05-26 16:22:10 -04:00
Jorghi12
4f6904b5c7
Adding double/long int signatures for abs
...
Adding overloads for abs that are found in cuda's math_functions.
2018-05-26 00:41:24 -04:00
Deven Desai
af586bbbf2
Checkin to fix bugs in math functions.
...
This change fixes the following bugs that were discovered while debuggnig TF unit test failures (cwise_ops_test)
1. __hisinf and __hisnan routines
Both had incorrect implementations.
2. abs
A "long long" (64bit int) version was missing, resulting in the 32bit version being used for 64bit ints (which resulted in incorrect results, when the value passed in was outside the 32bit int range)
3. lgamma
We seemed to have a custom version for the 'double' datatype (which was giving incorrect results). Replaced it with a call to the 'double' version of the underlying 'hc::precision_math::lgamma'
2018-04-24 18:10:07 +00:00
Maneesh Gupta
1ba06f63c4
Apply .clangformat to all repo source files
...
Change-Id: I7e79c6058f0303f9a98911e3b7dd2e8596079344
2018-03-12 11:29:03 +05:30
Aaron En Ye Shi
707aaef99d
Fix ilogb/ilogbf functions to return int
...
This patch will fix hipDoublePrecisionMathDevice test on ThinLTO, which uncovered that hip math_function's ilogb/ilogbf should return type int instead of double. This will match rocdl.
2017-12-05 23:14:10 +00:00
Ben Sander
68c2146dc3
Fix math ordering for --genco mode.
2017-10-02 21:52:16 +00:00
Maneesh Gupta
7a446dcbc5
Renable frexp(f) device math function
...
Change-Id: I53c022b8ddf38cd17ddb42eba457b9020db66395
2017-07-20 14:41:30 +05:30
Maneesh Gupta
f65574422f
Merge branch 'amd-develop' into amd-master
...
Change-Id: I05572d2b32f1df70b54e2efeb32c8a4d8055912d
(cherry picked from commit 3a56e5c09b )
2017-04-13 03:36:11 -05:00
Aditya Atluri
e0133e627d
fixed header names
...
Change-Id: I21650d6398187d3767b28e8ac81b2642d3b89a0e
2017-03-31 12:18:55 -05:00
Aditya Atluri
d9f0bd25be
added support for lgammaf and lgamma
...
1. Implementation inside HIP
Change-Id: I657263b7276a57c56081d3336fef816b5f204eff
2017-03-17 18:26:10 -05:00
Aditya Atluri
60013396f6
removed host math functions from math_functions.h
...
Change-Id: I90d8784e2d6b58c6fade9f0fa12c0db3ee417d3e
2017-01-27 17:38:43 -06:00