@@ -97,6 +97,20 @@ class CodeGen_OpenCL_Dev : public CodeGen_GPU_Dev {
9797 alias (" fast_inverse" , " native_recip" );
9898 alias (" fast_inverse_sqrt" , " native_rsqrt" );
9999#undef alias
100+
101+ extern_function_name_map[" fast_sin_f32" ] = " native_sin" ;
102+ extern_function_name_map[" fast_cos_f32" ] = " native_cos" ;
103+ extern_function_name_map[" fast_tan_f32" ] = " native_tan" ;
104+ extern_function_name_map[" fast_exp_f32" ] = " native_exp" ;
105+ extern_function_name_map[" fast_log_f32" ] = " native_log" ;
106+ extern_function_name_map[" fast_pow_f32" ] = " native_powr" ;
107+
108+ extern_function_name_map[" fast_sin_f16" ] = " half_sin" ;
109+ extern_function_name_map[" fast_cos_f16" ] = " half_cos" ;
110+ extern_function_name_map[" fast_tan_f16" ] = " half_tan" ;
111+ extern_function_name_map[" fast_exp_f16" ] = " half_exp" ;
112+ extern_function_name_map[" fast_log_f16" ] = " half_log" ;
113+ extern_function_name_map[" fast_pow_f16" ] = " half_powr" ;
100114 }
101115 void add_kernel (Stmt stmt,
102116 const std::string &name,
@@ -1140,12 +1154,6 @@ void CodeGen_OpenCL_Dev::init_module() {
11401154 << " inline bool is_nan_f32(float x) {return isnan(x); }\n "
11411155 << " inline bool is_inf_f32(float x) {return isinf(x); }\n "
11421156 << " inline bool is_finite_f32(float x) {return isfinite(x); }\n "
1143- << " #define fast_sin_f32 native_sin \n "
1144- << " #define fast_cos_f32 native_cos \n "
1145- << " #define fast_tan_f32 native_tan \n "
1146- << " #define fast_exp_f32 native_exp \n "
1147- << " #define fast_log_f32 native_log \n "
1148- << " #define fast_pow_f32 native_powr \n "
11491157 << " #define fast_inverse_f32 native_recip \n "
11501158 << " #define fast_inverse_sqrt_f32 native_rsqrt \n " ;
11511159
0 commit comments