Changeset 994d77f in sasmodels for sasmodels/gpu.py


Ignore:
Timestamp:
Oct 30, 2014 12:33:53 PM (9 years ago)
Author:
Paul Kienzle <pkienzle@…>
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:
ef2861b
Parents:
d087487b
Message:

Convert double to float rather than using real

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/gpu.py

    rd087487b r994d77f  
    2929from . import gen 
    3030 
    31 F32_DEFS = """\ 
    32 #define REAL(x) (x##f) 
    33 #define real float 
    34 """ 
    35  
    36  
    3731F64_DEFS = """\ 
    3832#ifdef cl_khr_fp64 
    3933#  pragma OPENCL EXTENSION cl_khr_fp64: enable 
    4034#endif 
    41 #define REAL(x) (x) 
    42 #define real double 
    4335""" 
    4436 
     
    116108        raise RuntimeError("Double precision not supported for devices") 
    117109 
    118     header = F64_DEFS if dtype == gen.F64 else F32_DEFS 
     110    header = F64_DEFS if dtype == gen.F64 else "" 
     111    if dtype == gen.F32: 
     112        source = gen.use_single(source) 
    119113    # Note: USE_SINCOS makes the intel cpu slower under opencl 
    120114    if context.devices[0].type == cl.device_type.GPU: 
Note: See TracChangeset for help on using the changeset viewer.