File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -191,13 +191,10 @@ directory and run this command:
191191
192192::
193193
194- python -c "import pygpu;pygpu.test()"
194+ DEVICE="<test device>" python -c "import pygpu;pygpu.test()"
195195
196- By default it will attempt to run the test on 'opencl0:0'. To use a
197- different device set the environment variable DEVICE or
198- GPUARRAY_DEVICE to the desired device name. See the documentation for
199- :py:meth: `pygpu.gpuarray.init ` for more details on the syntax of the
200- device name.
196+ See the documentation for :py:meth: `pygpu.gpuarray.init ` for more
197+ details on the syntax of the device name.
201198
202199The test script prints the device name of the chosen device so that
203200you can confirm which device it is running on.
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ def get_env_dev():
2626 for name in ['GPUARRAY_TEST_DEVICE' , 'DEVICE' ]:
2727 if name in os .environ :
2828 return os .environ [name ]
29- return "opencl0:0"
29+ raise RuntimeError ( "No test device specified. Specify one using the DEVICE or GPUARRAY_TEST_DEVICE environment variables." )
3030
3131
3232context = gpuarray .init (get_env_dev ())
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ int get_env_dev(const char **name) {
1717 if (dev == NULL ) {
1818 if ((dev = getenv ("GPUARRAY_TEST_DEVICE" )) == NULL ) {
1919 if ((dev = getenv ("DEVICE" )) == NULL ) {
20- * name = "opencl" ;
21- return 0 ; /* opencl0:0 */
20+ fprintf ( stderr , "No device specified for testing, specify a device with DEVICE or GPUARRAY_TEST_DEVICE" ) ;
21+ return -1
2222 }
2323 }
2424 }
You can’t perform that action at this time.
0 commit comments