Implement min/max functions in HIP header

Remove using hc::precise_math min and max. Instead we can use ocml directly for device and std:: for host.
Ta zmiana jest zawarta w:
%! (template.HTML=Aaron Enye Shi)złożyło 2018-07-05 20:15:41 +00:00
1 rodzic 96ab7c7b25
złożenie b362c53475
3 plików zmienionych
+12 -9

Żadne pliki nie pasują do Twojego wyszukiwania

+3
Wyświetl plik
@@ -43,6 +43,9 @@ extern "C" __device__ float __ocml_rint_f32(float);
extern "C" __device__ float __ocml_ceil_f32(float);
extern "C" __device__ float __ocml_trunc_f32(float);
extern "C" __device__ float __ocml_fmin_f32(float, float);
extern "C" __device__ float __ocml_fmax_f32(float, float);
// Introduce local address space
#define __local __attribute__((address_space(3)))
+9 -2
Wyświetl plik
@@ -201,8 +201,15 @@ __device__ int __hip_move_dpp(int src, int dpp_ctrl, int row_mask, int bank_mask
#endif //__HIP_ARCH_GFX803__ == 1
__host__ __device__ int min(int arg1, int arg2);
__host__ __device__ int max(int arg1, int arg2);
__device__ inline static int min(int arg1, int arg2) {
return (int)(__ocml_fmin_f32((float) arg1, (float) arg2));
}
__device__ inline static int max(int arg1, int arg2) {
return (int)(__ocml_fmax_f32((float) arg1, (float) arg2));
}
__host__ inline static int min(int arg1, int arg2) { return std::min(arg1, arg2); }
__host__ inline static int max(int arg1, int arg2) { return std::max(arg1, arg2); }
#endif // __HCC_OR_HIP_CLANG__