Changeset f872fd1 in sasmodels


Ignore:
Timestamp:
Oct 26, 2018 3:04:05 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
153f8f6
Parents:
d42dd4a
Message:

simplify F32/F64 handling

Location:
sasmodels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernelcl.py

    r07646b6 rf872fd1  
    168168    if dtype == F32: 
    169169        return True 
    170     elif dtype == generate.F64: 
     170    elif dtype == F64: 
    171171        return "cl_khr_fp64" in device.extensions 
    172     elif dtype == generate.F16: 
    173         return "cl_khr_fp16" in device.extensions 
    174172    else: 
     173        # Not supporting F16 type since it isn't accurate enough 
    175174        return False 
    176175 
     
    560559        self.q_input = GpuInput(q_vectors, dtype) 
    561560        self._model = model 
    562         self._as_dtype = (np.float32 if dtype == generate.F32 
    563                           else np.float64 if dtype == generate.F64 
    564                           else np.float16 if dtype == generate.F16 
    565                           else np.float32)  # will never get here, so use np.float32 
     561        # F16 isn't sufficient, so don't support it 
     562        self._as_dtype = np.float64 if dtype == generate.F64 else np.float32 
    566563        self._cache_key = unique_id() 
    567564 
  • sasmodels/kernelcuda.py

    r869fd7b rf872fd1  
    433433        self.q_input = GpuInput(q_vectors, dtype) 
    434434        self.kernel = kernel 
    435         self._as_dtype = (np.float32 if dtype == generate.F32 
    436                           else np.float64 if dtype == generate.F64 
    437                           else np.float16 if dtype == generate.F16 
    438                           else np.float32)  # will never get here, so use np.float32 
     435        # F16 isn't sufficient, so don't support it 
     436        self._as_dtype = np.float64 if dtype == generate.F64 else np.float32 
    439437 
    440438        # attributes accessed from the outside 
Note: See TracChangeset for help on using the changeset viewer.