Skip to content

Commit 579e89e

Browse files
authored
Merge pull request Theano#232 from abergeron/maint
Stop using opencl0:0 as the default test device.
2 parents 35c9e19 + 902bc40 commit 579e89e

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

doc/installation.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff 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

202199
The test script prints the device name of the chosen device so that
203200
you can confirm which device it is running on.

pygpu/tests/support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

3232
context = gpuarray.init(get_env_dev())

tests/device.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)