template<> __device__ __forceinline__ uchar saturate_cast<uchar>(float v)
 { 
     int iv = __float2int_rn(v); 
     return saturate_cast<uchar>(iv); 
 }
 template<> __device__ __forceinline__ int saturate_cast<int>(float v) 
 { 
     return __float2int_rn(v); 
 }
Beispiel #3
0
__device__  short2 convert2s2(const float2 f2O1_){ //can be called from host and device
	return make_short2(__float2int_rn(f2O1_.x), __float2int_rn(f2O1_.y));
}
 template<> __device__ __forceinline__ short saturate_cast<short>(float v)
 { 
     int iv = __float2int_rn(v); 
     return saturate_cast<short>(iv); 
 }
Beispiel #5
0
 __device__ __forceinline__ elem_type operator ()(float y, float x) const
 {
     return src(__float2int_rn(y), __float2int_rn(x));
 }