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
14
votes
1 answer

Unresolved extern when compiling OpenCL to PTX using Clang?

I'm following the instructions on this SO answer but when I try to run the resulting PTX file I get the follow error in clBuild ptxas fatal : Unresolved extern function 'get_group_id' In the PTX file I have the following for every OpenCL function…
Andrew
  • 2,519
  • 6
  • 29
  • 46
14
votes
4 answers

Custom types in OpenCL kernel

Is it possible to use custom types in OpenCL kernel like gmp types (mpz_t, mpq_t, …) ? To have something like this (this kernel doesn't build just because of #include ) : #include __kernel square( __global mpz_t* input, …
Studer
  • 611
  • 2
  • 8
  • 21
14
votes
2 answers

Compile OpenCL on Mingw Nvidia SDK

Is it possible to compile OpenCL using Mingw and Nvidia SDK? I'm aware that its not officially supported but that just doesn't make sense. Aren't the libraries provided as a statically linked libraries? I mean once compiled with whatever compiler…
omarzouk
  • 933
  • 10
  • 23
14
votes
3 answers

Is there a good openCL wrapper for Ruby?

I am aware of: https://github.com/lsegal/barracuda Which hasn't been updated since 01/11 And http://rubyforge.org/projects/ruby-opencl/ Which hasn't been updated since 03/10. Are these projects dead? Or have they simply not changed because their…
Abraham P
  • 15,029
  • 13
  • 58
  • 126
14
votes
3 answers

How to set up Xcode to run OpenCL code, and how to verify the kernels before building

I am looking at the official documentation on the Apple site, and I see that there is a quickstart about how to use OpenCL on Xcode. Maybe it is just me, but I had no luck building the code that is mentioned on the "hello world OCL" section. I've…
user393267
14
votes
1 answer

Calculate eigenvalues/eigenvectors of hundreds of small matrices using CUDA

I have a question on the eigen-decomposition of hundreds of small matrices using CUDA. I need to calculate the eigenvalues and eigenvectors of hundreds (e.g. 500) of small (64-by-64) real symmetric matrices concurrently. I tried to implement it by…
Yifei Huang
  • 141
  • 1
  • 3
13
votes
4 answers

Is private memory slower than local memory?

I was working on a kernel which had much global memory access per thread so I copied them to local memory which gave a speed up of 40%. I wanted still more speed up so copied from local to private which degraded the performance So is it correct that…
Megharaj
  • 1,589
  • 2
  • 20
  • 32
13
votes
1 answer

OpenCL CPU Device vs GPU Device

Consider a simple example: vector addition. If I build a program for CL_DEVICE_TYPE_GPU, and I build the same program for CL_DEVICE_TYPE_CPU, what is the difference between them(except that "CPU program" is running on CPU, and "GPU program" is…
K0n57an71n
  • 367
  • 1
  • 4
  • 11
13
votes
3 answers

How to use clang to compile OpenCL to ptx code?

Clang 3.0 is able to compile OpenCL to ptx and use Nvidia's tool to launch the ptx code on GPU. How can I do this? Please be specific.
dalibocai
  • 2,289
  • 5
  • 29
  • 45
13
votes
3 answers

Calling OpenCL kernel from another OpenCL kernel

I have seen in one post here that we can call a function from an OpenCL kernel. But in my situation, I need that complex function to be parallelized (run by all available threads) as well, so do I have to make that function a kernel too and call it…
Akhtar Ali
  • 269
  • 2
  • 4
  • 8
13
votes
6 answers

How to use C++ templates in OpenCL kernels?

I'm a novice in OpenCL. I have an algorithm which uses templates. It worked well with OpenMP parallelization but now the amount of data has grown and the only way to process it is to rewrite it to use OpenCL. I can easily use MPI to build it for…
flashnik
  • 1,900
  • 4
  • 19
  • 38
13
votes
2 answers

Is it possible to emulate a GPU for CUDA/OpenCL unit testing purposes?

I would like to develop a library with an algorithm that can run on the CPU or the GPU. The GPU can be Nvidia (then the algorithm will use CUDA) or not (then the algorithm will use OpenCL). I would like to emulate a GPU in this project because…
Rob
  • 1,080
  • 2
  • 10
  • 24
13
votes
2 answers

static openCL class not properly released in python module using boost.python

EDIT: Ok, all the edits made the layout of the question a bit confusing so I will try to rewrite the question (not changing the content, but improving its structure). The issue in short I have an openCL program that works fine, if I compile it as an…
NOhs
  • 2,780
  • 3
  • 25
  • 59
13
votes
3 answers

Does Global Work Size Need to be Multiple of Work Group Size in OpenCL?

Hello: Does Global Work Size (Dimensions) Need to be Multiple of Work Group Size (Dimensions) in OpenCL? If so, is there a standard way of handling matrices not a multiple of the work group dimensions? I can think of two possibilities: Dynamically…
Junier
  • 1,622
  • 1
  • 15
  • 21
13
votes
5 answers

How to read UMat from a file in opencv 3.0 Beta?

I want to use UMat so my code can be run on both GPU and CPU using OpenCL (OpenCV 3.0.0 Beta). but I can not find a way to read an image file into a UMat or convert a Mat to UMat. How can I read an image into a UMat?
mans
  • 17,104
  • 45
  • 172
  • 321