strutture:cnaf:cnaf_rd:infrastruttura:utilizzo_cluster:opencl
Differences
This shows you the differences between two versions of the page.
strutture:cnaf:cnaf_rd:infrastruttura:utilizzo_cluster:opencl [2013/10/31 08:53] – created caberletti@infn.it | strutture:cnaf:cnaf_rd:infrastruttura:utilizzo_cluster:opencl [2013/10/31 09:25] (current) – caberletti@infn.it | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== OpenCL ====== | ||
+ | Le librerie OpenCL (Open Computing Language) possono essere utilizzate con gli acceleratori, | ||
+ | Nell' | ||
+ | * Intel OpenCL | ||
+ | * NVIDIA CUDA OpenCL | ||
+ | |||
+ | A seconda del device che si intende utilizzare, occorre caricare il modulo corrispondente. | ||
+ | Quindi, prima di utilizzare OpenCL con le GPU: | ||
+ | <code bash> | ||
+ | $ module load cuda-5.5 | ||
+ | </ | ||
+ | |||
+ | Prima di usare OpenCL con gli Xeon Phi: | ||
+ | <code bash> | ||
+ | $ module load ips-xe-2013 intel-opencl | ||
+ | </ | ||
+ | |||
+ | ===== Esempi ===== | ||
+ | |||
+ | Per testare il funzionamento di OpenCL si possono utilizzare alcune semplici programmi test. Uno di questi è GEMM. | ||
+ | |||
+ | <code bash> | ||
+ | $ module load profile | ||
+ | $ cd $SCRATCH | ||
+ | $ wget http:// | ||
+ | $ tar xzf gemm-sample.tar.gz | ||
+ | $ cd GEMM | ||
+ | </ | ||
+ | |||
+ | Per compilare ed eseguire il sample su piattaforma Intel: | ||
+ | <code bash> | ||
+ | $ module load ips-xe-2013 intel-opencl | ||
+ | $ make | ||
+ | $ ./gemm | ||
+ | </ | ||
+ | |||
+ | Il sample troverà quindi due tipi di device compatibili: | ||
+ | <code bash> | ||
+ | $ ./gemm -d 0 | ||
+ | $ ./gemm -d 1 | ||
+ | </ | ||
+ | |||
+ | Per compilare il sample per le GPU NVIDIA: | ||
+ | <code bash> | ||
+ | $ module load cuda-5.5 | ||
+ | $ make | ||
+ | $ ./gemm | ||
+ | </ |