当前位置: 首页>>代码示例>>C++>>正文


C++ OPS_ACC0函数代码示例

本文整理汇总了C++中OPS_ACC0函数的典型用法代码示例。如果您正苦于以下问题:C++ OPS_ACC0函数的具体用法?C++ OPS_ACC0怎么用?C++ OPS_ACC0使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了OPS_ACC0函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: update_halo_kernel2_yvel_plus_2_left

// user function
inline void update_halo_kernel2_yvel_plus_2_left(double *yvel0, double *yvel1,
                                                 const int *fields) {
  if (fields[FIELD_YVEL0] == 1)
    yvel0[OPS_ACC0(0, 0, 0)] = yvel0[OPS_ACC0(2, 0, 0)];
  if (fields[FIELD_YVEL1] == 1)
    yvel1[OPS_ACC1(0, 0, 0)] = yvel1[OPS_ACC1(2, 0, 0)];
}
开发者ID:gihanmudalige,项目名称:OPS,代码行数:8,代码来源:update_halo_kernel2_yvel_plus_2_left_seq_kernel.cpp

示例2: update_halo_kernel2_zvel_plus_2_bot

inline void update_halo_kernel2_zvel_plus_2_bot(double *zvel0, double *zvel1,
                                                const int *fields) {
  if (fields[FIELD_ZVEL0] == 1)
    zvel0[OPS_ACC0(0, 0, 0)] = zvel0[OPS_ACC0(0, 2, 0)];
  if (fields[FIELD_ZVEL1] == 1)
    zvel1[OPS_ACC1(0, 0, 0)] = zvel1[OPS_ACC1(0, 2, 0)];
}
开发者ID:gihanmudalige,项目名称:OPS,代码行数:7,代码来源:update_halo_kernel2_zvel_plus_2_bot_openacc_kernel_c.c

示例3: drhouupdx_kernel

// user function
inline void drhouupdx_kernel(const double *rhou_new, const double *rho_new,
                             const double *rhoE_new, double *rhou_res) {

  double fni =
      rhou_new[OPS_ACC0(0)] * rhou_new[OPS_ACC0(0)] / rho_new[OPS_ACC1(0)];
  double p = gam1 * (rhoE_new[OPS_ACC2(0)] - 0.5 * fni);
  fni = fni + p;
  double fnim1 =
      rhou_new[OPS_ACC0(-1)] * rhou_new[OPS_ACC0(-1)] / rho_new[OPS_ACC1(-1)];
  p = gam1 * (rhoE_new[OPS_ACC2(-1)] - 0.5 * fnim1);
  fnim1 = fnim1 + p;
  double fnim2 =
      rhou_new[OPS_ACC0(-2)] * rhou_new[OPS_ACC0(-2)] / rho_new[OPS_ACC1(-2)];
  p = gam1 * (rhoE_new[OPS_ACC2(-2)] - 0.5 * fnim2);
  fnim2 = fnim2 + p;
  double fnip1 =
      rhou_new[OPS_ACC0(1)] * rhou_new[OPS_ACC0(1)] / rho_new[OPS_ACC1(1)];
  p = gam1 * (rhoE_new[OPS_ACC2(1)] - 0.5 * fnip1);
  fnip1 = fnip1 + p;
  double fnip2 =
      rhou_new[OPS_ACC0(2)] * rhou_new[OPS_ACC0(2)] / rho_new[OPS_ACC1(2)];
  p = gam1 * (rhoE_new[OPS_ACC2(2)] - 0.5 * fnip2);
  fnip2 = fnip2 + p;

  double deriv = (fnim2 - fnip2 + 8.0 * (fnip1 - fnim1)) / (12.00 * dx);
  rhou_res[OPS_ACC3(0)] = deriv;
}
开发者ID:gihanmudalige,项目名称:OPS,代码行数:28,代码来源:drhouupdx_kernel_openacc_kernel_c.c

示例4: update_halo_kernel2_yvel_minus_4_a

