|
10 | 10 | #ifndef __CLANG_HIP_LIBDEVICE_DECLARES_H__
|
11 | 11 | #define __CLANG_HIP_LIBDEVICE_DECLARES_H__
|
12 | 12 |
|
| 13 | +#if !defined(__HIPCC_RTC__) && __has_include("hip/hip_version.h") |
| 14 | +#include "hip/hip_version.h" |
| 15 | +#endif // __has_include("hip/hip_version.h") |
| 16 | + |
13 | 17 | #ifdef __cplusplus
|
14 | 18 | extern "C" {
|
15 | 19 | #endif
|
@@ -312,6 +316,29 @@ __device__ __attribute__((const)) __2i16 __ocml_isnan_2f16(__2f16);
|
312 | 316 | __device__ __attribute__((pure)) __2f16 __ocml_log_2f16(__2f16);
|
313 | 317 | __device__ __attribute__((pure)) __2f16 __ocml_log10_2f16(__2f16);
|
314 | 318 | __device__ __attribute__((pure)) __2f16 __ocml_log2_2f16(__2f16);
|
| 319 | + |
| 320 | +#if HIP_VERSION_MAJOR * 100 + HIP_VERSION_MINOR >= 560 || 1 |
| 321 | +#define __DEPRECATED_SINCE_HIP_560(X) __attribute__((deprecated(X))) |
| 322 | +#else |
| 323 | +#define __DEPRECATED_SINCE_HIP_560(X) |
| 324 | +#endif |
| 325 | + |
| 326 | +// Deprecated, should be removed when rocm releases using it are no longer |
| 327 | +// relevant. |
| 328 | +__DEPRECATED_SINCE_HIP_560("use ((_Float16)1.0) / ") |
| 329 | +__device__ inline _Float16 __llvm_amdgcn_rcp_f16(_Float16 x) { |
| 330 | + return ((_Float16)1.0f) / x; |
| 331 | +} |
| 332 | + |
| 333 | +__DEPRECATED_SINCE_HIP_560("use ((__2f16)1.0) / ") |
| 334 | +__device__ inline __2f16 |
| 335 | +__llvm_amdgcn_rcp_2f16(__2f16 __x) |
| 336 | +{ |
| 337 | + return ((__2f16)1.0f) / __x; |
| 338 | +} |
| 339 | + |
| 340 | +#undef __DEPRECATED_SINCE_HIP_560 |
| 341 | + |
315 | 342 | __device__ __attribute__((const)) __2f16 __ocml_rint_2f16(__2f16);
|
316 | 343 | __device__ __attribute__((const)) __2f16 __ocml_rsqrt_2f16(__2f16);
|
317 | 344 | __device__ __2f16 __ocml_sin_2f16(__2f16);
|
|
0 commit comments