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
0
votes
0 answers

How to allocate Local Work Item sizes in OpenCL

I've set up a convolution kernel in OpenCL to convolve a 228x228x3 image with 11x11x3x96 weights to produce 55x55x96 filters. My code without allotting localWorkSize works perfectly, but when I do allot it, I start getting errors My questions are…
0
votes
1 answer

openCL hello World display garbage output

i am trying a simple helloWorld openCL code, it compiles without errors but display garbage : ╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠ the error function detected an error while building so a removed the "-cl-std=CL2.1" in…
Mourad
  • 60
  • 6
0
votes
1 answer

Passing C structures to OpenCL kernel

I have next structure in my host program: typedef struct s_figure { cl_float reflection; cl_int color; enum e_figure type; cl_float3 vector1; cl_float3 vector2; cl_float param1; …
0
votes
1 answer

parallel opencl kernel execution

I am trying to execute multiple kernels in parallel. Each kernel is independent of each other. I am trying to execute the kernel on GPU. What I think is out of order execution and enqueue each kernel separately. Is that the way to approach this…
0
votes
0 answers

How can i use opencl in loop of host program?

I want to write the input image into the buffer and execute the kernel file in the while loop of the host program (not in the kernel file). I did set OpenCL stuff (context, device, buffer, command queue, etc) out of the while loop, write the image…
BHYoo
  • 11
  • 3
0
votes
2 answers

Throughput calculation in OpenCl

I am trying to calculate the throughput of my kernel which is written in my openCL. But I am not sure how to do that, I have tried to find some file generated after compilation which shows throughput as 0.435(" found in the .attrb file") but not…
0
votes
1 answer

Opencl: global thread synchronization between two loops

I have an opencl kernel that computes two global buffers in two loops. The first loop does some computations with a global thread and writes the result to the output buffer "OutBuff". Then the second loop updates the values of the global buffer…
0
votes
1 answer

OpenCL program doesn't build when a function is called from a kernel

This question follows from this question. I have a kernel which calls a regular function. When I build and run my code, I get the following output: Number of devices: 2 building program failed -----COULD NOT CREATE KERNEL!!--- The problematic…
a_sid
  • 577
  • 10
  • 28
0
votes
0 answers

Occupy all GPGPU memory and invoke kernel for all the data pieces

I need to allocate as much of struct Things as GPGPU memory allows and invoke the kernel for every struct Thing. OpenCL disallows allocating all the CL_DEVICE_GLOBAL_MEM_SIZE memory at once - you can allocate at most CL_DEVICE_MAX_MEM_ALLOC_SIZE per…
Slaus
  • 2,086
  • 4
  • 26
  • 41
0
votes
1 answer

Code terminates after saying COULD NOT CREATE KERNEL on Eclipse

I am trying to translate a sequential C code for a MJPEG decoder into OpenCL. I got the C code from this github project. I am now trying to convert the original C code for IDCT into OpenCL. I copied and pasted the code from the .c file for IDCT and…
a_sid
  • 577
  • 10
  • 28
0
votes
1 answer

How the OS and the Driver effects the OpenCL kernel timing?

For measuring an OpenCL kernel execution time we either uses a: 1- CPU Timers .. but we need to consider that the OCL functions are non-blocking hence we need to use the clFinish() routine for achieving full throughput. 2- GPU Timers .. that is…
mmain
  • 333
  • 3
  • 19
0
votes
1 answer

Which is more efficient in OpenCL: if conditions or for loops?

I have a piece of OpenCL code like this if (Sum[0] < Best) { Best = Sum[0]; iBest = 1; *aBits = Bits[0]; } if (Sum[1] < Best) { Best = Sum[1]; iBest = 2; *aBits = Bits[1]; } if (Sum[2] < Best) { Best = Sum[2]; iBest…
Harsh Wardhan
  • 2,110
  • 10
  • 36
  • 51
0
votes
1 answer

How do I pass an array to an OpenCL kernel?

I have an array which I want pass to an OpenCL kernel. Part of my code is cl_mem arr_cl; unsigned int arr[4] = { 0 }; arr_cl = clCreateBuffer(ocl.context, CL_MEM_ALLOC_HOST_PTR, 4*sizeof(unsigned int), NULL, &status); arr = (unsigned…
Harsh Wardhan
  • 2,110
  • 10
  • 36
  • 51
1 2 3 4 5
6