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


C++ array::eval方法代码示例

本文整理汇总了C++中array::eval方法的典型用法代码示例。如果您正苦于以下问题:C++ array::eval方法的具体用法?C++ array::eval怎么用?C++ array::eval使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在array的用法示例。


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

示例1: setUp

 /// Before each run, build a vector of random integers.
 virtual void setUp(int64_t experimentSize)
 {
     experimentSize = experimentSize <= 0 ? 1 : experimentSize;
     try
     {
         deviceGC();
         int depth = 100;
         input_cube = constant(1.0, experimentSize, experimentSize, depth, this->data_type);
         input_cube.eval();
         output = array(depth, this->data_type);
         output.eval();
         af::sync();
     }
     catch (af::exception & e)
     {
         // print out the error, rethrow the error to cause the test to fail.
         std::cout << e << std::endl;
         throw e;
     }
 }
开发者ID:nevion,项目名称:arrayfire-benchmark,代码行数:21,代码来源:gfor.cpp

示例2: array_proxy

    static array::array_proxy gen_indexing(const array &ref, const index &s0, const index &s1, const index &s2, const index &s3, bool linear = false)
    {
        ref.eval();
        af_index_t inds[AF_MAX_DIMS];
        inds[0] = s0.get();
        inds[1] = s1.get();
        inds[2] = s2.get();
        inds[3] = s3.get();

        return array::array_proxy(const_cast<array&>(ref), inds, linear);
    }
开发者ID:FloopCZ,项目名称:arrayfire,代码行数:11,代码来源:array.cpp

示例3: run

 void run(const int iter)
 {
     try {
         for (int i = 0; i < iter; i++) {
             y = a * x + y;
             y.eval();
         }
         af::sync();
     } catch(const af::exception &ex) {
         std::cout << ex.what() << std::endl;
         throw;
     }
 }
开发者ID:Brainiarc7,项目名称:valhalla,代码行数:13,代码来源:saxpy.cpp

示例4:

void Window::plot3(const array& P, const char* const title) {
    af_cell temp{_r, _c, title, AF_COLORMAP_DEFAULT};
    P.eval();
    AF_THROW(af_draw_plot_nd(get(), P.get(), &temp));
}
开发者ID:umar456,项目名称:arrayfire,代码行数:5,代码来源:graphics.cpp


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