Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pyopencl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
pyopencl
Commits
246d2bfa
Commit
246d2bfa
authored
12 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Better error reporting in create_some_context.
parent
c31944d1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pyopencl/__init__.py
+6
-1
6 additions, 1 deletion
pyopencl/__init__.py
with
6 additions
and
1 deletion
pyopencl/__init__.py
+
6
−
1
View file @
246d2bfa
...
@@ -745,7 +745,7 @@ def create_some_context(interactive=True, answers=None):
...
@@ -745,7 +745,7 @@ def create_some_context(interactive=True, answers=None):
for
i
,
dev
in
enumerate
(
devices
):
for
i
,
dev
in
enumerate
(
devices
):
if
choice
in
dev
.
name
.
lower
():
if
choice
in
dev
.
name
.
lower
():
return
dev
return
dev
raise
RuntimeError
(
"
input did not match any
platform
"
)
raise
RuntimeError
(
"
input did not match any
device
"
)
if
not
devices
:
if
not
devices
:
raise
Error
(
"
no devices found
"
)
raise
Error
(
"
no devices found
"
)
...
@@ -768,6 +768,11 @@ def create_some_context(interactive=True, answers=None):
...
@@ -768,6 +768,11 @@ def create_some_context(interactive=True, answers=None):
user_inputs
=
pre_provided_answers
+
user_inputs
user_inputs
=
pre_provided_answers
+
user_inputs
print
(
"
Set the environment variable PYOPENCL_CTX=
'
%s
'
to
"
print
(
"
Set the environment variable PYOPENCL_CTX=
'
%s
'
to
"
"
avoid being asked again.
"
%
"
:
"
.
join
(
user_inputs
))
"
avoid being asked again.
"
%
"
:
"
.
join
(
user_inputs
))
if
answers
:
raise
RuntimeError
(
"
not all provided choices were used by
"
"
create_some_context. (left over:
'
%s
'
)
"
%
"
:
"
.
join
(
answers
))
return
Context
(
devices
)
return
Context
(
devices
)
_csc
=
create_some_context
_csc
=
create_some_context
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment