DarkSharpness commented on PR #186:
URL: https://github.com/apache/tvm-ffi/pull/186#issuecomment-3428835302
Sure @junrushao . Save my cuda example code to "test.cu", and then run this
python script:
```nvcc
import torch
import tvm_ffi
with open("./test.cu", "r") as f:
cuda_file = f.read()
module = tvm_ffi.cpp.load_inline("my_module", cuda_sources=[cuda_file])
stream = torch.cuda.Stream()
torch.cuda.set_stream(stream)
x = torch.tensor([10], dtype=torch.float32, device="cuda")
module.add_one_cuda(x, x)
print(x)
```
My dev machine is a normal linux. I'm using `gcc 13.3.0`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]