inline void update_halo_kernel2_yvel_minus_4_a(double *yvel0, double *yvel1,
                                               const int *fields) {
  if (fields[FIELD_YVEL0] == 1)
    yvel0[OPS_ACC0(0, 0)] = -yvel0[OPS_ACC0(0, 4)];
  if (fields[FIELD_YVEL1] == 1)
    yvel1[OPS_ACC1(0, 0)] = -yvel1[OPS_ACC1(0, 4)];
}
开发者ID:gihanmudalige,项目名称:OPS,代码行数:7,代码来源:update_halo_kernel2_yvel_minus_4_a_openacc_kernel_c.c

示例5: update_halo_kernel2_zvel_minus_4_back

// user function
inline void update_halo_kernel2_zvel_minus_4_back(double *zvel0, double *zvel1,
                                                  const int *fields) {
  if (fields[FIELD_ZVEL0] == 1)
    zvel0[OPS_ACC0(0, 0, 0)] = -zvel0[OPS_ACC0(0, 0, 4)];
  if (fields[FIELD_ZVEL1] == 1)
    zvel1[OPS_ACC1(0, 0, 0)] = -zvel1[OPS_ACC1(0, 0, 4)];
}
开发者ID:gihanmudalige,项目名称:OPS,代码行数:8,代码来源:update_halo_kernel2_zvel_minus_4_back_seq_kernel.cpp

示例6: init_kernel

//user function
inline 
void init_kernel(double *val, int *idx){
  if(idx[0]==0 || idx[0]==nx-1 || idx[1]==0 || idx[1]==ny-1 || idx[2]==0 || idx[2]==nz-1)
    val[OPS_ACC0(0,0,0)] = 1.0;
  else
    val[OPS_ACC0(0,0,0)] = 0.0;
}
开发者ID:gihanmudalige,项目名称:OPS,代码行数:8,代码来源:init_kernel_omp_kernel.cpp

示例7: update_halo_kernel2_xvel_plus_2_top

inline void update_halo_kernel2_xvel_plus_2_top(double *xvel0, double *xvel1,
                                                const int *fields) {
  if (fields[FIELD_XVEL0] == 1)
    xvel0[OPS_ACC0(0, 0, 0)] = xvel0[OPS_ACC0(0, -2, 0)];
  if (fields[FIELD_XVEL1] == 1)
    xvel1[OPS_ACC1(0, 0, 0)] = xvel1[OPS_ACC1(0, -2, 0)];
}
开发者ID:gihanmudalige,项目名称:OPS,代码行数:7,代码来源:update_halo_kernel2_xvel_plus_2_top_openacc_kernel_c.c

示例8: update_halo_kernel2_xvel_minus_4_b

inline void update_halo_kernel2_xvel_minus_4_b(double *xvel0, double *xvel1,
                                               const int *fields) {
  if (fields[FIELD_XVEL0] == 1)
    xvel0[OPS_ACC0(0, 0)] = -xvel0[OPS_ACC0(-4, 0)];
  if (fields[FIELD_XVEL1] == 1)
    xvel1[OPS_ACC1(0, 0)] = -xvel1[OPS_ACC1(-4, 0)];
}
开发者ID:gihanmudalige,项目名称:OPS,代码行数:7,代码来源:update_halo_kernel2_xvel_minus_4_b_openacc_kernel_c.c

示例9: update_halo_kernel3_plus_4_a

// user function
inline void update_halo_kernel3_plus_4_a(double *vol_flux_x,
                                         double *mass_flux_x,
                                         const int *fields) {
  if (fields[FIELD_VOL_FLUX_X] == 1)
    vol_flux_x[OPS_ACC0(0, 0)] = vol_flux_x[OPS_ACC0(0, 4)];
  if (fields[FIELD_MASS_FLUX_X] == 1)
    mass_flux_x[OPS_ACC1(0, 0)] = mass_flux_x[OPS_ACC1(0, 4)];
}
开发者ID:gihanmudalige,项目名称:OPS,代码行数:9,代码来源:update_halo_kernel3_plus_4_a_seq_kernel.cpp

示例10: update_halo_kernel4_plus_2_b

inline void update_halo_kernel4_plus_2_b(double *vol_flux_y,
                                         double *mass_flux_y,
                                         const int *fields) {
  if (fields[FIELD_VOL_FLUX_Y] == 1)
    vol_flux_y[OPS_ACC0(0, 0, 0)] = vol_flux_y[OPS_ACC0(-2, 0, 0)];
  if (fields[FIELD_MASS_FLUX_Y] == 1)
    mass_flux_y[OPS_ACC1(0, 0, 0)] = mass_flux_y[OPS_ACC1(-2, 0, 0)];
}
开发者ID:gihanmudalige,项目名称:OPS,代码行数:8,代码来源:update_halo_kernel4_plus_2_b_omp_kernel.cpp

