Add files via upload

This commit is contained in:
patientx 2025-02-15 17:14:13 +03:00 committed by GitHub
parent d90af62f75
commit 5a7efc7b23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

19
testzluda.py Normal file
View File

@ -0,0 +1,19 @@
import torch
try:
# Check if CUDA is available
if not torch.cuda.is_available():
raise RuntimeError("CUDA is not available")
# Create tensors on the GPU
ten1 = torch.randn((2, 4), device="cuda")
ten2 = torch.randn((4, 8), device="cuda")
# Perform matrix multiplication
output = torch.mm(ten1, ten2)
# Print success message
print("zluda is correctly installed and working")
except Exception as e:
# Print failure message if any exception occurs
print(f"zluda isn't installed correctly: {e}")