Getting started on GPU programming (opencl)

  • Thread starter Thread starter fluidistic
  • Start date Start date
  • Tags Tags
    Gpu Programming
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 2K views
fluidistic
Gold Member
Messages
3,934
Reaction score
286
I'd like to know how to get started to write a program for the GPU. Say I want to let the GPU calculate 4*2.
I have an intel integrated HD4000 graphics card so I'd be better to use opencl I believe.
I'm not really finding any tutorial on how to do this. Any help or comment is welcome.
 
Physics news on Phys.org
fluidistic said:
I'd like to know how to get started to write a program for the GPU. Say I want to let the GPU calculate 4*2.
I have an intel integrated HD4000 graphics card so I'd be better to use opencl I believe.
I'm not really finding any tutorial on how to do this. Any help or comment is welcome.
Do you have the opencl SDK for the Intel HD4000? If so, have you looked at the information in https://software.intel.com/en-us/intel-opencl ?

PS. I am not familiar with it, so I can't say for sure that the information there will answer your questions. But it may let you focus in on more specific issues.
 
  • Like
Likes   Reactions: fluidistic
FactChecker said:
Do you have the opencl SDK for the Intel HD4000? If so, have you looked at the information in https://software.intel.com/en-us/intel-opencl ?

PS. I am not familiar with it, so I can't say for sure that the information there will answer your questions. But it may let you focus in on more specific issues.
Thanks, I wasn't aware I'd need specific packages. I use arch linux so I'm reading https://wiki.archlinux.org/index.php/GPGPU.
Apparently I need the AUR package intel-opencl-runtime to execute code and [URL='https://www.archlinux.org/packages/?name=ocl-icd']ocl-icd, as well as [URL='https://www.archlinux.org/packages/?name=opencl-headers']opencl-headers.[/URL]
[URL='https://www.archlinux.org/packages/?name=ocl-icd']
I also see a Python language binding package called python-pyopencl.
Programming in python would be nice, to say the least.
 
  • Like
Likes   Reactions: FactChecker
fluidistic said:
I also see a Python language binding package called python-pyopencl.
Programming in python would be nice, to say the least.
Python is not the first thing I would think of in this context. Python is so slow, and PyOpenCL is a very thin wrapper on top of the very verbose and rather hard to use OpenCL framework. You'll get all of the pain of OpenCL and all of the slowness of Python.

If you're willing to work in C++ (or better, C++11), there are a lot of options. Three of them, in alphabetical order, are ArrayFire, Boost.Compute, and VexCL. I'm sure there are others.
 
  • Like
Likes   Reactions: fluidistic, QuantumQuest, jim mcnamara and 1 other person