Révision 144 Ising/GPU/Ising2D-GPU-One.py

Ising2D-GPU-One.py (revision 144)
184 184
    # Primary Device selection based on Device Id
185 185
    for platform in cl.get_platforms():
186 186
        for device in platform.get_devices():
187
            deviceType=cl.device_type.to_string(device.type)
187
            #deviceType=cl.device_type.to_string(device.type)
188
            deviceType="xPU"
188 189
            if Id==Device and not HasGPU:
189 190
                GPU=device
190 191
                print "CPU/GPU selected: ",device.name
191 192
                HasGPU=True
192 193
            Id=Id+1
193
    # Default Device selection based on ALU Type
194
    for platform in cl.get_platforms():
195
        for device in platform.get_devices():
196
            deviceType=cl.device_type.to_string(device.type)
197
            if deviceType=="GPU" and Alu=="GPU" and not HasGPU:
198
                GPU=device
199
                print "GPU selected: ",device.name
200
                HasGPU=True
201
            if deviceType=="CPU" and Alu=="CPU" and not HasGPU:        
202
                GPU=device
203
                print "CPU selected: ",device.name
204
                HasGPU=True
205 194
            
206 195
    # Je cree le contexte et la queue pour son execution
207 196
    # ctx = cl.create_some_context()
......
383 372
        Id=1
384 373
        for platform in cl.get_platforms():
385 374
            for device in platform.get_devices():
386
                deviceType=cl.device_type.to_string(device.type)
375
                #deviceType=cl.device_type.to_string(device.type)
376
                deviceType="xPU"
387 377
                print "Device #%i of type %s : %s" % (Id,deviceType,device.name)
388 378
                Id=Id+1
389 379

  

Formats disponibles : Unified diff