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
b60af20a
Commit
b60af20a
authored
13 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Check for contiguity in array operations.
parent
60f8f0d4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
pyopencl/array.py
+3
-0
3 additions, 0 deletions
pyopencl/array.py
pyopencl/elementwise.py
+4
-0
4 additions, 0 deletions
pyopencl/elementwise.py
pyopencl/reduction.py
+4
-0
4 additions, 0 deletions
pyopencl/reduction.py
pyopencl/scan.py
+8
-0
8 additions, 0 deletions
pyopencl/scan.py
with
19 additions
and
0 deletions
pyopencl/array.py
+
3
−
0
View file @
b60af20a
...
...
@@ -151,6 +151,9 @@ def elwise_kernel_runner(kernel_getter):
actual_args
=
[]
for
arg
in
args
:
if
isinstance
(
arg
,
Array
):
if
not
arg
.
flags
.
forc
:
raise
RuntimeError
(
"
only contiguous arrays may
"
"
be used as arguments to this operation
"
)
actual_args
.
append
(
arg
.
data
)
else
:
actual_args
.
append
(
arg
)
...
...
This diff is collapsed.
Click to expand it.
pyopencl/elementwise.py
+
4
−
0
View file @
b60af20a
...
...
@@ -142,6 +142,10 @@ class ElementwiseKernel:
invocation_args
=
[]
for
arg
,
arg_descr
in
zip
(
args
,
self
.
arguments
):
if
isinstance
(
arg_descr
,
VectorArg
):
if
not
arg
.
flags
.
forc
:
raise
RuntimeError
(
"
ElementwiseKernel cannot
"
"
deal with non-contiguous arrays
"
)
vectors
.
append
(
arg
)
invocation_args
.
append
(
arg
.
data
)
else
:
...
...
This diff is collapsed.
Click to expand it.
pyopencl/reduction.py
+
4
−
0
View file @
b60af20a
...
...
@@ -291,6 +291,10 @@ class ReductionKernel:
from
pyopencl.tools
import
VectorArg
for
arg
,
arg_tp
in
zip
(
args
,
stage_inf
.
arg_types
):
if
isinstance
(
arg_tp
,
VectorArg
):
if
not
arg
.
flags
.
forc
:
raise
RuntimeError
(
"
ReductionKernel cannot
"
"
deal with non-contiguous arrays
"
)
vectors
.
append
(
arg
)
invocation_args
.
append
(
arg
.
data
)
else
:
...
...
This diff is collapsed.
Click to expand it.
pyopencl/scan.py
+
8
−
0
View file @
b60af20a
...
...
@@ -442,6 +442,10 @@ if _CL_MODE:
if
input_ary
.
shape
!=
output_ary
.
shape
:
raise
ValueError
(
"
input and output must have the same shape
"
)
if
not
input_ary
.
flags
.
forc
:
raise
RuntimeError
(
"
ScanKernel cannot
"
"
deal with non-contiguous arrays
"
)
n
,
=
input_ary
.
shape
if
not
n
:
...
...
@@ -542,6 +546,10 @@ else:
if
input_ary
.
shape
!=
output_ary
.
shape
:
raise
ValueError
(
"
input and output must have the same shape
"
)
if
not
input_ary
.
flags
.
forc
:
raise
RuntimeError
(
"
ScanKernel cannot
"
"
deal with non-contiguous arrays
"
)
n
,
=
input_ary
.
shape
if
not
n
:
...
...
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