Pass external parameters as arguments to func_pol and func_unpol
Discussions about deficiencies in libxc with GPGPUs with David Williams-Young suggest that the current way arguments are used within the kernels in libxc as pointers such as p->omega
is suboptimal, since this prevents many compiler optimizations from taking place, since the compiler cannot assume that the variables are constant at every point.
I think the easiest way to fixing this issue is to change the code so that the external parameters are passed by value to the kernel. A minimal change might be to pass the struct
of external parameters as a const
value to the work_*
and func_*
routines. Then, porting the code would be simple, since we would just have to replace p->
with p.
in the Maple kernels. We can then also remove the pointer allocations and casts from the machine generated Maple code altogether, since the type of the struct will be known already.