#pragma once #ifdef INCLUDE_CUDA #include <cuda.h> #include <cuda_runtime_api.h> #define FUCNTION_DECLARATION_SPECIFIER __host__ __device__ #else #define FUCNTION_DECLARATION_SPECIFIER #endif namespace sfx_math { template<typename T> FUCNTION_DECLARATION_SPECIFIER T min(const T a, const T b); template<typename T> FUCNTION_DECLARATION_SPECIFIER T max(const T a, const T b); } template<typename T> FUCNTION_DECLARATION_SPECIFIER T sfx_math::min(const T a, const T b) { if(a > b) return b; return a; } template<typename T> FUCNTION_DECLARATION_SPECIFIER T sfx_math::max(const T a, const T b) { if(a > b) return a; return b; }