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
74f49da9
Commit
74f49da9
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Fix texture uploading
parent
6c18a869
No related branches found
No related tags found
No related merge requests found
Pipeline
#18920
failed
5 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pystencils_autodiff/backends/astnodes.py
+2
-0
2 additions, 0 deletions
src/pystencils_autodiff/backends/astnodes.py
src/pystencils_autodiff/framework_integration/astnodes.py
+4
-3
4 additions, 3 deletions
src/pystencils_autodiff/framework_integration/astnodes.py
with
6 additions
and
3 deletions
src/pystencils_autodiff/backends/astnodes.py
+
2
−
0
View file @
74f49da9
...
...
@@ -14,6 +14,7 @@ from os.path import dirname, exists, join
from
pystencils.astnodes
import
FieldPointerSymbol
,
FieldShapeSymbol
,
FieldStrideSymbol
from
pystencils.cpu.cpujit
import
get_cache_config
from
pystencils.include
import
get_pycuda_include_path
,
get_pystencils_include_path
from
pystencils_autodiff._file_io
import
read_template_from_file
,
write_file
from
pystencils_autodiff.backends.python_bindings
import
(
PybindFunctionWrapping
,
PybindPythonBindings
,
TensorflowFunctionWrapping
,
...
...
@@ -105,6 +106,7 @@ class TorchModule(JinjaCppFile):
torch_extension
=
load
(
hash
,
[
file_name
],
with_cuda
=
self
.
is_cuda
,
extra_cflags
=
'
--std=c++14
'
,
extra_include_paths
=
[
get_pycuda_include_path
(),
get_pystencils_include_path
()])
return
torch_extension
...
...
This diff is collapsed.
Click to expand it.
src/pystencils_autodiff/framework_integration/astnodes.py
+
4
−
3
View file @
74f49da9
...
...
@@ -11,13 +11,14 @@ waLBerla currently uses `pystencils-walberla <https://pypi.org/project/pystencil
"""
import
itertools
from
collections.abc
import
Iterable
from
functools
import
reduce
from
typing
import
Any
,
List
,
Set
import
jinja2
import
numpy
as
np
import
sympy
as
sp
import
pystencils
import
sympy
as
sp
from
pystencils.astnodes
import
KernelFunction
,
Node
,
NodeOrExpr
,
ResolvedFieldAccess
from
pystencils.data_types
import
TypedSymbol
from
pystencils.kernelparameters
import
FieldPointerSymbol
,
FieldShapeSymbol
,
FieldStrideSymbol
...
...
@@ -95,7 +96,7 @@ class NativeTextureBinding(pystencils.backends.cbackend.CustomCodeNode):
cudaTextureDesc {texture_desc}{{}};
cudaTextureObject_t {texture_object}=0;
cudaCreateTextureObject(&{texture_object}, &{resource_desc}, &texture_desc, null
_
ptr);
cudaCreateTextureObject(&{texture_object}, &{resource_desc}, &
{
texture_desc
}
, nullptr);
{texture_desc}.readMode = cudaReadModeElementType;
auto {texture_object}Destroyer = [&](){{
cudaDestroyTextureObject({texture_object});
...
...
@@ -153,7 +154,7 @@ auto {texture_object}Destroyer = [&](){{
device_ptr
=
self
.
_device_ptr
,
cuda_channel_format
=
self
.
_get_channel_format_string
(),
bits_per_channel
=
self
.
_dtype
.
itemsize
*
8
,
total_size
=
"
TODO!!!
"
)
total_size
=
self
.
_dtype
.
itemsize
*
reduce
(
lambda
x
,
y
:
x
*
y
,
self
.
_shape
,
1
)
)
return
code
...
...
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