Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tensor type #81

Open
wants to merge 11 commits into
base: ebourne_tensor_tools
Choose a base branch
from
Open

Conversation

EmilyBourne
Copy link
Member

@EmilyBourne EmilyBourne commented Feb 7, 2025

Add a type to describe tensor objects. Fixes #75 .

This PR is (almost) equivalent to https://gitlab.maisondelasimulation.fr/gysela-developpers/gyselalibxx/-/merge_requests/852

This PR is based off #77 and must be merged after #77

@EmilyBourne EmilyBourne marked this pull request as ready for review February 7, 2025 15:37
@EmilyBourne EmilyBourne marked this pull request as draft February 7, 2025 15:38
Copy link

github-actions bot commented Feb 7, 2025

It seems like you haven't finished working on this PR so it has been put back into draft. Please remove the draft status when the PR can run tests without being interrupted.

@EmilyBourne EmilyBourne changed the base branch from main to ebourne_tensor_tools February 7, 2025 15:38
@EmilyBourne EmilyBourne marked this pull request as ready for review February 7, 2025 15:40
@EmilyBourne EmilyBourne temporarily deployed to GitLab GPU trigger February 7, 2025 15:40 — with GitHub Actions Inactive
@EmilyBourne EmilyBourne added the Ready to review Label to be automatically added to a PR when it is ready to be reviewed label Feb 7, 2025
{
tensor_tools::Vector<int, R_cov, Theta_cov> a;
tensor_tools::Vector<int, R, Theta> b;
ddcHelper::get<R_cov>(a) = -6;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You use the function get to initialise the value ? I would have imagine a set function ?

Copy link
Member

@tpadioleau tpadioleau Feb 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also use get to have a write access.

  • if a is const-qualified then get can only provide you a read access, so get<R_cov>(a) = -6 would not compile
  • if not then get can provide both read/write access

@tpadioleau tpadioleau self-requested a review February 14, 2025 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready to review Label to be automatically added to a PR when it is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a Tensor type
3 participants