diff --git a/src/pyronn_torch/codegen.py b/src/pyronn_torch/codegen.py index 47e00fa8b80cafa9daf013ffedf6659e7f6e4c43..3a6d88b0e7e0df780d88389a8741ee271628c684 100644 --- a/src/pyronn_torch/codegen.py +++ b/src/pyronn_torch/codegen.py @@ -51,7 +51,7 @@ try: TypedSymbol('volume_origin_z', create_type('float32'), const=True), *[FieldShapeSymbol(['projection'], i) for i in range(2, 0, -1)], TypedSymbol('projection_multiplier', - create_type('float32'), const=True), + create_type('float32'), const=True), backend='gpucuda', 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, const int volume_width, const int volume_height, const int volume_depth, @@ -73,7 +73,9 @@ try: TypedSymbol('volume_spacing_z', create_type('float32'), const=True), *[FieldShapeSymbol(['projection'], i) for i in range(2, 0, -1)], 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, 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, @@ -93,7 +95,9 @@ try: TypedSymbol('volume_spacing_z', create_type('float32'), const=True), *[FieldShapeSymbol(['projection'], i) for i in range(2, 0, -1)], 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( const float *__restrict__ volume_ptr, float *out, const float *inv_AR_matrix, const float *src_points, @@ -118,6 +122,7 @@ try: FieldShapeSymbol([projections_1d.name], 1), TypedSymbol('detector_spacing', 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=""" void Parallel_Projection2D_Kernel_Launcher( const float *volume_ptr, float *out, const float *ray_vectors, @@ -142,6 +147,7 @@ try: FieldShapeSymbol([projections_1d.name], 1), TypedSymbol('detector_spacing', 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=""" 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, diff --git a/tests/test_alternative_wrappers.py b/tests/test_alternative_wrappers.py new file mode 100644 index 0000000000000000000000000000000000000000..3a1b7ec72ab2b874ba073d5800fbc2825efb8178 --- /dev/null +++ b/tests/test_alternative_wrappers.py @@ -0,0 +1,27 @@ +# +# 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