flambeau icon indicating copy to clipboard operation
flambeau copied to clipboard

`hasCuda` is not in global Torch scope

Open Vindaar opened this issue 3 years ago • 2 comments

The hasCuda procedure, which should return whether the linked Torch library was compiled with CUDA support, does not live in the global Torch namespace.

In the Torch documentation that procedure isn't even found, but checking locally in the header files, the ATen library contains it in the Context.h.

Vindaar avatar Sep 02 '21 12:09 Vindaar

Do you mean hasCuda shouldn't be binded to torch::hasCuda or that the Nim symbol isn't exported by default ?

Clonkk avatar Sep 07 '21 07:09 Clonkk

I'm saying that the current implementation of hasCuda doesn't work (which does indeed try to bind it to torch::hasCuda) and I couldn't figure out how to fix it locally. Opened the issue to not forget about it.

Vindaar avatar Sep 07 '21 11:09 Vindaar

is_cuda_available is now exported, this should fix this ticket.

For reference, I added echo Torch.cuda_is_available() to the test suite :)

Clonkk avatar Oct 11 '23 08:10 Clonkk