init
This commit is contained in:
42
old/9apr26_prerefactor/include/amsculib2/amscumath_impl.hpp
Normal file
42
old/9apr26_prerefactor/include/amsculib2/amscumath_impl.hpp
Normal file
@ -0,0 +1,42 @@
|
||||
#ifndef __AMSCUMATH_IMPL_HPP__
|
||||
#define __AMSCUMATH_IMPL_HPP__
|
||||
|
||||
namespace amscuda
|
||||
{
|
||||
|
||||
template<typename T> __host__ __device__ T min(T a, T b)
|
||||
{
|
||||
if(a>b)
|
||||
{
|
||||
return b;
|
||||
}
|
||||
else
|
||||
{
|
||||
return a;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
template<typename T> __host__ __device__ T max(T a, T b)
|
||||
{
|
||||
if(a>b)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
else
|
||||
{
|
||||
return b;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
template<> __host__ __device__ double min(double a, double b);
|
||||
template<> __host__ __device__ float min(float a, float b);
|
||||
template<> __host__ __device__ double max(double a, double b);
|
||||
template<> __host__ __device__ float max(float a, float b);
|
||||
|
||||
|
||||
}; //end namespace amscuda
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user