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

enabled all combinations of pre and post streaming in native cuda template #251

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rawbby
Copy link
Contributor

@rawbby rawbby commented Oct 23, 2024

Description

Enabled all combinations of pre and post streaming in native cuda template.
Still needs integration into the Simulation interface and unit tests.

Bugfix: out-of-date native cuda directory was removed.

rawbby and others added 4 commits September 25, 2024 14:43
…generate all combinations of pre and post streaming (post streaming still needs interface integration and unit tests...)
@rawbby rawbby self-assigned this Oct 23, 2024

constexpr index_t e[q][d] = {e};
constexpr scalar_t w[q] = {w};
read(i);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

key change: simplified template body by shifting the streaming logic into a macro definition

}}
}}
for (index_t i = 0; i < q; ++i)
write(i);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

key change: simplified template body by shifting the streaming logic into a macro definition

#define neighbour(q_, sign_) (((q_ * dimension[0] + clamp(index[0] sign_ e[q_][0], dimension[0])) * dimension[1] + clamp(index[1] sign_ e[q_][1], dimension[1])) * dimension[2] + clamp(index[2] sign_ e[q_][2], dimension[2]))
#endif

#define read_(q_) f_reg[q_] = f[dist_index[q_]]; ((void)0)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

new definitions for reading / writing / streaming

@@ -161,6 +161,8 @@ def generate(self):

val['name'] = self.name
val['version'] = self.version
val['enable_pre_streaming'] = '0'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

new flags for controling the streaming in the generated kernel

@lettucecfd lettucecfd deleted a comment from pep8speaks Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant