SciNim / flambeau

Nim bindings to libtorch
84 stars 3 forks source link

`hasCuda` is not in global Torch scope #30

Closed Vindaar closed 11 months ago

Vindaar commented 3 years ago

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.

Clonkk commented 3 years ago

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

Vindaar commented 3 years ago

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.

Clonkk commented 11 months ago

is_cuda_available is now exported, this should fix this ticket.

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