Closed j8asic closed 2 years ago
{fmt} requires basic C++ support including long double
. You might want to report an issue to NVIDIA asking them to at least make a sensible fallback.
@vitaut so the libc++
guys say they are right to disable long double
math functions on the device https://godbolt.org/z/9Th19nWqP. So this bug I rewrite as: “fmt tries to call device math functions for long double, instead of appropriate host functions”
No idea what this means but a PR with a workaround for CUDA will be welcome provided that it's not too intrusive.
The visit_format_arg
function in core.h
always tries to format long_double_type
, which creates compile errors when long double math is disabled (sometimes we have FMT_USE_FLOAT128=0
because there are no implementations of those math functions e.g. for CUDA under libc++). So this case should be treated similar like for int128_type
case is treated using FMT_USE_INT128
. I.e. FMT_USE_FLOAT128
should be checked and taken into account.
Seems like
libc++
implementations of device functions do not supportlong double
(i.e. CUDA doesnt have long double), so I am getting errors invisit_format_arg
The treatment for me was to use long doubles as regular double here: https://github.com/fmtlib/fmt/blob/a48e3355a682b7e76d672c4dbd64aad2aad2ec6e/include/fmt/core.h#L1662