Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
GrayScott Reloaded - Rust practical
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
GRASLAND Hadrien
GrayScott Reloaded - Rust practical
Commits
c2e769c3
Commit
c2e769c3
authored
8 months ago
by
GRASLAND Hadrien
Browse files
Options
Downloads
Patches
Plain Diff
Various bugfixes, still broken
parent
eef895ca
No related branches found
No related tags found
No related merge requests found
Pipeline
#338183
passed
8 months ago
Stage: docker-build
Stage: render-and-tests
Stage: cleanup
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
exercises/src/gpu/grayscott.comp
+2
-3
2 additions, 3 deletions
exercises/src/gpu/grayscott.comp
exercises/src/gpu/step.comp
+10
-8
10 additions, 8 deletions
exercises/src/gpu/step.comp
exercises/src/gpu/switch.comp
+4
-6
4 additions, 6 deletions
exercises/src/gpu/switch.comp
with
16 additions
and
17 deletions
exercises/src/gpu/grayscott.comp
+
2
−
3
View file @
c2e769c3
...
...
@@ -174,8 +174,7 @@ void main() {
}
#endif
// Validated the tile selection, now make sure we fetch up-to-date data
// in process_tile.
// Make sure process_tile operates on up-to-date data
memoryBarrierBuffer();
// Process selected tile
...
...
@@ -209,7 +208,7 @@ void main() {
#endif
// Terminate work-group once it finishes a tile
if (s_
out
put_buffer_idx == LAST_BUFFER_IDX) {
if (s_
in
put_buffer_idx == LAST_BUFFER_IDX) {
#if DEBUG
if (is_leader()) atomicAdd(g_metadata.num_normal_exit, 1);
#endif
...
...
This diff is collapsed.
Click to expand it.
exercises/src/gpu/step.comp
+
10
−
8
View file @
c2e769c3
...
...
@@ -22,10 +22,12 @@ bool leader_try_acquire_tile() {
}
#endif
const uint expected_input_idx = s_input_buffer_idx;
const uint expected_steal_count = s_expected_steal_count;
do {
// Try to signal other work-groups that we're working on this tile
const uint desired_steal_count =
s_
expected_steal_count + 1;
const uint desired_tile_status = encode_tile_status(
s_input_buffer
_idx,
const uint desired_steal_count = expected_steal_count + 1;
const uint desired_tile_status = encode_tile_status(
expected_input
_idx,
desired_steal_count,
s_expected_await_count);
const uint status_before_cas = comp_swap_tile_status(
...
...
@@ -58,16 +60,14 @@ bool leader_try_acquire_tile() {
// Update state variables, prepare to analyze the transition
s_expected_tile_status = status_before_cas;
const uint old_input_idx = s_input_buffer_idx;
const uint old_steal_count = s_expected_steal_count;
decode_tile_status(status_before_cas,
s_input_buffer_idx,
s_expected_steal_count,
s_expected_await_count);
// Did another work-group steal our tile?
if ((s_input_buffer_idx !=
ol
d_input_idx)
|| (s_expected_steal_count !=
ol
d_steal_count))
if ((s_input_buffer_idx !=
expecte
d_input_idx)
|| (s_expected_steal_count !=
expecte
d_steal_count))
{
#if PROFILE
s_num_stolen_early += 1;
...
...
@@ -112,7 +112,9 @@ bool leader_try_finish_step() {
if (status_before_cas == s_expected_tile_status) {
s_expected_tile_status = desired_tile_status;
s_input_buffer_idx = s_output_buffer_idx;
s_output_buffer_idx = output_buffer_idx(prev_input_idx);
if (s_input_buffer_idx < LAST_BUFFER_IDX) {
s_output_buffer_idx = output_buffer_idx(prev_input_idx);
}
return true;
}
...
...
@@ -129,7 +131,7 @@ bool leader_try_finish_step() {
}
#endif
// Update state variables
, prepare to analyze the transition
// Update state variables
s_expected_tile_status = status_before_cas;
decode_tile_status(status_before_cas,
s_input_buffer_idx,
...
...
This diff is collapsed.
Click to expand it.
exercises/src/gpu/switch.comp
+
4
−
6
View file @
c2e769c3
...
...
@@ -401,12 +401,6 @@ void switch_tile() {
}
#endif
// Release ownership of the current tile
if (s_acquired_tile) {
if (is_leader()) leader_release_tile();
barrier();
}
// Start with a tile block surrounding our current tile
//
// Center it as much as possible to maximize the odds of finding a close
...
...
@@ -423,6 +417,10 @@ void switch_tile() {
);
}
// Release ownership of the current tile
if (is_leader() && s_acquired_tile) leader_release_tile();
barrier();
// Repeatedly attempt to find a better tile
uint attempts;
for (attempts = 0; attempts < MAX_SWITCH_ATTEMPTS; ++attempts) {
...
...
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