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.
5,538
questions
0
votes
0
answers
5
views
OpenCL global worksize and offset question
Let's say the global work size is 32, and I set the offset as 1. Does this mean that get_global_id(0) would start from 1 and end at 31, making the effective global work size to 31 rather than 32?
If I ...
-1
votes
1
answer
36
views
Basic arrays copy OpenCL GPU
Can someone help me to figure out of to traslate this C code for CPU, to kernel code for GPU
int a[N], b[N];
b[0] = a[0];
b[N] = a[N];
for (i=1; i<N-1; i++)
b[i]= a[i-1] + a[i] + a[i+1];
I ...
1
vote
1
answer
27
views
clEnqueueNDRangeKernel() throws CL_INVALID_KERNEL_ARGS even when all the kernel arguments are set (only occurs on the CPU on macOS)
I've been contributing to an OpenCL program called mfakto that trial factors Mersenne numbers for GIMPS. It uses a modified Sieve of Eratosthenes to create a list of potential factors and then uses ...
1
vote
1
answer
59
views
Does OpenCL C compiler simplify math expressions?
I am making a fractal generator and it needs to be really fast. Currently, a line of OpenCL C is being generated based on a user formula:
// User inputs z^2 + c + z^2 for example, generating this line ...
1
vote
0
answers
24
views
Running a OpenCL kernel with buffers that are meant for different command queue
My intention is to use two OpenCL devices to run the same kernel, same kernel in a sense of the same .cl file not the same cl_kernel.
I have two decomposed domains (2D data), p0 and p1, which would ...
0
votes
1
answer
26
views
Open CL programming with G++ in Windows
I am trying to write Open CL programs in C++ using G++ compiler in Windows 10 but I am not able to find any SDK for my work.
Nvidia CUDA requires Visual Studio compilers to work and AMD AMP SDK seems ...
0
votes
1
answer
36
views
c void function invoking an OpenCL functions would not renewed value
I am writing a void function to get the number of OpenCL devices and the list of OpenCL devices. These two look correct inside the function, but I do not get the correct values inside my main function....
0
votes
0
answers
31
views
How to use DMA-BUF in Android on a Snapdragon chipset?
I have a library, developing it using NDK. Part of my computation is shared between CPU and GPU and DSP, so I need to make shared memory to reduce the copying between devices. I realized that there is ...
0
votes
1
answer
56
views
How to use clEnqueueMigrateMemObjects in order to pass buffers in between GPUs under a same context
I am trying to use multiple GPUs to work on the problem domain. Main issue is that I somehow have to find a way to effectively pass buffers between the GPUs. The buffer that needs to be passed is ...
0
votes
1
answer
25
views
Where does OpenCL context physically lie?
From my understanding, OpenCL context is an abstraction layer. But where does it physically lie (host RAM, GPU memory... or somewhere in the air)?
I just want to understand how it would be possible ...
1
vote
0
answers
27
views
enque_kernel in opencl throws clEnqueueNDRangeKernel exception with error code -59 which should not occur
I have the following simple test kernel:
kernel void check_run() {
unsigned global_id = get_global_id(0);
queue_t q = get_default_queue();
ndrange_t ndrange = ndrange_1D(1, 1);
...
1
vote
1
answer
29
views
Cannot compile `enqueue_kernel` on opencl 2.1 NEO device
I have the following code on the device Intel(R) Gen9 HD Graphics NEO -- OpenCL 2.1 NEO :
__kernel void update(
const __global uint* positions,
const __global float3* offsets,
const int ...
0
votes
1
answer
41
views
Complex number type and functions Open CL C through C# Wrapper
I am making an application in WPF C# that generates fractals. I am using this code that someone made to create a OpenCL kernel and run it in C#:
https://www.codeproject.com/Articles/1116907/How-to-Use-...
0
votes
0
answers
24
views
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 ...
0
votes
0
answers
19
views
Using Nvidia OpenCL-drivers with an ICD-loader on Windows
I have configured Installable Client Drivers (ICDs) on an Ubuntu-distribution with Intel OpenCL runtime drivers, which was fairly straightforward. These drivers come as *.so-files which can be loaded ...
0
votes
1
answer
23
views
Change the default value of CL_DEVICE_IMAGE3D_MAX_WIDTH
I have a 3d image with dimensions of more than 2048. When I try to load the image into the OpenCL program using the clCreateImage3d() call, I get an error. Because the underlying device can also ...
0
votes
0
answers
33
views
Does OpenCV 4.x dnn module has OpenCL support for NVidia or AMD GPUs
I am trying to run a DNN model using OpenCV on NVIDIA GPUs. Cuda works fine.
I am trying to run models using OpenCL:
network.setPreferableBackend(cv::dnn::DNN_BACKEND_OPENCV);
network....
0
votes
0
answers
15
views
R OpenCL Package installation failed: ERROR: OCL not set
Package installation failed. I tried it both with manipulating the makevars and not. Probably a rookie error, but there is no documentation. I installed OpenCL drivers via Nvidia Cuda toolkit.
install....
1
vote
2
answers
55
views
How to enqueue as many kernels as there are threads available on version 1.2
I'm trying to do some calculations where it starts off with 10-20~ objects, but by doing calculations on these objects it creates 20-40 and so on and so forth, so slightly recursive but not forever, ...
0
votes
0
answers
16
views
Is it appropriate to pass in a complex structure when using vitis hls
I am currently doing code testing in sdaccel2018.2. When transmitting between the host and the device, I use a custom data structure. The current results show that the results of the software ...
2
votes
2
answers
56
views
Binding OpenCL buffer to DirectX buffer
I'm trying to find a way to bind an OpenCL buffer into DirectX buffer.
I did manage to find the inverse way of doing so using eh OpenGL Api function: clCreateFromGLBuffer, but failed on finding the ...
1
vote
1
answer
57
views
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 ...
0
votes
3
answers
118
views
It's like OpenCL kernel instance ends abruptly
I'm new to OpenCL and I'm working on converting an existing algorithm to OpenCL.
In this process, I am experiencing a phenomenon that I cannot solve on my own, and I would like to ask some help.
Here'...
1
vote
1
answer
23
views
Converting a c# function into openCL which is basically c
I am trying to implement a blur-function I wrote in c#. I want it to run in an openCL Kernel
The function is as follows:
private static int cSharpBlur(double[,] blur, int width, int height, int[,]...
0
votes
1
answer
31
views
Unable to create kernel from SPIR-file in OpenCL
I'm trying to compile a kernel written using Clang cl-std=clc++2021.
The clang compilation of the kernel runs fine:
clang --target=spirv32 -Xclang -no-opaque-pointers -cl-std=clc++2021 ERK.cpp -o ERK....
-1
votes
1
answer
56
views
Unhandled exception at 0x79BCC1C0 (nvopencl32.dll) in Task2b.exe: 0xC0000005: Access violation reading location 0x00000086
I am new to c++ and openCL. I am trying to create caesar shift cipher using opencl. I have read the txt file in the host and passed the string value into the kernel to do the encryption and decryption....
0
votes
1
answer
33
views
OpenCL/C: results always zero
I’m using Ubntu 20.04 to run my Opencl program with C but whatever the function i execute the results is always zero or other
illogical results, it’s like kernel not working,
Please if anyone has ...
1
vote
1
answer
48
views
Matrix multiplication in OpenCL
I'm a beginner in OpenCL and I'm using OpenCL on an Intel GPU.
I have the following program in C for the multiplication of two matrices; the kernel is separated with the code.
#include <CL/cl.h>
...
0
votes
1
answer
50
views
Image Edge Detection in C++ using OpenCL produces Rotated Image
I am currently trying to implement the Sobel Edge Detection method in C++ using OpenCL to implement part of the code in parallel. I am managing to detect the edges of an input image correctly, however,...
1
vote
0
answers
67
views
How to use GpuDelegate in case of no OpenCL found in Android Device?
I am very new to Android ,I am making CV application which uses tensorflow lite 'GpuDelegate'.
it works perfectly fine on Redmi 8A cause device supported OpenCl while when i installed in Infinix Hot ...
0
votes
1
answer
22
views
OpenCL syntax highlighting in CLion
Does anyone have a solution for syntax highlighting of OpenCL code for CLion?
I am placing the OpenCL source code in a file with the extension .cl and would like to have syntax highlighting for such ...
-1
votes
1
answer
48
views
vector addition in OPENCL /C
I hope you are well, I have a problem with an opencl program, I execute the following program of the vector addition
#define CL_USE_DEPRECATED_OPENCL_1_2APIS
#include <stdio.h>
#include <...
0
votes
1
answer
62
views
Assertion `argc >= 2' failed. Abandon (core dumped)
I'm traying to calculat the multiplication of tow matrix using OPENCL with C:
`
#include <CL/cl.h>
# include <stdio.h>
# include <math.h>
# include <assert.h>
# include <sys/...
1
vote
1
answer
37
views
Delete cl::buffer from Device in OpenCL C++
I am trying to set up memory management in my program as I noticed that my GPU's VRAM slowly fills up. I tried with clReleaseMemObject but it gives me the
No suitable conversion from cl::Buffer to ...
0
votes
1
answer
42
views
Casting an integer to a float in OpenCL
This is my first post on stack overflow so bear with me.
I am currently programming an OpenCL Kernel and require the use of the inbuilt sqrt function. However, for this to work the parameter of the ...
0
votes
1
answer
93
views
GPU Programming, CUDA or OpenCL or? [closed]
What is the best way to do programming for GPU?
I know:
CUDA is very good, much developer support and very nice zo debug, but only on NVidia Hardware
OpenCL is very flexible, run on NVidia, AMD and ...
0
votes
1
answer
67
views
Intel OpenCL Intel CPU not detected
I'm running the following code in order to retrieve device information:
#include <CL/cl.h>
#include <vector>
int main(int argc, char *argv[])
{
//find and print all available opencl ...
0
votes
1
answer
87
views
Why OpenCL refuses to work on compatible hardware under Ubuntu 20.04?
Well, I need a help from someone who has some experience using AMD GPUs on Linux.
I have AMD ATI Radeon HD 8550M. It supports OpenCL 1.2. And AMD ATI Radeon R3 Graphics which supports OpenCL 2.0. I ...
0
votes
0
answers
86
views
SYCL kernel cannot call an undefined function without SYCL_EXTERNAL attribute
I am trying to calculate the euclidean distance for KNN but in parallel using dpc++. the training dataset contains 5 features and 1600 rows, while I want to calculate the distance between the current ...
2
votes
3
answers
88
views
NVIDIA __constant memory: how to populate constant memory from host in both OpenCL and CUDA?
I have a buffer (array) on the host that should be resided in the constant memory region of the device (in this case, an NVIDIA GPU).
So, I have two questions:
How can I allocate a chunk of constant ...
0
votes
2
answers
71
views
OpenCL: Is 64 bit global_id() not supported?
I'm an OpenCL newbie and I cannot return 64 bit values from the compiled kernel. What do I wrong?
I have an Intel(R) HD Graphics 520 graphics card and I wanted to write an algorithm which process 64 ...
0
votes
1
answer
40
views
Defining size of array using clSetKernelArg
I'm trying to initialise an array of size numBins inside of an OpenCL kernel, but cannot figure out what the first parameter of my clSetKernelArg should be. I'm using the below code.
cl::Kernel kernel ...
1
vote
1
answer
55
views
How to compute vertex positions via large, dense matrix-vector multiplication on GPU?
My vertex positions V∈ℝ³ⁿ should be the result of multiplication of a large, dense matrix B∈ℝ³ⁿˣᵏ with a vector z∈ℝᵏ:
V = B z
In my case, k≈300, so as I understand this is far too big to store the ...
0
votes
0
answers
45
views
How to fix error that occurred while building CXX object src/CMakeFiles/VC4CC.dir/Compiler.cpp.o on Rasbberry Pi?
I've followed these instructions.
I've cloned grom git VC4CLStdLib, VC4C and VC4CL. VC4CLStdLib installed sucsessfuly. Then I do the cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_DEBUG=OFF -...
1
vote
1
answer
34
views
Transpose an image2d_t in OpenCL
I work on an image processing code base that uses image2d_t objects everywhere. These have their shape (width and height) formally declared which enables programmers to use built-in boundary checking ...
1
vote
2
answers
72
views
Atomic addition to floating point values in OpenCL for NVIDIA GPUs?
The OpenCL 3.0 specification does not seem to have intrinsics/builtins for atomic addition to floating-point values, only for integral values (and that seems to have been the case in OpenCL 1.x and 2....
0
votes
1
answer
26
views
OpenCL CL_INVALID_VALUE Error on clEnqueueWriteBuffer
I am trying to make an Algorithm run on OpenCL. I am using this repository (Source.cpp) as a template. I now want to convert the whole program into type of long algorithm instead of float. But I ...
0
votes
1
answer
34
views
CLBlast library not working on Mingw-w64 with Nvidia GPUs
I am trying to run the example samples/sgemm.cpp from the CLBlast repo on
Windows 10 with a Nvidia graphics card. I have obtained the cl.hpp from the link. The makefile is simply as follows:
a.exe: ...
0
votes
1
answer
81
views
How to setup OpenCL in Cygwin for Intel GPU
I have a Laptop with Intel(R) HD Graphics 520 GPU in it. I added OpenCL developer package to Cygwin. I have found a small Mandelbrot-set calculator program for OpenCL in C on GitHub. It is for Apple, ...
0
votes
0
answers
18
views
OpenCL convert_long from NaN Producing Incorrect Result on RTX 2060
OpenCL's convert_T (OpenCL 1.2, others are similar) function for long is producing an odd result.
In particular the function definition states:
Conversions to integer type may opt to convert using ...