Running non-ArBB code inside call()

Running non-ArBB code inside call()

Hi,

I'm playing with ArBB and try to figure out how iterative solvers fit into ArBB model. CG works fine as expected and now I want to insert Gauss-Seidel preconditioner inside CG loop, which is obviously not vectorizable.

I figured out I can probably use bind() and read_write_range() to do Gauss-Seidel on an array outside ArBB, which I want to try tomorrow. However, I doubt this will work because call() should not recognize but drop my C operations. This leaves me with the solution of refining my code and inserting GS between call()s. Maybe, there is some uncall(fun)(arg1,arg2) function which remembers fun function pointer and runs fun(arg1,arg2) in place without ArBB machinery?

3 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

If I understand it correctly, you want to call a regular C function from within an Intel ArBB function. This is not supported in the current release. One way you can simulate this is to first invoke the GS preconditioner routine (which I suppose is C/C++ code) outside an Intel ArBB function. Then, copy the results into Intel ArBB containers using either the bind() interface or the read_write_range() interface. Then, invoke the Intel ArBB function using the 'call' operator. It is incovenient if you want to do this inside your CG loop, because you may have to go back and forth between the C/C++ space and the Intel ArBB space many times. But it is worth trying and we'd like to know your observations. In future releases of Intel ArBB there wil be a convenient way of calling foreigh functions from inside Intel ArBB code.

Thanks,
Zhang

Since you said the "Gauss-Seidel" keyword, I would like to point
you to one of our tutorials which is walking you through a heat diffusion example. Maybe it is relatively straight-forward to turn this into a Gauss-Seidel solver (Red-Black), or to get inspired using a stencil operation. In general, everything expressed in ArBB is intended to utilize instruction set extensions such as SIMD vectorization and threaded execution.

发表评论

登录添加评论。还不是成员?立即加入