From: Roland Schulz Date: Mon, 8 Oct 2018 06:15:08 +0000 (-0700) Subject: OCL: Add const to function arguments X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=6c29e90a92db369b780796c04ded30db48dd24fb;p=alexxy%2Fgromacs.git OCL: Add const to function arguments f1b7d4a51254 added const to variables without also changing function arguments. This fixes it. Not stricly necessary (currently only supporting C). Noticed with C++. Change-Id: I3276ca3f7608571143a608cb2ef28f43d8807964 --- diff --git a/src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernel_utils.clh b/src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernel_utils.clh index 931eafb292..54377cb66e 100644 --- a/src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernel_utils.clh +++ b/src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernel_utils.clh @@ -310,12 +310,12 @@ void convert_sigma_epsilon_to_c6_c12(const float sigma, /*! Apply force switch, force + energy version. */ gmx_opencl_inline -void calculate_force_switch_F(cl_nbparam_params_t *nbparam, - float c6, - float c12, - float inv_r, - float r2, - float *F_invr) +void calculate_force_switch_F(const cl_nbparam_params_t *nbparam, + float c6, + float c12, + float inv_r, + float r2, + float *F_invr) { float r, r_switch; @@ -336,13 +336,13 @@ void calculate_force_switch_F(cl_nbparam_params_t *nbparam, /*! Apply force switch, force-only version. */ gmx_opencl_inline -void calculate_force_switch_F_E(cl_nbparam_params_t *nbparam, - float c6, - float c12, - float inv_r, - float r2, - float *F_invr, - float *E_lj) +void calculate_force_switch_F_E(const cl_nbparam_params_t *nbparam, + float c6, + float c12, + float inv_r, + float r2, + float *F_invr, + float *E_lj) { float r, r_switch; @@ -371,11 +371,11 @@ void calculate_force_switch_F_E(cl_nbparam_params_t *nbparam, /*! Apply potential switch, force-only version. */ gmx_opencl_inline -void calculate_potential_switch_F(cl_nbparam_params_t *nbparam, - float inv_r, - float r2, - float *F_invr, - const float *E_lj) +void calculate_potential_switch_F(const cl_nbparam_params_t *nbparam, + float inv_r, + float r2, + float *F_invr, + const float *E_lj) { float r, r_switch; float sw, dsw; @@ -403,11 +403,11 @@ void calculate_potential_switch_F(cl_nbparam_params_t *nbparam, /*! Apply potential switch, force + energy version. */ gmx_opencl_inline -void calculate_potential_switch_F_E(cl_nbparam_params_t *nbparam, - float inv_r, - float r2, - float *F_invr, - float *E_lj) +void calculate_potential_switch_F_E(const cl_nbparam_params_t *nbparam, + float inv_r, + float r2, + float *F_invr, + float *E_lj) { float r, r_switch; float sw, dsw; @@ -463,17 +463,17 @@ void calculate_lj_ewald_comb_geom_F(__constant const float *nbfp_comb_climg2d, * geometric combination rule. */ gmx_opencl_inline -void calculate_lj_ewald_comb_geom_F_E(__constant const float *nbfp_comb_climg2d, - cl_nbparam_params_t *nbparam, - int typei, - int typej, - float r2, - float inv_r2, - float lje_coeff2, - float lje_coeff6_6, - float int_bit, - float *F_invr, - float *E_lj) +void calculate_lj_ewald_comb_geom_F_E(__constant const float *nbfp_comb_climg2d, + const cl_nbparam_params_t *nbparam, + int typei, + int typej, + float r2, + float inv_r2, + float lje_coeff2, + float lje_coeff6_6, + float int_bit, + float *F_invr, + float *E_lj) { float c6grid, inv_r6_nm, cr2, expmcr2, poly, sh_mask; @@ -499,18 +499,18 @@ void calculate_lj_ewald_comb_geom_F_E(__constant const float *nbfp_comb_climg2d, * of this is pretty small and LB on the CPU is anyway very slow. */ gmx_opencl_inline -void calculate_lj_ewald_comb_LB_F_E(__constant const float *nbfp_comb_climg2d, - cl_nbparam_params_t *nbparam, - int typei, - int typej, - float r2, - float inv_r2, - float lje_coeff2, - float lje_coeff6_6, - float int_bit, - bool with_E_lj, - float *F_invr, - float *E_lj) +void calculate_lj_ewald_comb_LB_F_E(__constant const float *nbfp_comb_climg2d, + const cl_nbparam_params_t *nbparam, + int typei, + int typej, + float r2, + float inv_r2, + float lje_coeff2, + float lje_coeff6_6, + float int_bit, + bool with_E_lj, + float *F_invr, + float *E_lj) { float c6grid, inv_r6_nm, cr2, expmcr2, poly; float sigma, sigma2, epsilon;