Skip to content

Commit

Permalink
Update wgpu
Browse files Browse the repository at this point in the history
  • Loading branch information
fornwall committed May 3, 2024
1 parent fa5d9f7 commit d341dde
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/core/src/year2022/day23_webgpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ pub fn solve(input: &Input) -> Result<usize, String> {
layout: Some(&compute_pipeline_layout),
module: &shader,
entry_point: "propose_movement",
compilation_options: Default::default(),
});

let move_pipeline = gpu
Expand All @@ -194,6 +195,7 @@ pub fn solve(input: &Input) -> Result<usize, String> {
layout: Some(&compute_pipeline_layout),
module: &shader,
entry_point: "apply_movement",
compilation_options: Default::default(),
});

for round in 0..input.part_values(10, 1000) {
Expand All @@ -214,7 +216,7 @@ pub fn solve(input: &Input) -> Result<usize, String> {
pass_encoder.set_pipeline(&propose_pipeline);
pass_encoder.set_bind_group(0, &compute_bind_group_from_0_to_1, &[]);
let workgroup_width = 8;
let workgroup_count_x = MAX_SIZE as u32 / workgroup_width as u32;
let workgroup_count_x = MAX_SIZE as u32 / workgroup_width;
let workgroup_count_y = workgroup_count_x;
let workgroup_count_z = 1;
pass_encoder.dispatch_workgroups(workgroup_count_x, workgroup_count_y, workgroup_count_z);
Expand All @@ -225,7 +227,7 @@ pub fn solve(input: &Input) -> Result<usize, String> {
pass_encoder.set_pipeline(&move_pipeline);
pass_encoder.set_bind_group(0, &compute_bind_group_from_1_to_0, &[]);
let workgroup_width = 8;
let workgroup_count_x = MAX_SIZE as u32 / workgroup_width as u32;
let workgroup_count_x = MAX_SIZE as u32 / workgroup_width;
let workgroup_count_y = workgroup_count_x;
let workgroup_count_z = 1;
pass_encoder.dispatch_workgroups(workgroup_count_x, workgroup_count_y, workgroup_count_z);
Expand Down

1 comment on commit d341dde

@github-actions
Copy link

Choose a reason for hiding this comment

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

@@                     Benchmark Difference                     @@
#      Name   Old (instructions)   New (instructions)   Change (%)
   2023_1_1            1,470,554            1,470,554            0
   2023_1_2            1,443,136            1,443,136            0
   2023_2_1              620,177              620,177            0
   2023_2_2              595,020              595,020            0
   2023_3_1              745,492              745,492            0
   2023_3_2              580,459              580,459            0
   2023_4_1              895,928              895,928            0
   2023_4_2              907,144              907,144            0
   2023_5_1              601,580              601,580            0
   2023_5_2              723,935              723,935            0
   2023_6_1                3,567                3,567            0
   2023_6_2                2,562                2,562            0
   2023_7_1              657,946              657,946            0
   2023_7_2              649,918              649,918            0
   2023_8_1            1,180,665            1,180,665            0
   2023_8_2            2,585,797            2,585,797            0
   2023_9_1              763,143              763,143            0
   2023_9_2              774,870              774,870            0
  2023_10_1            3,042,064            3,042,064            0
  2023_10_2            3,612,538            3,612,538            0
  2023_11_1            2,748,454            2,748,454            0
  2023_11_2            2,748,478            2,748,478            0
  2023_12_1            4,325,826            4,325,826            0
  2023_12_2           68,431,524           68,431,524            0
  2023_13_1              567,707              567,707            0
  2023_13_2              568,661              568,661            0
  2023_14_1              816,949              816,942            0
  2023_14_2          293,978,846          293,978,832            0
  2023_15_1              762,569              762,569            0
  2023_15_2            1,045,149            1,045,149            0
  2023_16_1            1,045,368            1,045,361            0
  2023_16_2          216,029,319          216,026,239            0
  2023_17_1          222,730,410          222,730,410            0
  2023_17_2          678,740,234          678,740,234            0
  2023_18_1              327,190              327,190            0
  2023_18_2              415,267              415,267            0
  2023_19_1            2,859,324            2,859,292            0
  2023_19_2            1,793,370            1,793,338            0
  2023_20_1            4,622,698            4,622,698            0
  2023_20_2           18,087,777           18,087,777            0
  2023_21_1           83,478,807           83,478,807            0
  2023_21_2            6,902,991            6,902,991            0
  2023_22_1           23,852,443           23,852,443            0
  2023_22_2          304,874,034          304,874,034            0
  2023_23_1            1,660,827            1,660,891            0
  2023_23_2        1,129,458,356        1,129,458,420            0
  2023_24_1           15,586,761           15,586,761            0
  2023_24_2            1,144,022            1,144,022            0
  2023_25_1            4,703,792            4,703,824            0
Benchmark Instructions (count) Instructions (%)
2023_23_2 1,129,458,420 36.2
2023_17_2 678,740,234 21.8
2023_22_2 304,874,034 9.8
2023_14_2 293,978,832 9.4
2023_17_1 222,730,410 7.1
2023_16_2 216,026,239 6.9
2023_21_1 83,478,807 2.7
2023_12_2 68,431,524 2.2
2023_22_1 23,852,443 0.8
2023_20_2 18,087,777 0.6
2023_24_1 15,586,761 0.5
2023_21_2 6,902,991 0.2
2023_25_1 4,703,824 0.2
2023_20_1 4,622,698 0.1
2023_12_1 4,325,826 0.1
2023_10_2 3,612,538 0.1
2023_10_1 3,042,064 0.1
2023_19_1 2,859,292 0.1
2023_11_2 2,748,478 0.1
2023_11_1 2,748,454 0.1
2023_8_2 2,585,797 0.1
2023_19_2 1,793,338 0.1
2023_23_1 1,660,891 0.1
2023_1_1 1,470,554 0.0
2023_1_2 1,443,136 0.0
2023_8_1 1,180,665 0.0
2023_24_2 1,144,022 0.0
2023_16_1 1,045,361 0.0
2023_15_2 1,045,149 0.0
2023_4_2 907,144 0.0
2023_4_1 895,928 0.0
2023_14_1 816,942 0.0
2023_9_2 774,870 0.0
2023_9_1 763,143 0.0
2023_15_1 762,569 0.0
2023_3_1 745,492 0.0
2023_5_2 723,935 0.0
2023_7_1 657,946 0.0
2023_7_2 649,918 0.0
2023_2_1 620,177 0.0
2023_5_1 601,580 0.0
2023_2_2 595,020 0.0
2023_3_2 580,459 0.0
2023_13_2 568,661 0.0
2023_13_1 567,707 0.0
2023_18_2 415,267 0.0
2023_18_1 327,190 0.0
2023_6_1 3,567 0.0
2023_6_2 2,562 0.0

Please sign in to comment.