Questions tagged [opencl]

OpenCL (Open Computing Language) is a framework for writing programs that execute across heterogeneous platforms consisting of CPUs, GPUs, and other processors.

This tag refers to the OpenCL (Open Computing Language) by Khronos Group. It is the first open, royalty-free standard for cross-platform, parallel programming of modern processors found in personal computers, servers and handheld/embedded devices. Using OpenCL, one can affect execution of parallel computations greatly improving speed and responsiveness of a wide spectrum of applications: From gaming and entertainment to scientific and medical software.

OpenCL is an API and a C99-like language; for each device, implementations are provider-specific. Some of the OpenCL implementation providers are:

Questions about OpenCL can be asked here along with the vendor/provider and architecture details. Bug reports should be discussed in the respective forums of the vendors NVIDIA Forums, Intel Forums, AMD Forums

Books

5705 questions
17
votes
4 answers

Preprocessor tomfoolery (stringifying a #include)

Note: This question has nothing to do with OpenCL per se... check the last paragraph for a succinct statement of my question. But to provide some background: I'm writing some C++ code that makes use of OpenCL. I like to keep the source for my OpenCL…
Dan
  • 528
  • 2
  • 6
  • 14
17
votes
3 answers

How do JavaCL and JogAmp JOCL compare?

JavaCL uses JNA, JOCL uses JNI instead, so I expect JavaCL to show better cross-platform compatibility, while JOCL should generally turn out to have better performance. JOCL gets tested alongside JOGL2, which should make it easy to use GL objects in…
romeroabelleira
  • 468
  • 7
  • 20
17
votes
5 answers

GPU vs CPU performance for common algorithms

I'm interested to know if any common algorithms (sorting, searching, graphs, etc.) have been ported to OpenCL (or any GPU language), and how the performance compares to the same algorithm executed by the CPU. I'm specifically interested in the…
Chris
  • 3,664
  • 6
  • 34
  • 44
16
votes
3 answers

In OpenCL, what does mem_fence() do, as opposed to barrier()?

Unlike barrier() (which I think I understand), mem_fence() does not affect all items in the work group. The OpenCL spec says (section 6.11.10), for mem_fence(): Orders loads and stores of a work-item executing a kernel. (so it applies to a single…
andrew cooke
  • 45,717
  • 10
  • 93
  • 143
16
votes
5 answers

How to match OpenCL devices with a specific GPU given PCI vendor, device and bus IDs in a multi-GPU system?

I would like to be able to match OpenCL devices with GPUs in the system on multi-GPU systems identified by PCI IDs. For example, if I have a system with multiple GPUs, possibly from different vendors, I can list the devices by enumerating the PCI…
jcoffland
  • 5,238
  • 38
  • 43
16
votes
2 answers

Why does my OpenCL kernel fail on the nVidia driver, but not Intel (possible driver bug)?

I originally wrote an OpenCL program to calculate very large hermitian matrices, where the kernel calculates a single pair of entries in the matrix (the upper triangular portion, and its lower triangular complement). Very early on, I found a very…
stix
  • 1,140
  • 13
  • 36
16
votes
1 answer

Using Python+Theano with OpenCL in an AMD GPU

I'm trying to use Python with Theano to accelerate some code with OpenCL. I installed libgpuarray and pygpu as instructed (I think), and got no errors. The installation detected the OpenCL runtime installed. I just cannot run the Theano example for…
Alejandro Piad
  • 1,827
  • 1
  • 16
  • 23
16
votes
5 answers

OpenCL GPU Audio

There's not much on this subject, perhaps because it isn't a good idea in the first place. I want to create a realtime audio synthesis/processing engine that runs on the GPU. The reason for this is because I will also be using a physics library…
NmdMystery
  • 2,778
  • 3
  • 32
  • 60
16
votes
3 answers

Get GPU memory usage programmatically

I'm looking for a reliable way to determine current GPU memory usage preferably in C++/C . I have found many ways of obtaining usage like the following methods: Direct Draw DxDiag WMI DXGI D3D9 Those methods are not accurate enough (most off by a…
roboto1986
  • 624
  • 2
  • 13
  • 28
16
votes
4 answers

PyOpenCl: how to debug segmentation fault?

I have PyOpenCL code with OpenCL C kernel code. I catch segmentation fault error when I run my app. How to debug such error with some debugger or some other development tool? I don't know what exactly to do to find out the problem. I have in mind…
petRUShka
  • 9,812
  • 12
  • 61
  • 95
16
votes
1 answer

In OpenCL, what is the difference between platform, context, and device?

I am new to OpenCL programming. What is the difference between device, context, and platform?
sandeep.ganage
  • 1,409
  • 2
  • 21
  • 47
16
votes
5 answers

How does the Levenberg–Marquardt algorithm work in detail but in an understandable way?

Im a programmer that wants to learn how the Levenberg–Marquardt curvefitting algorithm works so that i can implement it myself. Is there a good tutorial anywhere that can explain how it works in detail with the reader beeing a programmer and not a…
Per Arneng
  • 2,100
  • 5
  • 21
  • 32
15
votes
2 answers

Number of Compute Units corresponding to the number of work groups

I need some clarification. I'm developing OpenCL on my laptop running a small nvidia GPU (310M). When I query the device for CL_DEVICE_MAX_COMPUTE_UNITS, the result is 2. I read the number of work groups for running a kernel should correspond to the…
rdoubleui
  • 3,554
  • 4
  • 30
  • 51
15
votes
3 answers

How can I test for OpenCL compatibility?

I have a MacBook Pro 13' with an integrated Intel HD 3000 and a i7 core. I have to use Parallel Programming. My teaching advisors couldn't tell me if it would work with my MacBook. Is there a test I could run on my Laptop for testing? + I found…
fragant1996
  • 361
  • 1
  • 2
  • 9
15
votes
2 answers

How To Structure Large OpenCL Kernels?

I have worked with OpenCL on a couple of projects, but have always written the kernel as one (sometimes rather large) function. Now I am working on a more complex project and would like to share functions across several kernels. But the examples I…
andrew cooke
  • 45,717
  • 10
  • 93
  • 143