From: Erik S. <esc...@pe...> - 2011-11-06 00:17:42
|
The current way we handle cl_khr_fp64 and cl_khr_int64 leads to much code duplication. One alternative would be to define two macros __IFDBL(x) __IFLNG(x) that expand to their arguments if double and long are supported, respectively, and expand to nothing otherwise. #ifdef cl_khr_fp64 # define __IFDBL(x) x #else # define __IFDBL(x) #endif We would surround every line in _kernel.h that uses double or long with the respective macro. This would look like #define _CL_DECLARE_FUNC_V_V(NAME) \ float _cl_overloadable NAME(float ); \ float2 _cl_overloadable NAME(float2 ); \ __IFDBL(double _cl_overloadable NAME(double );) \ __IFDBL(double2 _cl_overloadable NAME(double2 );) Does this sound like a good idea? -erik -- Erik Schnetter <esc...@pe...> http://www.cct.lsu.edu/~eschnett/ AIM: eschnett247, Skype: eschnett, Google Talk: sch...@gm... |