Révision 144 Ising/GPU/Ising2D-GPU.py
Ising2D-GPU.py (revision 144) | ||
---|---|---|
361 | 361 |
# Primary Device selection based on Device Id |
362 | 362 |
for platform in cl.get_platforms(): |
363 | 363 |
for device in platform.get_devices(): |
364 |
deviceType=cl.device_type.to_string(device.type) |
|
364 |
#deviceType=cl.device_type.to_string(device.type) |
|
365 |
deviceType="xPU" |
|
365 | 366 |
if Id==Device and not HasGPU: |
366 | 367 |
GPU=device |
367 | 368 |
print "CPU/GPU selected: ",device.name |
368 | 369 |
HasGPU=True |
369 | 370 |
Id=Id+1 |
370 |
# Default Device selection based on ALU Type |
|
371 |
for platform in cl.get_platforms(): |
|
372 |
for device in platform.get_devices(): |
|
373 |
deviceType=cl.device_type.to_string(device.type) |
|
374 |
if deviceType=="GPU" and Alu=="GPU" and not HasGPU: |
|
375 |
GPU=device |
|
376 |
print "GPU selected: ",device.name |
|
377 |
HasGPU=True |
|
378 |
if deviceType=="CPU" and Alu=="CPU" and not HasGPU: |
|
379 |
GPU=device |
|
380 |
print "CPU selected: ",device.name |
|
381 |
HasGPU=True |
|
382 | 371 |
|
383 | 372 |
# Je cree le contexte et la queue pour son execution |
384 | 373 |
# ctx = cl.create_some_context() |
... | ... | |
682 | 671 |
Id=1 |
683 | 672 |
for platform in cl.get_platforms(): |
684 | 673 |
for device in platform.get_devices(): |
685 |
deviceType=cl.device_type.to_string(device.type) |
|
674 |
#deviceType=cl.device_type.to_string(device.type) |
|
675 |
deviceType="xPU" |
|
686 | 676 |
print "Device #%i of type %s : %s" % (Id,deviceType,device.name) |
687 | 677 |
Id=Id+1 |
688 | 678 |
|
Formats disponibles : Unified diff