Changeset 92da231 in sasmodels
- Timestamp:
- Nov 24, 2015 4:45:03 PM (9 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 5edfe12
- Parents:
- b514adf
- Location:
- sasmodels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernelcl.py
r0763009 r92da231 22 22 devices, where it can be combined with other structure factors and form 23 23 factors and have instrumental resolution effects applied. 24 25 In order to use OpenCL for your models, you will need OpenCL drivers for 26 your machine. These should be available from your graphics card vendor. 27 Intel provides OpenCL drivers for CPUs as well as their integrated HD 28 graphics chipsets. AMD also provides drivers for Intel CPUs, but as of 29 this writing the performance is lacking compared to the Intel drivers. 30 NVidia combines drivers for CUDA and OpenCL in one package. The result 31 is a bit messy if you have multiple drivers installed. You can see which 32 drivers are available by starting python and running: 33 34 import pyopencl as cl 35 cl.create_some_context(interactive=True) 36 37 Once you have done that, it will show the available drivers which you 38 can select. It will then tell you that you can use these drivers 39 automatically by setting the PYOPENCL_CTX environment variable. 40 41 Some graphics cards have multiple devices on the same card. You cannot 42 yet use both of them concurrently to evaluate models, but you can run 43 the program twice using a different device for each session. 44 45 OpenCL kernels are compiled when needed by the device driver. Some 46 drivers produce compiler output even when there is no error. You 47 can see the output by setting PYOPENCL_COMPILER_OUTPUT=1. It should be 48 harmless, albeit annoying. 24 49 """ 25 50 import os -
sasmodels/kerneldll.py
ra30cdd5 r92da231 1 """1 r""" 2 2 C types wrapper for sasview models. 3 3 … … 5 5 you wish to allow single precision floating point evaluation for the compiled 6 6 models, otherwise it defaults to *False*. 7 8 The compiler command line is stored in the attribute *COMPILE*, with string 9 substitutions for %(source)s and %(output)s indicating what to compile and 10 where to store it. The actual command is system dependent. 11 12 On windows systems, you have a choice of compilers. *MinGW* is the GNU 13 compiler toolchain, available in packages such as anaconda and PythonXY, 14 or available stand alone. This toolchain has had difficulties on some 15 systems, and may or may not work for you. In order to build DLLs, *gcc* 16 must be on your path. If the environment variable *SAS_OPENMP* is given 17 then -fopenmp is added to the compiler flags. This requires a version 18 of MinGW compiled with OpenMP support. 19 20 An alternative toolchain uses the Microsoft Visual C++ compiler, available 21 free from microsoft: 22 23 `http://www.microsoft.com/en-us/download/details.aspx?id=44266`_ 24 25 Again, this requires that the compiler is available on your path. This is 26 done by running vcvarsall.bat in a windows terminal. Install locations are 27 system dependent, such as: 28 29 C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat 30 31 or maybe 32 33 C:\Users\yourname\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat 34 35 And again, the environment variable *SAS_OPENMP* controls whether OpenMP is 36 used to compile the C code. This requires the Microsoft vcomp90.dll library, 37 which doesn't seem to be included with the compiler, nor does there appear 38 to be a public download location. There may be one on your machine already 39 in a location such as: 40 41 C:\Windows\winsxs\x86_microsoft.vc90.openmp*\vcomp90.dll 42 43 If you copy this onto your path, such as the python directory or the install 44 directory for this application, then OpenMP should be supported. 7 45 """ 8 46
Note: See TracChangeset
for help on using the changeset viewer.