示例11: update_halo_kernel3_minus_4_a

// user function
inline void update_halo_kernel3_minus_4_a(double *vol_flux_x,
                                          double *mass_flux_x,
                                          const int *fields) {
  if (fields[FIELD_VOL_FLUX_X] == 1)
    vol_flux_x[OPS_ACC0(0, 0, 0)] = -(vol_flux_x[OPS_ACC0(4, 0, 0)]);
  if (fields[FIELD_MASS_FLUX_X] == 1)
    mass_flux_x[OPS_ACC1(0, 0, 0)] = -(mass_flux_x[OPS_ACC1(4, 0, 0)]);
}
开发者ID:gihanmudalige,项目名称:OPS,代码行数:9,代码来源:update_halo_kernel3_minus_4_a_seq_kernel.cpp

示例12: update_halo_kernel5_plus_4_left

// user function
inline void update_halo_kernel5_plus_4_left(double *vol_flux_z,
                                            double *mass_flux_z,
                                            const int *fields) {
  if (fields[FIELD_VOL_FLUX_Z] == 1)
    vol_flux_z[OPS_ACC0(0, 0, 0)] = (vol_flux_z[OPS_ACC0(4, 0, 0)]);
  if (fields[FIELD_MASS_FLUX_Z] == 1)
    mass_flux_z[OPS_ACC1(0, 0, 0)] = (mass_flux_z[OPS_ACC1(4, 0, 0)]);
}
开发者ID:gihanmudalige,项目名称:OPS,代码行数:9,代码来源:update_halo_kernel5_plus_4_left_seq_kernel.cpp

示例13: update_halo_kernel4_minus_2_a

inline void update_halo_kernel4_minus_2_a(double *vol_flux_y,
                                          double *mass_flux_y,
                                          const int *fields) {
  if (fields[FIELD_VOL_FLUX_Y] == 1)
    vol_flux_y[OPS_ACC0(0, 0)] = -(vol_flux_y[OPS_ACC0(0, 2)]);
  if (fields[FIELD_MASS_FLUX_Y] == 1)
    mass_flux_y[OPS_ACC1(0, 0)] = -(mass_flux_y[OPS_ACC1(0, 2)]);
}
开发者ID:gihanmudalige,项目名称:OPS,代码行数:8,代码来源:update_halo_kernel4_minus_2_a_omp_kernel.cpp

示例14: update_halo_kernel5_minus_2_back

inline void update_halo_kernel5_minus_2_back(double *vol_flux_z,
                                             double *mass_flux_z,
                                             const int *fields) {
  if (fields[FIELD_VOL_FLUX_Z] == 1)
    vol_flux_z[OPS_ACC0(0, 0, 0)] = -vol_flux_z[OPS_ACC0(0, 0, 2)];
  if (fields[FIELD_MASS_FLUX_Z] == 1)
    mass_flux_z[OPS_ACC1(0, 0, 0)] = -mass_flux_z[OPS_ACC1(0, 0, 2)];
}
开发者ID:gihanmudalige,项目名称:OPS,代码行数:8,代码来源:update_halo_kernel5_minus_2_back_openacc_kernel_c.c

示例15: advec_mom_kernel2_x

// user function
inline void advec_mom_kernel2_x(double *vel1, const double *node_mass_post,
                                const double *node_mass_pre,
                                const double *mom_flux) {

  vel1[OPS_ACC0(0, 0, 0)] =
      (vel1[OPS_ACC0(0, 0, 0)] * node_mass_pre[OPS_ACC2(0, 0, 0)] +
       mom_flux[OPS_ACC3(-1, 0, 0)] - mom_flux[OPS_ACC3(0, 0, 0)]) /
      node_mass_post[OPS_ACC1(0, 0, 0)];
}
开发者ID:gihanmudalige,项目名称:OPS,代码行数:10,代码来源:advec_mom_kernel2_x_seq_kernel.cpp


注:本文中的OPS_ACC0函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。