opencl

How to turn off errors/warnings in Eclipse due to OpenCL/CUDA syntax?

China☆狼群 提交于 2019-12-04 10:48:04
I am using Eclipse as an editor for OpenCL and I turned on syntax highlighting for *.cl files to behave like C++ code. It works great, but all my code is underlined as syntax errors. Is there a way that I can have my syntax highlighting and turn off the errors/warnings just for my *.cl files? First, the Eclipse syntax highlighter is programmed to the grammar of C and C++, and not OpenCL, so it is unaware of the syntactic extensions of OpenCL, such as New keywords New data types I suggest that the new keywords can be conditionally defined to nothing e.g. #define __kernel #define __global and

How to profile OpenCL application with CUDA 8.0 nvprof

巧了我就是萌 提交于 2019-12-04 10:41:00
问题 I'm trying to profile OpenCL application, a.out , in a system with NVIDIA TITAN X and CUDA 8.0. If it was CUDA application, nvprof ./a.out would be enough. But I found this does not work with OpenCL application, with a message "No kernels were profiled." Until CUDA 7.5, I successfully used COMPUTE_PROFILE=1 following this. Unfortunately, the documentation says "The support for command-line profiler using the environment variable COMPUTE_PROFILE has been dropped in the CUDA 8.0 release." The

The right way to setup VisualStudio 2010 for OpenCL

夙愿已清 提交于 2019-12-04 09:41:27
问题 what is the right way to setup VisualStuio 2010 for working with *.cl files? I have added *.cl under Tool/Text editor/File extensions and copied usertype.dat into the common7/ide folder, but VS underlines keywords like float4 or cross. Is it necessary to add some key in registry or can somebody propose a tutorial? Thanks in advance. PS i have already asked similar question old one question, but now i am looking explicit for a solution with vs2010. It is not bad, but really nerves and deflects

OpenCl code works on a machine but I am getting CL_INVALID_KERNEL_ARGS on another

为君一笑 提交于 2019-12-04 09:30:32
I had the following code, which works well on a machine but I when I try to run it on another machine with better graphics card I am getting errors: global[0] = 512; global[1] = 512; local [0] = 16; local [1] = 16; ciErrNum = clEnqueueNDRangeKernel(commandQueue, myKernel, 2, NULL, global, local, 0, NULL, &event); Errors: Error @ clEnqueueNDRangeKernel: CL_INVALID_KERNEL_ARGS Error @ clWaitForEvents: CL_INVALID_KERNEL_ARGS Any idea what is the problem? sharpneli How large are the buffer objects you are passing? __constant arguments are allocated from separate memory space and not from global

Compile OpenCL on Mingw Nvidia SDK

跟風遠走 提交于 2019-12-04 08:28:44
问题 Is it possible to compile OpenCL using Mingw and Nvidia SDK? I'm aware that its not officially supported but that just doesn't make sense. Aren't the libraries provided as a statically linked libraries? I mean once compiled with whatever compiler that may be, and linked successfully, whats should be the problem? I managed to compile and successfully link my code to OpenCL libraries provided with Nvidia's SDK, however the executable throws Segmentation Fault at clGetPlatformIDs which is the

OpenCL crashes on call to clGetPlatformIDs

亡梦爱人 提交于 2019-12-04 07:11:43
I am new to OpenCL. Working on a Core i5 machine with Intel(R) HD Graphics 4000, running Windows 7. I installed the newest Intel driver with support for OpenCL. GpuCapsViewer confirms I have OpenCL support setup. I Developed a simple HelloWorld program using Intel OpenCL SDK. I successfully compile the program but when run, it crashes upon call to clGetPlatformIDs() with a segmentation fault. This is my code: #include <iostream> #include <CL/opencl.h> int main() { std::cout << "Test OCL without driver" << std::endl; cl_int err; cl_uint num_platforms; err = clGetPlatformIDs(0, NULL, &num

OpenCL read variable size result buffer from the GPU

巧了我就是萌 提交于 2019-12-04 06:37:27
问题 I have one searching OpenCL 1.1 algorithm which works well with small amount of data: 1.) build the inputData array and pass it to the GPU 2.) create a very big resultData container (e.g. 200000 * sizeof (cl_uint) ) and pass this one too 3.) create the resultSize container (inited to zero) which can be access via atomic operation (at least I suppose this) When one of my workers has a result it copies that into the the resultData buffer and increments the resultSize in an atomic inc operation

OpenCL HelloWorld

六月ゝ 毕业季﹏ 提交于 2019-12-04 06:27:33
I've just started working in opencl and I'm currently working on what should be a relatively basic hello_world program in opencl. Unfortunately the program is not outputting the proper phrase or anything at all it instead hangs with no output. Any idea on why that is the case? Below is: openglsource.cpp and hello.cl #define CL_USE_DEPRECATED_OPENCL_2_0_APIS #include<CL/cl.hpp> #include<iostream> #include <fstream> int main() { std::vector<cl::Platform> platforms; cl::Platform::get(&platforms); auto platform = platforms.front(); std::vector<cl::Device> devices; platform.getDevices(CL_DEVICE

What is the best way to implement a small lookup table in an OpenCL Kernel

久未见 提交于 2019-12-04 06:16:08
In my kernel it is necessary to make a large number of random accesses to a small lookup table (only 8 32-bit integers). Each kernel has a unique lookup table. Below is a simplified version of the kernel to illustrate how the lookup table is used. __kernel void some_kernel( __global uint* global_table, __global uint* X, __global uint* Y) { size_t gsi = get_global_size(0); size_t gid = get_global_id(0); __private uint LUT[8]; // 8 words of of global_table is copied to LUT // Y is assigned a value from the lookup table based on the current value of X for (size_t i = 0; i < n; i++) { Y[i*gsi+gid]

OpenCL - copy Tree to device memory

断了今生、忘了曾经 提交于 2019-12-04 06:10:25
问题 I'm implemented a Binary-Search-Tree in C code. Each of my tree nodes looks like this: typedef struct treeNode { int key; struct treeNode *right; struct treeNode *left; } treeNode_t; The construction of the Tree made by the Host. The query of the tree made by the device. Now, let's assumed that I'm already finished building my Tree in host memory. I'm want to copy the root of my tree to the memory of my device. Copying the root of the tree it self isn't enough. Because the right \ left child