• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ OPS_ACC0函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: initialise_chunk_kernel_celly

// user function
inline void initialise_chunk_kernel_celly(const double *vertexy, double *celly,
                                          double *celldy) {

  double d_y;
  d_y = (grid.ymax - grid.ymin) / (double)grid.y_cells;

  celly[OPS_ACC1(0, 0)] =
      0.5 * (vertexy[OPS_ACC0(0, 0)] + vertexy[OPS_ACC0(0, 1)]);
  celldy[OPS_ACC2(0, 0)] = d_y;
}
开发者ID:gihanmudalige,项目名称:OPS,代码行数:11,代码来源:initialise_chunk_kernel_celly_openacc_kernel_c.c


示例17: drhoudx_kernel

// user function
inline void drhoudx_kernel(const double *rhou_new, double *rho_res) {

  double fnim1 = rhou_new[OPS_ACC0(-1)];
  double fnim2 = rhou_new[OPS_ACC0(-2)];
  double fnip1 = rhou_new[OPS_ACC0(1)];
  double fnip2 = rhou_new[OPS_ACC0(2)];

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


示例18: calvar_kernel

// user function
inline void calvar_kernel(const double *rho_new, const double *rhou_new,
                          const double *rhoE_new, double *workarray2,
                          double *workarray3) {
  double p, rhoi, u;
  rhoi = 1 / rho_new[OPS_ACC0(0)];
  u = rhou_new[OPS_ACC1(0)] * rhoi;
  p = gam1 * (rhoE_new[OPS_ACC2(0)] - 0.5 * rho_new[OPS_ACC0(0)] * u * u);

  workarray2[OPS_ACC3(0)] = p + rhou_new[OPS_ACC1(0)] * u;
  workarray3[OPS_ACC4(0)] = (p + rhoE_new[OPS_ACC2(0)]) * u;
}
开发者ID:gihanmudalige,项目名称:OPS,代码行数:12,代码来源:calvar_kernel_openacc_kernel_c.c


示例19: checkop_kernel

// user function
inline void checkop_kernel(const double *rho_new, const double *x,
                           const double *rhoin, double *pre, double *post,
                           int *num) {
  double diff;
  diff = (rho_new[OPS_ACC0(0)] - rhoin[OPS_ACC2(0)]);
  if (fabs(diff) < 0.01 && x[OPS_ACC1(0)] > -4.1) {
    *post = *post + diff * diff;
    *num = *num + 1;

  } else
    *pre = *pre + (rho_new[OPS_ACC0(0)] - rhol) * (rho_new[OPS_ACC0(0)] - rhol);
}
开发者ID:gihanmudalige,项目名称:OPS,代码行数:13,代码来源:checkop_kernel_seq_kernel.cpp


示例20: advec_mom_kernel_post_pre_advec_y

inline void advec_mom_kernel_post_pre_advec_y( double *node_mass_post, const double *post_vol,
                                  const double *density1, double *node_mass_pre, const double *node_flux) {



  node_mass_post[OPS_ACC0(0,0)] = 0.25 * ( density1[OPS_ACC2(0,-1)] * post_vol[OPS_ACC1(0,-1)] +
                              density1[OPS_ACC2(0,0)]   * post_vol[OPS_ACC1(0,0)]   +
                              density1[OPS_ACC2(-1,-1)] * post_vol[OPS_ACC1(-1,-1)] +
                              density1[OPS_ACC2(-1,0)]  * post_vol[OPS_ACC1(-1,0)]  );

  node_mass_pre[OPS_ACC3(0,0)] = node_mass_post[OPS_ACC0(0,0)] - node_flux[OPS_ACC4(0,-1)] + node_flux[OPS_ACC4(0,0)];

}
开发者ID:satyajammy,项目名称:OPS,代码行数:13,代码来源:advec_mom_kernel_post_pre_advec_y_openacc_kernel_c.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ OPS_ACC2函数代码示例发布时间:2022-05-30
下一篇:
C++ OPSTATUS_TEST_FLAG函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap