Skip to content

Commit

Permalink
Remove the last instances of cudaThreadSynchronize
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo-rovigatti committed May 9, 2021
1 parent e9380e0 commit aebbdba
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/CUDA/Backends/FFS_MD_CUDAMixedBackend.cu
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,6 @@ void FFS_MD_CUDAMixedBackend::init() {
free(h_hb_pairs1);
free(h_hb_pairs2);
free(h_hb_cutoffs);

cudaThreadSynchronize();
}

SimpleConditions FFS_MD_CUDAMixedBackend::_get_simple_conditions(std::vector<parsed_condition> conditions, const char type[256]) {
Expand Down Expand Up @@ -676,7 +674,7 @@ void FFS_MD_CUDAMixedBackend::_eval_order_parameter_states() {
_cuda_interaction->_near_hb_op_precalc(_d_poss, _d_orientations, _d_hb_pairs1, _d_hb_pairs2, _d_nearhb_states, _n_hb_pairs, _d_region_is_nearhb, _ffs_hb_precalc_kernel_cfg, _d_cuda_box);

_cuda_interaction->_dist_op_precalc(_d_poss, _d_orientations, _d_dist_pairs1, _d_dist_pairs2, _d_op_dists, _n_dist_pairs, _ffs_dist_precalc_kernel_cfg, _d_cuda_box);
cudaThreadSynchronize();
cudaDeviceSynchronize();
}

void FFS_MD_CUDAMixedBackend::_eval_stop_conditions(SimpleConditions sc) {
Expand All @@ -697,7 +695,7 @@ void FFS_MD_CUDAMixedBackend::_eval_stop_conditions(SimpleConditions sc) {
<<<_ffs_dist_eval_kernel_cfg.blocks, _ffs_dist_eval_kernel_cfg.threads_per_block>>>
(_d_op_dists, _d_dist_region_lens, _d_dist_region_rows, sc.d_dist_cond_lens, sc.d_dist_cond_rows, sc.d_dist_cond_mags, sc.d_dist_cond_types, sc.d_ffs_stop, _n_dist_regions, sc.hb_cond_len);
CUT_CHECK_ERROR("dist_op_eval error");
cudaThreadSynchronize();
cudaDeviceSynchronize();

CUDA_SAFE_CALL(cudaMemcpy(sc.h_ffs_stop, sc.d_ffs_stop, sc.stop_length * sizeof(bool), cudaMemcpyDeviceToHost));
}
Expand Down

0 comments on commit aebbdba

Please sign in to comment.