[pyfr] 33/88: Check for double precision support in the OpenCL backend.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Nov 16 12:05:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository pyfr.

commit 18ed6c48cba17d4af78f54fc2f800b38d022f86f
Author: Freddie Witherden <freddie at witherden.org>
Date:   Sun May 8 14:03:20 2016 -0700

    Check for double precision support in the OpenCL backend.
    
    An error will now be raised if attempting to run a double precision
    simulation on a device which does not support double precision
    arithmetic.
---
 pyfr/backends/opencl/base.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pyfr/backends/opencl/base.py b/pyfr/backends/opencl/base.py
index ec4f20d..7499baa 100644
--- a/pyfr/backends/opencl/base.py
+++ b/pyfr/backends/opencl/base.py
@@ -41,6 +41,10 @@ class OpenCLBackend(BaseBackend):
         else:
             raise ValueError('No suitable OpenCL device found')
 
+        # Determine if the device supports double precision arithmetic
+        if self.fpdtype == np.float64 and not device.double_fp_config:
+            raise ValueError('Device does not support double precision')
+
         # Create a OpenCL context on this device
         self.ctx = cl.Context([device])
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pyfr.git



More information about the debian-science-commits mailing list