File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""Tests for general GPU support"""
22
3- import os
43import subprocess
5- import sys
64import unittest
75
86from common import gpu_test
@@ -14,11 +12,3 @@ def test_system_management_interface(self):
1412 smi = subprocess .Popen (['nvidia-smi' ], stdout = subprocess .PIPE , stderr = subprocess .STDOUT )
1513 smi .communicate ()
1614 self .assertEqual (0 , smi .returncode )
17-
18- @gpu_test
19- def test_pycuda (self ):
20- import pycuda .driver
21- pycuda .driver .init ()
22- gpu_name = pycuda .driver .Device (0 ).name ()
23- self .assertNotEqual (0 , len (gpu_name ))
24-
Original file line number Diff line number Diff line change 1+ """Tests for general GPU support"""
2+
3+ import unittest
4+
5+ from common import gpu_test
6+
7+
8+ class TestPycuda (unittest .TestCase ):
9+ @gpu_test
10+ def test_pycuda (self ):
11+ import pycuda .driver
12+ pycuda .driver .init ()
13+ gpu_name = pycuda .driver .Device (0 ).name ()
14+ self .assertNotEqual (0 , len (gpu_name ))
You can’t perform that action at this time.
0 commit comments