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

OpenCL clBuildProgram "Could not open file: C:\Users\?"

I tried to build my kernel code but It doesn't work. Even the error message and error code doesn't appear and only Could not open file: C:\Users\? phrase was written on the console. By partially commenting out, I found out the location of the…
신동철
  • 11
  • 3
0
votes
1 answer

OpenCL How efficient is the use of user-defined function in kernel code in terms of memory and performance

In OpenCL C kernel code, Default built-in functions are good, but what about user-defined functions? do they have any performance and memory decrease when compared with in-built ones? If so, does writing the said user-defined function inside…
Punal Manalan
  • 59
  • 2
  • 6
0
votes
1 answer

How to transfer data from device memory subbuffer to host-program in OpenCL?

I’m learning OpenCL from Matthew Scarpino's "OpenCL in action" book. Chapter 3 contains material on the organization of buffers (pp.45-47) and subbuffers (pp.47-48). There is an inaccuracy in the code example for creating a subbuffer set out on page…
IGK
  • 13
  • 3
0
votes
1 answer

OpenCL: Invalid write of size # at global memory address 0x###

Post-solution edit: The issue is with the code alone. There is no hardware issue here. Now to the original post: I'm trying to get a basic OpenCL program to work. The program simply creates a buffer, writes 42 to the buffer, reads it, and…
ei2
  • 3
  • 2
  • 5
0
votes
1 answer

counting single bits in OpenCL?

I have to implement an algorithm using OpenCL, I have given some numbers to compute the number of following zeros consecutive form a certain offset, for each number. Here is the code: int count=0; for(int i=63-offset; i>=0; i--) { …
pinotto
  • 45
  • 7
0
votes
1 answer

Why is this printf function fixing my OpenCL kernel?

I'm writing a kernel which calculates a cumulative histogram using a Hillis-Steele Scan pattern. It didn't seem to be working properly - outputting numbers way too high and in the wrong order. During debugging though, I added a simple printf()…
Allie Howe
  • 609
  • 1
  • 5
  • 20
0
votes
2 answers

OpenCL creating kernel from Host function at runtime

I'm trying out some OpenCL and wondered if there is a way to pass functions as a parameter to a kernel or what is the closest available match for it (using OpenCL 1.2). As an example consider a simple Monte Carlo integration like this: /* this is…
Malte
  • 65
  • 4
0
votes
0 answers

Is there any reason why clEnqueueNDRangeKernel may block?

I am developing an application making use of OpenCL, targeted to 1.2 versión. I use DX11 interoperability to display the kernel results. I try my code in Intel (iGPU) and Nvidia platforms, in both I recon the same behaviour. My call to…
0
votes
0 answers

OpenCL 2.x clk_event_t with enqueue_event Gives Suprising Error

I have a simple device side kernel that uses enqueue_event. Everything works as intended, until I define a clk_event_t, which I want to use to enqueue several kernels, that wait for each other. The problem: when defining the clk_event_t, the…
Adelhart
  • 395
  • 2
  • 11
0
votes
0 answers

clEnqueueReadBuffer does not assign all values to cl_mem buffer which point to std::vector's data

https://i.stack.imgur.com/TA9v6.png I have been trying to get to compile a kernel that assigns certain indices to an std::vector using OpenCL through clEnqueueReadBuffer function but it does not seem to work correctly since the first result is the…
PontiacGTX
  • 185
  • 2
  • 15
0
votes
1 answer

does openCL support vectors as kernel arguments?

I've been thinking of ways to rewrite this code in openCL kernel form. It won't be particularly hard to convert (getting rid of glm types and bit masking), but the part I'm stuck on is how to pass the _triangles, _uvs, _indices, and _normals to the…
0
votes
0 answers

OpenCL C auxiliary function doesn't seem to be called or work

When the program does not return any error on compile time it doesn't seem to call the auxiliary function on my kernel. This function is a simply dot product of 2 vector array which should assign to a float array the result, but the result remains…
TTXX1
  • 31
  • 3
0
votes
2 answers

Multi threading in OpenCl

I have started working on OpenCl and have some basic knowledge about how WorkGroups and kernel works. Suppose I have a vector of size 1024, and the WorkGroupSize of my GPU is 256. So my WorkGroupSize is a multiple of my VectorSize and this works…
Obaid Ur Rehman
  • 324
  • 2
  • 15
0
votes
1 answer

QueryperformanceFrequency and QueryperformanceCounter Quick Sort GPU Programming OpenCL

I'm trying to execute Quick Sort algorithm on GPU using OpenCL. I found a package developed by Intel titled "GPU-Quicksort in OpenCL 2.0: Nested Parallelism and Work-Group Scan Functions". However this code is developed to run on windows machine and…
0
votes
1 answer

OpenCL2.0 runtime compiler not supporting c++11

I am trying to build an OpenCL kernel using OpenCL2.0. I am calling the cl::Program build function and passing the flag -cl-std=CL2.0. The g++ compiler finishes and links with no errors. However, when I run the program, the build function throws an…