opencl

How to draw OpenCL calculated pixels to the screen with OpenGL?

99封情书 提交于 2019-12-22 02:34:11
问题 I wan't to do some calculated pixelart with OpenCL and display this directly on the display without CPU roundtripping. I could use interoperability of OpenCL with OpenGL and write to the texture-banks of the GPU and display the texture with OpenGL. I was wondering what would be the best way to do this, since I do not need any 3d stuff, just 2d pixelart. 回答1: The best way would be to use OpenCL/OpenGL interop, if your OpenCL implementation supports it. This allows OpenCL to access certain

Is there any guarantee that all of threads in WaveFront (OpenCL) always synchronized?

夙愿已清 提交于 2019-12-22 01:36:42
问题 As known, there are WARP (in CUDA) and WaveFront (in OpenCL): http://courses.cs.washington.edu/courses/cse471/13sp/lectures/GPUsStudents.pdf WARP in CUDA: http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#simt-architecture 4.1. SIMT Architecture ... A warp executes one common instruction at a time , so full efficiency is realized when all 32 threads of a warp agree on their execution path. If threads of a warp diverge via a data-dependent conditional branch, the warp serially

OpenCL LLVM IR generation from Clang

佐手、 提交于 2019-12-22 00:06:20
问题 I am using the following command line for clang: clang -Dcl_clang_storage_class_specifiers -isystem $LIBCLC/generic/include -include clc/clc.h -target nvptx--nvidiacl -x cl some_kernel.cl -emit-llvm -S -o some_kernel.ll the result is: ; ModuleID = 'kernel.cl' target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64" target triple = "nvptx--nvidiacl" ; Function Attrs: noinline nounwind define void

Differences between cl_khr_fp64 and cl_amd_fp64?

微笑、不失礼 提交于 2019-12-22 00:02:47
问题 I just found that on my (pretty expensive) Radeon 6970, only cl_amd_fp64 extension is supported. I am getting odd results in some parts of the code (accessing the value of 0.005 actually uses 1.99916e+37 ?) when running with cl_amd_fp64 . Using cl_khr_fp64 with Intel SDK on the CPU works just fine. (The input buffers are exactly the same) The extension page gives very little information. What are exactly the differences between both? 回答1: cl_khr_fp64 is the Khronos official double precision

Realistic deadlock example in CUDA/OpenCL

拈花ヽ惹草 提交于 2019-12-21 22:31:26
问题 For a tutorial I'm writing, I'm looking for a "realistic" and simple example of a deadlock caused by ignorance of SIMT / SIMD. I came up with this snippet, which seems to be a good example. Any input would be appreciated. … int x = threadID / 2; if (threadID > x) { value[threadID] = 42; barrier(); } else { value2[threadID/2] = 13 barrier(); } result = value[threadID/2] + value2[threadID/2]; I know, it is neither proper CUDA C nor OpenCL C. 回答1: A simple deadlock that is actually easy to catch

How to set the right alignment for an OpenCL array of structs?

拥有回忆 提交于 2019-12-21 20:55:26
问题 I have the following structure: C++: struct ss{ cl_float3 pos; cl_float value; cl_bool moved; cl_bool nextMoved; cl_int movePriority; cl_int nextMovePriority; cl_float value2; cl_float value3; cl_int neighbors[6]; cl_float3 offsets[6]; cl_float off1[6]; cl_float off2[6]; }; OpenCL: typedef struct{ float3 nextPos; float value; bool moved; bool nextMoved; int movePriority; int nextMovePriority; float value2; float value3; int neighbors[6]; float3 offsets[6]; float off1[6]; float off2[6]; } ss;

How to configure OpenCL in visual studio2010 for nvidia's gpu on windows?

折月煮酒 提交于 2019-12-21 20:44:59
问题 I am using NVIDIA's GeForce GTX 480 GPU on Wwindows 7 operating system on my ASUS laptop. I have already configured Visual Studio 2010 for CUDA 4.2. How to configure OpenCL for nvidia's gpu on visual studio 2010?? Have tries every possible way. Is it possible by any way to use 'CUDA toolkit (CUDA 4.2)' and 'nvidia's gpu computing sdk' to program OpenCL? If yes then How? If no then what is other way? 回答1: Yes. You should be able to use Visual Studio 2010 to program for OpenCL. It should simply

PyOpenCL “fatal error: CL/cl.h: No such file or directory” error during installation in Windows 8 (x64)

岁酱吖の 提交于 2019-12-21 20:27:17
问题 After searching a lot for solutions to this problem, I found that this particular error has not been documented properly for Windows. So I have decided to post this issue along with the solution. Sorry if I am posting this in the wrong section. I hope this solution will help users with the PyOpenCL installation error in the future. Please note that the examples used here are for ATI Radeon GPUs that supports the AMD OpenCL SDK SDK. For other GPUs , please refer to their respective parameters

Precision when reading image with CLK_FILTER_LINEAR in OpenCL

守給你的承諾、 提交于 2019-12-21 20:09:58
问题 The code I used is from this question OpenCL image3d linear sampling , I've tested in 2d and 3d, both with huge diff between CPU and GPU. Here is the result of CPU: coordinate:0.000000, result: 0.000000 coordinate:0.100000, result: 0.000000 coordinate:0.200000, result: 0.000000 coordinate:0.300000, result: 10.156250 coordinate:0.400000, result: 30.078125 coordinate:0.500000, result: 50.000000 coordinate:0.600000, result: 69.921875 coordinate:0.700000, result: 89.843750 coordinate:0.800000,

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

时光总嘲笑我的痴心妄想 提交于 2019-12-21 19:24:23
问题 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? 回答1: 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