Questions tagged [opencl-c]

OpenCL C is a programming language based on C99 that is used for writing kernel code to be used in OpenCL.

88 questions
1
vote
1 answer

Optimizing an OpenCL Kernel

I'm trying to optimize the following Kernel using OpenCL. Basically I'm doing triangle rasterization using a frame buffer of 800*800 pixels, and checking the bounding box of each triangle and if the current pixel that is scanned line is inside the…
andre_lamothe
  • 2,171
  • 2
  • 41
  • 74
1
vote
1 answer

how to get default device id for calling host thread in opencl

i am working with opencl "c" in a multi gpu scenario, where for various calls i have to get the default device id for the current calling host thread in opencl. unfortunately i am not able to figure it out and internet hasnt been kind in this…
1
vote
1 answer

How do we display pixel data calculated in an OpenCL kernel to the screen using OpenGL?

I am interested in writing a real-time ray tracing application in c++ and I heard that using OpenCL-OpenGL interoperability is a good way to do this (to make good use of the GPU), so I have started writing a c++ project using this interoperability…
Joe
  • 13
  • 2
1
vote
1 answer

OpenCL does not run the program

Good afternoon! I need to run a program written in C++ that uses OpenCL. Before that I enabled OpenCL headers, installed CUDA (this is optional) and reinstalled Visual Studio and MinGW. I have an NVIDIA GeFOrce 1080. Well, I have an array
maxet24
  • 111
  • 1
  • 10
1
vote
1 answer

OpenCL: clBuildProgram Fails without log

What I am trying to accomplish: I am trying to render some stuff in OpenCL and write it to the OpenGL Framebuffer (As it is the only Framebuffer I can get via Renderbuffers etc., but I will gladly accept any others I could use - You will not help me…
The A
  • 188
  • 1
  • 9
1
vote
2 answers

OpenCl is a Library or is a Compiler?

I started to learn OpenCl. I read these links: https://en.wikipedia.org/wiki/OpenCL https://github.com/KhronosGroup/OpenCL-Guide/blob/main/chapters/os_tooling.md https://www.khronos.org/opencl/ but I did not understand well that OpenCl is a library…
saharsa
  • 467
  • 1
  • 7
  • 24
1
vote
1 answer

OpenCL kernel function yields different results when running on different devices (CPU vs GPU)

I'm trying to make a sense out of a strange behavior happening in my OpenCL kernel function. I'm basically trying to convert a string that contains hexadecimals, into a string that contains its decimal representation but, for reasons I cannot…
Polentino
  • 907
  • 5
  • 16
1
vote
1 answer

Equivalent of cudaSetDevice in OpenCL?

I have a function that I wrote for 1 gpu, and it runs for 10 seconds with one set of args, and I have a very long list of args to go through. I would like to use both my AMD gpus, so I have some wrapper code that launches 2 threads, and runs my…
polpetti
  • 787
  • 7
  • 21
1
vote
1 answer

How can I convert a bitmap to pure black and white with OpenCL

I've got a WPF - C# project and I'm trying to speed up the image processing I'm doing in there; by doing it using OpenCL and Cloo. I did manage to get a kernel working that can change a bitmap to grayscale, but for some reason the black and white…
Shiasu-sama
  • 1,179
  • 2
  • 12
  • 39
1
vote
1 answer

vigenere encryption algorithm in c with OpenCL does not work as expected

I am trying to make vigenere encryption algorithm in c with OpenCL, i do not have experience in OpenCL. I am using mac os ( so I am running OpenCL 1.2 or 1.1 ) and building the program with Makefile. The file is compiled but the output is not what i…
1
vote
1 answer

OpenCL compilation issue

I am new to Opencl Programming. I have written a matrix multiplication program while compiling it is giving me error My include files are: #include #include #include #include #include #include…
Bhavin Thakar
  • 43
  • 1
  • 7
1
vote
1 answer

Trying to get some OpenCL code to use 2 GPUs

Hi I have just inherited some OpenCL code that appears to only use 1 GPU I submit it using SLURM on a cluster and when I submit it requesting multiple nodes (typically 2) the program just runs twice. I am wondering where I go on how to structure /…
R.Merritt
  • 477
  • 5
  • 17
1
vote
1 answer

OpenCl kernel returns strangely huge numbers

I have been trying to move my Marching Cubes algorithm from the CPU to the GPU with an OpenCL kernel for a while now. The problem I´m getting is that a function in my kernel returns strange values, so I wrote a test case where I specify the possible…
foodius
  • 53
  • 1
  • 6
1
vote
1 answer

Irregular behaviour of vectors in OpenCL(1.2) kernels

So, I am trying to perform some operation inside an OpenCL kernel. I have this buffer named filter which is a 3x3 matrix initialized with value 1. I pass this as an argument to the OpenCL kernel from the host side. The issue is when I try to fetch…
user11733000
1
vote
1 answer

Why do I get `CL_INVALID_MEM_OBJECT` from `clSetKernelArg`?

I'm almost done rewriting some CUDA code into OpenCL. But I get this terrible runtime error. The kernel I call takes arguments like this: __kernel void kernel_forwardProject( __global float *proj_out, __gloabl float *proj_in, __global float…