Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pystencils_autodiff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
pycodegen
pystencils_autodiff
Commits
213512d8
Commit
213512d8
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Fix texture uploading for the 3-d case
parent
5ebe72cd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#19184
failed
5 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/pystencils_autodiff/framework_integration/astnodes.py
+8
-7
8 additions, 7 deletions
src/pystencils_autodiff/framework_integration/astnodes.py
with
8 additions
and
7 deletions
src/pystencils_autodiff/framework_integration/astnodes.py
+
8
−
7
View file @
213512d8
...
@@ -258,14 +258,15 @@ cudaMalloc{ndim}Array(&{array}, &channel_desc_{texture_name}, """ + (
...
@@ -258,14 +258,15 @@ cudaMalloc{ndim}Array(&{array}, &channel_desc_{texture_name}, """ + (
array
=
'
array_
'
+
texture_name
array
=
'
array_
'
+
texture_name
if
self
.
_texture
.
field
.
ndim
==
3
:
if
self
.
_texture
.
field
.
ndim
==
3
:
copy_params
=
f
'
cpy_
{
texture_name
}
_params
'
copy_params
=
f
'
cpy_
{
texture_name
}
_params
'
return
f
"""
cudaMemcpy3DPar
a
ms
{
copy_params
}
{{}};
return
f
"""
cudaMemcpy3DParms
{
copy_params
}
{{}};
{
copy_params
}
.srcPtr = {{
{
self
.
_device_ptr
}
,
{
copy_params
}
.srcPtr = {{
{
self
.
_device_ptr
}
,
{
self
.
_texture
.
field
.
strides
[
-
1
]
*
self
.
_texture
.
field
.
shape
[
-
1
]
*
self
.
_dtype
.
numpy_dtype
.
itemsize
}
,
{
self
.
_texture
.
field
.
strides
[
-
1
]
*
self
.
_texture
.
field
.
shape
[
-
1
]
*
self
.
_dtype
.
numpy_dtype
.
itemsize
}
,
{
self
.
_texture
.
field
.
shape
[
-
1
],
self
.
_texture
.
field
.
shape
[
-
2
]
}
}};
{
self
.
_texture
.
field
.
shape
[
-
1
]
}
,
{
copy_params
}
.dsrArray =
{
array
}
;
{
self
.
_texture
.
field
.
shape
[
-
2
]
}
}};
copyParams.extent = {{
{
"
,
"
.
join
(
reversed
(
self
.
_shape
))
}
}};
{
copy_params
}
.dstArray =
{
array
}
;
copyParams.kind = cudaMemcpyDeviceToDevice;
{
copy_params
}
.extent = {{
{
"
,
"
.
join
(
str
(
s
)
for
s
in
reversed
(
self
.
_shape
))
}
}};
cudaMemcpy3D(&{{copy_params}});
"""
# noqa
{
copy_params
}
.kind = cudaMemcpyDeviceToDevice;
cudaMemcpy3D(&
{
copy_params
}
);
"""
# noqa
elif
self
.
_texture
.
field
.
ndim
==
2
:
elif
self
.
_texture
.
field
.
ndim
==
2
:
# noqa: cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind);
# noqa: cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind);
...
...
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