Primeiro: sudo apt-get install beignet opencl-headers
Adicione a pasta beignet ao caminho de pesquisa da sua biblioteca:
sudo su
echo "/usr/lib/beignet/" > /etc/ld.so.conf.d/beignet.conf
ldconfig
exit
Obtenha um binário de teste simples:
git clone https://github.com/vpereira/CapsBasic-beignet
Edite o makefile para ficar mais parecido com isto:
all: capsbasic
capsbasic: capsbasic.cpp Makefile
g++ capsbasic.cpp -lcl -ocapsbasic -I/usr/include -L/usr/lib/beignet
clean:
rm -f capsbasic
Lá vai você. OpenCL trabalhando para a família Intel HD de placas de vídeo ...
lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
./capsbasic
Number of available platforms: 1
Platform names:
[0] Experiment Intel Gen OCL Driver [Selected]
Number of devices available for each type:
CL_DEVICE_TYPE_CPU: 0
CL_DEVICE_TYPE_GPU: 1
CL_DEVICE_TYPE_ACCELERATOR: 0
*** Detailed information for each device ***
CL_DEVICE_TYPE_GPU[0]
CL_DEVICE_NAME: Intel HD Graphics Family
CL_DEVICE_AVAILABLE: 1
CL_DEVICE_VENDOR: Intel
CL_DEVICE_PROFILE: FULL_PROFILE
CL_DEVICE_VERSION: OpenCL 1.1
CL_DRIVER_VERSION: 0.2
CL_DEVICE_OPENCL_C_VERSION: OpenCL C 1.1
CL_DEVICE_MAX_COMPUTE_UNITS: 128
CL_DEVICE_MAX_CLOCK_FREQUENCY: 1000
CL_DEVICE_MAX_WORK_GROUP_SIZE: 512
CL_DEVICE_ADDRESS_BITS: 32
CL_DEVICE_MEM_BASE_ADDR_ALIGN: 32
CL_DEVICE_MAX_MEM_ALLOC_SIZE: 134217728
CL_DEVICE_GLOBAL_MEM_SIZE: 4
CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE: 65536
CL_DEVICE_GLOBAL_MEM_CACHE_SIZE: 8192
CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE: 128
CL_DEVICE_LOCAL_MEM_SIZE: 65536
CL_DEVICE_PROFILING_TIMER_RESOLUTION: 80
CL_DEVICE_IMAGE_SUPPORT: 1
CL_DEVICE_ERROR_CORRECTION_SUPPORT: 0
CL_DEVICE_HOST_UNIFIED_MEMORY: 0
CL_DEVICE_EXTENSIONS: cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_fp64 cl_khr_icd cl_khr_gl_sharing
CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT: 16
CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG: 16
CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT: 16
CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE: 0
CL_DEVICE_NATIVE_VECTOR_WIDTH_INT: 16
CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG: 16
CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT: 16
CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE: 16