PoseLib icon indicating copy to clipboard operation
PoseLib copied to clipboard

[Feature/request] Float precision supports

Open seoj135 opened this issue 1 year ago • 4 comments

Hello, I'm Jin.

I'd like to ask whether you have plan to support float on PoseLib or not. By the cmake config or by using template param. both are fine, but maybe template based one is more flexible to use. While config based one is a quickable approach.

float may have too many numerical issues but it can be much faster on low-power devices, this is why I am asking about it Thank you to read it :)

seoj135 avatar Jul 05 '24 03:07 seoj135

What do you mean by cmake config? Were you suggesting replacing all instance of double for something like Real? And then use something like this:

#ifdef USE_FLOAT
typedef float Real;
#else
typedef double Real;
#endif

Maybe you can propose a PR :)

pablospe avatar Jul 05 '24 20:07 pablospe

Cmake config I meant is like your example. btw, then what do you think about applying template? It's useful, but it can make worse on compiliation time.

seoj135 avatar Jul 08 '24 02:07 seoj135

From what I understand we would need to template every function and instantiate it with both float and double. I am not a fan of this as it would explode compile times.

Updating the entire code-base to replace double with Real is also not very appealing to me. I am not sure if there are any other alternatives though.

vlarsson avatar Jul 23 '24 13:07 vlarsson

@pablospe @vlarsson Hello, this request opened too long ago. anyway, I am trying to work about it by following the way @pablospe suggested.

prec_t will be first alias at commit, but it can be changed to 'real' as suggested in any chance. I will open PR after some days later and let you know.

Also I will check performance differences if possible. or just try to make comparisons later on.

seoj135 avatar Dec 31 '24 10:12 seoj135