opencl

Barriers in OpenCL

社会主义新天地 提交于 2019-11-27 06:29:47
In OpenCL, my understanding is that you can use the barrier() function to synchronize threads in a work group. I do (generally) understand what they are for and when to use them. I'm also aware that all threads in a work group must hit the barrier, otherwise there are problems. However, every time I've tried to use barriers so far, it seems to result in either my video driver crashing, or an error message about accessing invalid memory of some sort. I've seen this on 2 different video cards so far (1 ATI, 1 NVIDIA). So, my questions are: Any idea why this would happen? What is the difference

Measuring execution time of OpenCL kernels

╄→尐↘猪︶ㄣ 提交于 2019-11-27 06:00:42
问题 I have the following loop that measures the time of my kernels: double elapsed = 0; cl_ulong time_start, time_end; for (unsigned i = 0; i < NUMBER_OF_ITERATIONS; ++i) { err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, &event); checkErr(err, "Kernel run"); err = clWaitForEvents(1, &event); checkErr(err, "Kernel run wait fro event"); err = clGetEventProfilingInfo(event, CL_PROFILING_COMMAND_START, sizeof(time_start), &time_start, NULL); checkErr(err, "Kernel run get

How to get a “random” number in OpenCL

回眸只為那壹抹淺笑 提交于 2019-11-27 05:28:21
问题 I'm looking to get a random number in OpenCL. It doesn't have to be real random or even that random. Just something simple and quick. I see there is a ton of real random parallelized fancy pants random algorithms in OpenCL that are like thousand and thousands of lines. I do NOT need anything like that. A simple 'random()' would be fine, even if it is easy to see patterns in it. I see there is a Noise function? Any easy way to use that to get a random number? 回答1: I was solving this "no random

Writing to global or local memory increases kernel execution time by 10000 %

半腔热情 提交于 2019-11-27 04:43:50
问题 I have the following OpenCL kernel: kernel void ndft( global float *re, global float *im, int num_values, global float *spectrum_re, global float *spectrum_im, global float *spectrum_abs, global float *sin_array, global float *cos_array, float sqrt_num_values_reciprocal) { // MATH MAGIC - DISREGARD FROM HERE ----------- float x; float y; float sum_re = 0; float sum_im = 0; size_t thread_id = get_global_id(0); //size_t local_id = get_local_id(0); // num_values = 24 (live environment), 48 (test

What is a bank conflict? (Doing Cuda/OpenCL programming)

折月煮酒 提交于 2019-11-27 02:35:52
I have been reading the programming guide for CUDA and OpenCL, and I cannot figure out what a bank conflict is. They just sort of dive into how to solve the problem without elaborating on the subject itself. Can anybody help me understand it? I have no preference if the help is in the context of CUDA/OpenCL or just bank conflicts in general in computer science. Grizzly For nvidia (and amd for that matter) gpus the local memory is divided into memorybanks. Each bank can only address one dataset at a time, so if a halfwarp tries to load/store data from/to the same bank the access has to be

Does Android support OpenCL?

给你一囗甜甜゛ 提交于 2019-11-27 02:12:07
问题 Recently I want to develop the parallel computing application on android use OpenCL. As far as I know, Android system does not include "libopencl.so",but there are still some webs or blogs show OpenCL development on android. Does Android support OpenCL? if so, what should I do to develop OpenCL on android ? 回答1: Update on May 20, 2016 For all devices with arm64-v8a ABI, the OpenCL library may located in lib64 folder as well. So when you check the OpenCL library, make sure you also check the

Do I really need an OpenCL SDK?

狂风中的少年 提交于 2019-11-26 20:42:22
问题 I just tried to make myself familiar with OpenCL but totally got confused when everyone in the Internet was talking about downloading a Vendor specific OpenCL SDK. Why would I need that? My understanding of using OpenCL was the following: Download the OpenCL header files that are maintained by Kronos in the Khronos OpenCL Registry and make it available to your compiler. Compile your code and link against the OpenCL.dll. The reason why it confuses me is because I thought that OpenCL should

How can I test for OpenCL compatibility?

自作多情 提交于 2019-11-26 20:17:59
问题 I have a MacBook Pro 13' with an integrated Intel HD 3000 and a i7 core. I have to use Parallel Programming. My teaching advisors couldn't tell me if it would work with my MacBook. Is there a test I could run on my Laptop for testing? + I found this, but there is only a Linux and Windows SDK ... maybe the Linux version works also for Mac. What should I do? 回答1: vocaro's answer is absolutely correct; you can always use the CPU compute device on Snow Leopard and Lion, even if your particular

How do I use local memory in OpenCL?

南笙酒味 提交于 2019-11-26 19:48:57
问题 I've been playing with OpenCL recently, and I'm able to write simple kernels that use only global memory. Now I'd like to start using local memory, but I can't seem to figure out how to use get_local_size() and get_local_id() to compute one "chunk" of output at a time. For example, let's say I wanted to convert Apple's OpenCL Hello World example kernel to something the uses local memory. How would you do it? Here's the original kernel source: __kernel square( __global float *input, __global

Are either the IPad or IPhone capable of OpenCL?

久未见 提交于 2019-11-26 19:47:29
问题 With the push towards multimedia enabled mobile devices this seems like a logical way to boost performance on these platforms, while keeping general purpose software power efficient. I've been interested in the IPad hardware as a developement platform for UI and data display / entry usage. But am curious of how much processing capability the device itself is capable of. OpenCL would make it a JUICY hardware platform to develop on, even though the licensing seems like it kinda stinks. 回答1: