OpenCL C is a programming language based on C99 that is used for writing kernel code to be used in OpenCL.
Questions tagged [opencl-c]
88 questions
0
votes
1 answer
Static variable in OpenCL C
I'm writing a renderer from scratch using openCL and I have a little compilation problem on my kernel with the error :
CL_BUILD_PROGRAM : error: program scope variable must reside in constant address space static float* objects;
The problem is that…

Matt
- 15
- 3
0
votes
1 answer
OpenCL (in-kernel) callable SVD kernel code?
I'm studying how to offload some quite heavy calculations on GPUs.
Although on my machine I have a NVIDIA RTX GPU, I would like to avoid using
CUDA in order to develop something portable on other GPUs as well (at least in its core).
Thus the choice…

mEm
- 353
- 3
- 12
0
votes
1 answer
why doesn't the OpenCL kernel execute even though there are no errors? (c, nvidia, kubuntu)
I'm learning opencl and for some reason the kernel does nothing:
#include
#include
#define CL_TARGET_OPENCL_VERSION 300
#include
int err = 0;
#define PRINTERR() fprintf(stderr, "Error at line %u.\n",…

Meh
- 33
- 6
0
votes
1 answer
OpenCL: Can you have a `const __global` type or just `__global`?
I am looking at a piece of OpenCL code. Currently we do a typedef:
"#if __OPENCL_VERSION__ <= 120\n"
"#define " + dataName + "_type __constant\n"
"#else \n"
"#define " + dataName + "_type const __global\n"
Does const __global…

madtowneast
- 2,350
- 3
- 22
- 31
0
votes
1 answer
Access components of vector data type (e.g. int4) as array of scalars in OpenCL
I have kernel which evaluate interaction between all pairs of neighbors of an atoms. Each atom has max. 4 neighbors so I store their indexes in int4. But in order to loop over these neighbors I need to access them by index (neighs[0] rather than…

Prokop Hapala
- 2,424
- 2
- 30
- 59
0
votes
0 answers
Multithreaded union-find algorithm not working properly
I am trying to implement a multithreaded Union-Find algorithm as outlined in this paper (https://citeseerx.ist.psu.edu/viewdoc/download?oi=10.1.1.56.8354&rep=rep1&type=pdf).
Using this, I am trying to find out the number of connected components in…

Sayan Barrie Mccullum
- 115
- 5
0
votes
1 answer
using array of struct inside opencl kernel
I'm trying to define a global array of structs inside opencl kernel.
I get some data from the host, and trying to assign it to that structure, but when I print the result structure, I get a lot of racing values when I printf the values.
The struct…

andre_lamothe
- 2,171
- 2
- 41
- 74
0
votes
1 answer
OpenCL shared memory reduction correctness
While playing with OpenCL, I encountered a bug that I can't explain. Below is a reduction algorithm simply adapted to GPU like accelerators. You can see two versions of the reduction algorithm. V0 uses shared memory. V1 uses the work_group_reduce_<>…

Etienne M
- 604
- 3
- 11
0
votes
0 answers
Non deterministic behavior of native_ functions in OpenCL kernel
TL;DR: Using native_log2() produces non deterministic behavior in OpenCL kernel, while using log2() produces deterministic behavior. Why is this happening?
So I have this function below acting as a helper function for an OpenCL kernel, and I was…

Iago Storch
- 58
- 5
0
votes
2 answers
OpenCL FPGA: Kernel Execution of 2 copies of same kernel is not being made in parallel. In addition to that, there is also idle time in between them
My goal is to complete FFTs of 2 - 4K Data points together. Hence, I made 2 kernel objects from the same kernel and Enqueued the tasks at once, i.e. without any Buffer Read-Write or any callbacks in between. I find out that it doesn't happen that…

Raghuttam Hombal
- 1
- 2
0
votes
2 answers
Can I make HTTP requests using OpenCL in C#?
Can I make HTTP requests using OpenCL in C#? I tryed to do this calling system("curl website.com") but only getting an error about system implicit calling.

Anna Boyko
- 25
- 5
0
votes
1 answer
Opencl clGetDeviceIDs(platform, CL_DEVICE_TYPE_CPU, 0, NULL, &num_devices) returning -1
I'm using Intel OpenCL SDK. Last month, when I tried to run my opencl code on CPU present in my system , by clGetDeviceIDs(platform, CL_DEVICE_TYPE_CPU, 0, NULL, &num_devices), it worked..and number of total platforms its detected is 2.One is Intel…

Waseema Risaana
- 31
- 2
0
votes
1 answer
OpenCL C++ HelloWorld
Good afternoon!
I am learning OpenCL C++ in this tutorial: Click (it's not necessary)
The video uses CL API version 1.2, so I downloaded the OpenCL 1.2 headers from the link in this reply: https://stackoverflow.com/a/57017982/11968932
Visual Studio…

maxet24
- 111
- 1
- 10
0
votes
1 answer
CL/cl.hpp: No such file or directory | NVIDIA GeForce
Good afternoon!
I'm trying to run code in C++ that has the following line:
#include
But launching the program gives this error:
fatal error: CL/cl.hpp: No such file or directory
What have I tried to do?
Completely reinstalling…

maxet24
- 111
- 1
- 10
0
votes
1 answer
Retrieving number of opencl kernel programs that end with a certain result
My Goal is to get a number of kernels, where it's calculation satisfies a condition. The condition could be value == 0.
I tried to find some built-in semaphore function to accomplish this, but I couldn't find any for OpenCL. I do not want to blit…

The A
- 188
- 1
- 9