Bug 93375 - unsupported call to function erf when running GROMACS with OpenCL
Summary: unsupported call to function erf when running GROMACS with OpenCL
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: All All
: medium major
Assignee: Vedran Miletić
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-14 19:13 UTC by Vedran Miletić
Modified: 2017-01-25 19:44 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
GMX comment out atomics (1.17 KB, text/plain)
2015-12-14 19:13 UTC, Vedran Miletić
Details

Description Vedran Miletić 2015-12-14 19:13:27 UTC
Created attachment 120502 [details]
GMX comment out atomics

I'm running GROMACS [1] compiled with OpenCL support enabled and the attached patch applied. Running gives the following error:

Compilation of source file failed! 
-- Used build options: -DWARP_SIZE_TEST=64 -D_AMD_SOURCE_ -DGMX_OCL_FASTGEN_ADD_TWINCUT -DEL_EWALD_ANA -DEELNAME=_ElecEw -DVDWNAME=_VdwLJ -DCENTRAL=22 -DNBNXN_GPU_NCLUSTER_PER_SUPERCLUSTER=8 -DNBNXN_GPU_CLUSTER_SIZE=8 -DNBNXN_GPU_JGROUP_SIZE=4 -DNBNXN_AVOID_SING_R2_INC=1.0e-12f -I"/usr/local/gromacs/share/gromacs/opencl" 
--------------LOG START---------------
unsupported call to function erf in nbnxn_kernel_ElecEw_VdwLJ_VF_opencl---------------LOG END----------------

[1] http://www.gromacs.org/
Comment 1 Aaron Watry 2015-12-14 22:55:54 UTC
Looks like libclc does not yet implement the erf function.

erfc is implemented, but not plain erf.

The amd-builtins branch in libclc looks like there's an erf implementation that can be ported over:
https://llvm.org/svn/llvm-project/libclc/branches/amd-builtins/amd-builtins/math32/erfF.cl

The double implementation will need to be ported as well.

Note that it looks like the AMD implementation of erf requires doubles if subnormals are NOT supported... If that's an issue for someone, we'll need a workaround for that.
Comment 2 Vedran Miletić 2015-12-14 23:12:46 UTC
(In reply to Aaron Watry from comment #1)
> Looks like libclc does not yet implement the erf function.

Neat, the approach you suggest seems to be simpler than the one I had in mind, analogous to ldexp http://reviews.llvm.org/D14990

> Note that it looks like the AMD implementation of erf requires doubles if
> subnormals are NOT supported... If that's an issue for someone, we'll need a
> workaround for that.

erff() from GROMACS works without doubles: https://github.com/gromacs/gromacs/blob/fab0108c88e441d891d838bb81ca879ff9708317/src/gromacs/math/utilities.cpp

Not sure if it's usable in this form, I would have to look.
Comment 3 Vedran Miletić 2017-01-25 19:44:18 UTC
Fixed: http://lists.llvm.org/pipermail/libclc-dev/2016-May/002188.html


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.