Getting started on GPU programming (opencl)

  • #1
fluidistic
Gold Member
3,655
101

Main Question or Discussion Point

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.
 

Answers and Replies

  • #2
FactChecker
Science Advisor
Gold Member
5,382
1,951
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.
 
  • #3
fluidistic
Gold Member
3,655
101
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.
 
  • #4
D H
Staff Emeritus
Science Advisor
Insights Author
15,393
683
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.
 

Related Threads on Getting started on GPU programming (opencl)

  • Last Post
Replies
13
Views
4K
  • Last Post
Replies
4
Views
701
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
2
Views
3K
  • Last Post
Replies
3
Views
3K
  • Last Post
Replies
6
Views
5K
Replies
1
Views
2K
Replies
21
Views
5K
Replies
3
Views
622
Top