Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pyronn-torch
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
Show more breadcrumbs
Stephan Seitz
pyronn-torch
Commits
f2abee0d
Commit
f2abee0d
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Add test_alternative_wrappers: start usage of pyronn_torch for alternative frameworks
parent
15f1af31
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pyronn_torch/codegen.py
+9
-3
9 additions, 3 deletions
src/pyronn_torch/codegen.py
tests/test_alternative_wrappers.py
+27
-0
27 additions, 0 deletions
tests/test_alternative_wrappers.py
with
36 additions
and
3 deletions
src/pyronn_torch/codegen.py
+
9
−
3
View file @
f2abee0d
...
@@ -51,7 +51,7 @@ try:
...
@@ -51,7 +51,7 @@ try:
TypedSymbol
(
'
volume_origin_z
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_origin_z
'
,
create_type
(
'
float32
'
),
const
=
True
),
*
[
FieldShapeSymbol
([
'
projection
'
],
i
)
for
i
in
range
(
2
,
0
,
-
1
)],
*
[
FieldShapeSymbol
([
'
projection
'
],
i
)
for
i
in
range
(
2
,
0
,
-
1
)],
TypedSymbol
(
'
projection_multiplier
'
,
TypedSymbol
(
'
projection_multiplier
'
,
create_type
(
'
float32
'
),
const
=
True
),
create_type
(
'
float32
'
),
const
=
True
),
backend
=
'
gpucuda
'
,
fields_accessed
=
[
volume
,
projection
,
projection_matrices
],
custom_signature
=
"""
fields_accessed
=
[
volume
,
projection
,
projection_matrices
],
custom_signature
=
"""
void Cone_Backprojection3D_Kernel_Launcher(const float *sinogram_ptr, float *out, const float *projection_matrices, const int number_of_projections,
void Cone_Backprojection3D_Kernel_Launcher(const float *sinogram_ptr, float *out, const float *projection_matrices, const int number_of_projections,
const int volume_width, const int volume_height, const int volume_depth,
const int volume_width, const int volume_height, const int volume_depth,
...
@@ -73,7 +73,9 @@ try:
...
@@ -73,7 +73,9 @@ try:
TypedSymbol
(
'
volume_spacing_z
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_spacing_z
'
,
create_type
(
'
float32
'
),
const
=
True
),
*
[
FieldShapeSymbol
([
'
projection
'
],
i
)
for
i
in
range
(
2
,
0
,
-
1
)],
*
[
FieldShapeSymbol
([
'
projection
'
],
i
)
for
i
in
range
(
2
,
0
,
-
1
)],
TypedSymbol
(
'
step_size
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
step_size
'
,
create_type
(
'
float32
'
),
const
=
True
),
fields_accessed
=
[
volume
,
projection
,
inv_matrices
,
source_points
],
custom_signature
=
"""
backend
=
'
gpucuda
'
,
fields_accessed
=
[
volume
,
projection
,
inv_matrices
,
source_points
],
custom_signature
=
"""
void Cone_Projection_Kernel_Launcher(const float* volume_ptr, float *out, const float *inv_AR_matrix, const float *src_points,
void Cone_Projection_Kernel_Launcher(const float* volume_ptr, float *out, const float *inv_AR_matrix, const float *src_points,
const int number_of_projections, const int volume_width, const int volume_height, const int volume_depth,
const int number_of_projections, const int volume_width, const int volume_height, const int volume_depth,
const float volume_spacing_x, const float volume_spacing_y, const float volume_spacing_z,
const float volume_spacing_x, const float volume_spacing_y, const float volume_spacing_z,
...
@@ -93,7 +95,9 @@ try:
...
@@ -93,7 +95,9 @@ try:
TypedSymbol
(
'
volume_spacing_z
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_spacing_z
'
,
create_type
(
'
float32
'
),
const
=
True
),
*
[
FieldShapeSymbol
([
'
projection
'
],
i
)
for
i
in
range
(
2
,
0
,
-
1
)],
*
[
FieldShapeSymbol
([
'
projection
'
],
i
)
for
i
in
range
(
2
,
0
,
-
1
)],
TypedSymbol
(
'
step_size
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
step_size
'
,
create_type
(
'
float32
'
),
const
=
True
),
fields_accessed
=
[
volume
,
projection
,
inv_matrices
,
source_points
],
custom_signature
=
"""
backend
=
'
gpucuda
'
,
fields_accessed
=
[
volume
,
projection
,
inv_matrices
,
source_points
],
custom_signature
=
"""
void Cone_Projection_Kernel_Tex_Interp_Launcher(
void Cone_Projection_Kernel_Tex_Interp_Launcher(
const float *__restrict__ volume_ptr, float *out,
const float *__restrict__ volume_ptr, float *out,
const float *inv_AR_matrix, const float *src_points,
const float *inv_AR_matrix, const float *src_points,
...
@@ -118,6 +122,7 @@ try:
...
@@ -118,6 +122,7 @@ try:
FieldShapeSymbol
([
projections_1d
.
name
],
1
),
FieldShapeSymbol
([
projections_1d
.
name
],
1
),
TypedSymbol
(
'
detector_spacing
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
detector_spacing
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
detector_origin
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
detector_origin
'
,
create_type
(
'
float32
'
),
const
=
True
),
backend
=
'
gpucuda
'
,
fields_accessed
=
[
volume_slice
,
projections_1d
,
ray_vectors
],
custom_signature
=
"""
fields_accessed
=
[
volume_slice
,
projections_1d
,
ray_vectors
],
custom_signature
=
"""
void Parallel_Projection2D_Kernel_Launcher(
void Parallel_Projection2D_Kernel_Launcher(
const float *volume_ptr, float *out, const float *ray_vectors,
const float *volume_ptr, float *out, const float *ray_vectors,
...
@@ -142,6 +147,7 @@ try:
...
@@ -142,6 +147,7 @@ try:
FieldShapeSymbol
([
projections_1d
.
name
],
1
),
FieldShapeSymbol
([
projections_1d
.
name
],
1
),
TypedSymbol
(
'
detector_spacing
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
detector_spacing
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
detector_origin
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
detector_origin
'
,
create_type
(
'
float32
'
),
const
=
True
),
backend
=
'
gpucuda
'
,
fields_accessed
=
[
volume_slice
,
projections_1d
,
ray_vectors
],
custom_signature
=
"""
fields_accessed
=
[
volume_slice
,
projections_1d
,
ray_vectors
],
custom_signature
=
"""
void Parallel_Backprojection2D_Kernel_Launcher(const float *sinogram_ptr, float *out, const float *ray_vectors, const int number_of_projections,
void Parallel_Backprojection2D_Kernel_Launcher(const float *sinogram_ptr, float *out, const float *ray_vectors, const int number_of_projections,
const int volume_width, const int volume_height, const float volume_spacing_x, const float volume_spacing_y,
const int volume_width, const int volume_height, const float volume_spacing_x, const float volume_spacing_y,
...
...
This diff is collapsed.
Click to expand it.
tests/test_alternative_wrappers.py
0 → 100644
+
27
−
0
View file @
f2abee0d
#
# Copyright © 2020 Stephan Seitz <stephan.seitz@fau.de>
#
# Distributed under terms of the GPLv3 license.
"""
This tests are unrelated to pyronn_torch itself.
But rather for wrapping PYRO-NN for other frameworks.
"""
import
tempfile
from
pyronn_torch.codegen
import
generate_shared_object
def
test_wrap_walberla
():
import
pytest
pytest
.
importorskip
(
"
walberla_app
"
)
from
walberla_app.kernel_call_nodes
import
WalberlaModule
generate_shared_object
(
tempfile
.
TemporaryDirectory
,
None
,
show_code
=
True
,
framework_module_class
=
WalberlaModule
,
generate_code_only
=
True
)
def
test_wrap_tensorflow
():
pass
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