Skip to content

Future proofing - #1589

Merged
KrisThielemans merged 6 commits into
UCL:masterfrom
KrisThielemans:future_proofing
Apr 16, 2025
Merged

KrisThielemans merged 6 commits into
UCL:masterfrom
KrisThielemans:future_proofing

Conversation

@KrisThielemans

Copy link
Copy Markdown
Collaborator

prepare for possible changes in future to enable GPU array etc. This might mean stir::Array template arguments change in the future, or DiscretisedDensity is derived from a different class. It is now recommended to

  • include stir/ArrayFwd.h when using forward declaration
  • use the ArrayType template-alias in places where a rectangular array that might live on a GPU is intended.

As stir:Array template arguments might change in the future,
it is now recommended to include ArrayFwd.h when using forward
declaration.
This caused problems for SWIG
@NikEfth

NikEfth commented Apr 13, 2025

Copy link
Copy Markdown
Collaborator

How should I go about that?
Several options I merge this to my branch, do anything that is needed and commit those changes and pr here. Then you merge to master and I sync.

It should be able to avoid the conflicts, right?

@KrisThielemans

Copy link
Copy Markdown
Collaborator Author

No. Anything in your branch will contaminate. Just have a look here if I missed anything obvious. We merge to master. You merge master on yours and just fix whatever.

@KrisThielemans

Copy link
Copy Markdown
Collaborator Author

Python tests still failing with

 AttributeError: 'stir.FloatVoxelsOnCartesianGrid' object has no attribute 'fill'

Seems that SWIG doesn't understand the way we use using

@NikEfth

NikEfth commented Apr 14, 2025

Copy link
Copy Markdown
Collaborator

I think it's ok, but:
But, I am a bit worried about the IO functions as they are very specific to the current Array and ArrayType hides the type of Array you are using. You will have to go through the existing read_ & write_

@KrisThielemans

Copy link
Copy Markdown
Collaborator Author

Of course, you can change the read_from_file etc in your PR to do the proper thing for the new type. It's a bit hard for me to see how I'd do this generically. Or are you saying I should undo the changes for read_from_file etc?

@KrisThielemans
KrisThielemans merged commit 4e57186 into UCL:master Apr 16, 2025
@KrisThielemans

Copy link
Copy Markdown
Collaborator Author

@NikEfth I thought it best to merge this now. Please merge onto your PR and adjust at will.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants