Closed marty1885 closed 3 months ago
Which compiler are you using and is it with -Werror?
Does changing "if" to "if constexpr" also fix the error for you?
if constexpr (TENSTORRENT_MAX_DMA_BUFS <= std::numeric_limits<decltype(tenstorrent_allocate_dma_buf_in::buf_index)>::max()) {
auto buf_max = AllocateDmaBuf(dev_fd, page_size(), TENSTORRENT_MAX_DMA_BUFS);
If it does, I would prefer if constexpr rather than casting the value. That code path never runs unless TENSTORRENT_MAX_DMA_BUFS is representable in uint8_t anyway.
Hi,
I know this is an unsupported setup. I'm working on a set of AUR packages to install Tenstorrent software onto Arch Linux. This patch fixes test building during Arch processing the DKMS hook during a kernel or driver upgrade. Otherwise the compiler complains about
TENSTORRENT_MAX_DMA_BUFS
being casted to 0 due to the 3rd parameter inAllocateDmaBuf
is of typeuint8_t
but the value of TENSTORRENT_MAX_DMA_BUFS is 256.