Changeset 9010f5f in sasview


Ignore:
Timestamp:
Dec 20, 2016 8:19:28 AM (7 years ago)
Author:
wojciech
Children:
e4fe091
Parents:
e29c798
Message:

Support for more than one platform and one device

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/gpu_options.py

    re29c798 r9010f5f  
    107107            for platform in platforms: 
    108108                d_index = 0 
    109                 for device in platform.get_devices(): 
    110                     combined_index = ":".join([str(p_index),str(d_index)]) \ 
    111                         if len(platforms) > 1 else str(d_index) 
     109                devices = platform.get_devices() 
     110                for device in devices: 
     111                    if len(devices) > 1 and len(platforms) > 1: 
     112                        combined_index = ":".join([str(p_index),str(d_index)]) 
     113                    elif len(platforms) > 1: 
     114                        combined_index = str(p_index) 
     115                    else: 
     116                        combined_index = str(d_index) 
     117                    #combined_index = ":".join([str(p_index),str(d_index)]) \ 
     118                    #    if len(platforms) > 1 else str(d_index) 
    112119                    clinfo.append((combined_index, ":".join([platform.name,device.name]))) 
    113                     d_index+=1 
    114                 p_index+=1 
     120                    d_index += 1 
     121                p_index += 1 
    115122        except ImportError: 
    116123            warnings.warn("pyopencl import failed. Using only CPU computations") 
Note: See TracChangeset for help on using the changeset viewer.