Skip to content
Snippets Groups Projects
Commit d303b185 authored by rarbore2's avatar rarbore2
Browse files

fix syncthreads hack

parent 7b6ba729
No related branches found
No related tags found
2 merge requests!215Large benches,!214More optimizations
Pipeline #202022 passed
This commit is part of merge request !214. Comments created here will be created in the context of that merge request.
...@@ -562,8 +562,9 @@ namespace cg = cooperative_groups; ...@@ -562,8 +562,9 @@ namespace cg = cooperative_groups;
* and writes. * and writes.
*/ */
fn codegen_helpers(&self, w: &mut String) -> Result<(), Error> { fn codegen_helpers(&self, w: &mut String) -> Result<(), Error> {
write!(w, "\t__shared__ cg::experimental::block_tile_memory<1024> block_sync_shared;\n")?;
write!(w, "\tcg::grid_group grid = cg::this_grid();\n")?; write!(w, "\tcg::grid_group grid = cg::this_grid();\n")?;
write!(w, "\tcg::thread_block block = cg::this_thread_block();\n")?; write!(w, "\tcg::thread_block block = cg::experimental::this_thread_block(block_sync_shared);\n")?;
Ok(()) Ok(())
} }
...@@ -1322,8 +1323,8 @@ namespace cg = cooperative_groups; ...@@ -1322,8 +1323,8 @@ namespace cg = cooperative_groups;
)?; )?;
write!(w, "{}\t*({} + i) = 0;\n", tabs, define_variable)?; write!(w, "{}\t*({} + i) = 0;\n", tabs, define_variable)?;
write!(w, "{}}}\n", tabs)?; write!(w, "{}}}\n", tabs)?;
//write!(w, "{}{}.sync();\n", tabs, cg_tile)?; write!(w, "{}{}.sync();\n", tabs, cg_tile)?;
write!(w, "__syncthreads\n")?; //write!(w, "__syncthreads\n")?;
} }
} }
// Dynamic constants emitted at top // Dynamic constants emitted at top
...@@ -1783,8 +1784,8 @@ namespace cg = cooperative_groups; ...@@ -1783,8 +1784,8 @@ namespace cg = cooperative_groups;
} }
let fork = self.join_fork_map.get(&id).unwrap(); let fork = self.join_fork_map.get(&id).unwrap();
let cg_tile_available = self.get_cg_tile(*fork, CGType::Available); let cg_tile_available = self.get_cg_tile(*fork, CGType::Available);
//write!(w_term, "\t{}.sync();\n", cg_tile_available)?; write!(w_term, "\t{}.sync();\n", cg_tile_available)?;
write!(w_term, "\t__syncthreads;\n")?; //write!(w_term, "\t__syncthreads;\n")?;
} }
// If the Fork was parallelized, each thread or UsedPerId tile of // If the Fork was parallelized, each thread or UsedPerId tile of
// threads only runs one ThreadID, so we can jump straight to the // threads only runs one ThreadID, so we can jump straight to the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment