cloo's People
Forkers
jcbernack crackoff mvkara scenevista gediminasmasaitis fjsnogueira parxal aiframework amoraller rogalmic otterrrr bangush ca1e sunxiaotianmg wzydhek abibibucloo's Issues
How to set global variables not included in kernel?
int someGlobal1;
int[] someGlobal2;
kernel void SomeKernel()
{
//some code
}
How can I set values of two global variables defined like this in C#? Is there a way to get variable index by variable name?
macOS support
macOS users need to set a environment variable:
DYLD_LIBRARY_PATH=/System/Library/Frameworks/OpenCL.framework
CreateImage2D obsolete/deprecated?
The code marks the CreateImage2D constructor as obsolete, simply saying it is "deprecated" without explaining what to use instead (rather poor form, really).
It would seem that OpenCL v1.2 deprecates clCreateImage2D and clCreateImage3D in favor of clCreateImage, but there does not seem to be a way to invoke clCreateImage from the current version of Cloo.
Bool type maybe wrong calculated
I used a code for number theory returning results on a bool array. The code crashed in unpredictable way.
Now I found that SizeOf returns a 4 byte for bool. Should it be 1 byte? I am not sure.
I changed the type on c# to byte[] and in kernel to uchar[], and the code works now.
Could there by a bug? I am not sure, so sorry if it is a false alarm.
internal static int SizeOf<T>() { return typeof (T).IsGenericType ? Marshal.SizeOf(default(T)) : Marshal.SizeOf(typeof(T)); }
Can I create one ComputeBuffer, repeatedly set data in it?
Hi,
I met a problem that I wanted to repeatedly execute a kernel with different data:
for example, 100 times addition of two 3*3 matrice : matrix_A + matrix_B
at each time, I'd like to set different values of A and B.
now, all I do is
- new ComputeBuffer ( ..., matrix_A ), new ComputeBuffer ( ..., matrix_B )
- execute kernel
- read and dispose the 2 buffer
- repeat 1~3 steps
Can I just creat new ComputeBuffer() only once, and repeatedly set different value of the buffer to execute the kernel? when 100 times additions finish, I dispose it?
I didn't fine a function to do this.
hope for all your response.
Thanks and Regards!
solaaa
ComputeBuffer<char> Strange result
Example: (c#)
char[] pw_cracked = new char[5];
ComputeBuffer<char> cracked_pw_mem_obj = new ComputeBuffer<char>(context, ComputeMemoryFlags.WriteOnly | ComputeMemoryFlags.CopyHostPointer, pw_cracked);
kernel.SetMemoryArgument(0, cracked_pw_mem_obj);
commands.ReadFromBuffer(cracked_pw_mem_obj, ref pw_cracked, false, eventList);
Code Kernel
__kernel void vector_add( __global char *cracked_pw) {
cracked_pw[0] = 'h';
cracked_pw[1] = 'e';
cracked_pw[2] = 'l';
cracked_pw[3] = 'l';
cracked_pw[4] = '0';
}
Not getting "hello" on pw_cracked
is any way to debug the kernel code in VS?
HI,
lately I am facing a problem where I need to debug a module of software.
this module is including Cloo lib. , which is called loop by loop.
however, when i was running this module (VS2015, debug mode), unpredictable "error exit" always happended after a stable running (3mins or so), without any error infomations or exception stop (yes, it directly exited).
so I need to find a method to debug what is wrong with my code.
is there any tools or plug-ins in Visual Studio that I can use to debug?
or any software can test my module?
I am trying codeXL, but cannot import this project in codeXL so far.
Regards,
MIAHU
Logging Kernel Errors?
In c++ i can get the kernel errors with something like this :
Kernel Example
__kernel void vector_add( __global char *cracked_pw) {
if (true) {
}
C++ Code
ret = clBuildProgram(program, 1, &device_id, NULL, NULL, NULL);
if (ret == CL_BUILD_PROGRAM_FAILURE) {
size_t log_size;
clGetProgramBuildInfo(program, device_id, CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size);
char* log = (char*)malloc(log_size);
clGetProgramBuildInfo(program, device_id, CL_PROGRAM_BUILD_LOG, log_size, log, NULL);
printf("%s\n", log);
}
Witch writes in my console:
1:6:2: error: expected '}'
}
^
1:3:163: note: to match this '{'
In c# i only get "OpenCL error code detected: BuildProgramFailure."
c# Code
try
{
program.Build(platform.Devices, null, null, IntPtr.Zero);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Is there any way to get the kernel errors?
ComputeBuffer data array improperly pinned
For the ComputeBuffer constructor which takes a T[] data
parameter, the array is pinned only for the duration of the call to clCreateBuffer. This appears to be fine if using CopyHostPointer
, but is a bug when using UseHostPointer
. This is because there's no guarantee that the array won't be moved by GC. Note that a fix to this will also handle the case that's given in the remark, about immediate parameters not working.
Steps to reproduce incorrect behavior:
- Create some temporary objects on the small object heap.
- Create some smallish arrays (< 85k bytes, so they go on the small object heap, so they will be candidates for compaction).
- Create compute buffers from these arrays, using the flag
UseHostPointer
. - Create a lot of temporary objects on the small object heap, enough to cause a GC and compaction. The compaction will move your buffer arrays.
- Execute a kernel, and observe that the data isn't correct.
Cannot find or open the PDB file
Hi,
I met a strange problem:
I successfully ran a Cloo-based demo app. on my PC (see it as pc_1).
Then I copied the whole project to another PC (pc_2) and installed the Intel opencl SDK on pc_2.
When I ran the code to program.Build(xxx) on pc_2, it raised exception: Cloo.BuildProgramFailureComputeException
And the Debug outputed :
".\Intel\Opencl\bin\x64\clang_compile64.dll" cannot find or open the PDB file
".\Windows\System32\common_clang64.dll" cannot find or open the PDB file
Additionally, when the code was running, both pc_1 and pc_2 outputed the following in Debug:
".\Intel\Opencl\bin\x64\tbb\tbb.dll" cannot find or open the PDB file
".\Intel\Opencl\bin\x64\tbb\tbbmalloc.dll" cannot find or open the PDB file
".\Intel\Opencl\bin\x64\oclCpuBackend64.dll" cannot find or open the PDB file
".\Intel\Opencl\bin\x64__ocl_sval_l9.dll" cannot find or open the PDB file
However, the pc_1 didn't raise exception.
I have no idea where is wrong on pc_2, plz help me lol
Thanks and Regards!
Solaaa
VectorAddExample doesn't work for AMD GPU
tested on my AMD RX 470, it doesn't work with the following message:
Running "Vector addition"...
Cloo.BuildProgramFailureComputeException: OpenCL error code detected: BuildProgramFailure.
위치: Cloo.ComputeException.ThrowOnError(ComputeErrorCode errorCode)
위치: Cloo.ComputeProgram.Build(ICollection`1 devices, String options, ComputeProgramBuildNotifier notify, IntPtr notifyDataPtr)
위치: Clootils.VectorAddExample.Run(ComputeContext context, TextWriter log) 파일 E:\vscode\reference\Cloo\ClootilsNetFull\VectorAddExample.cs:line 102"Vector addition" finished.
Here's the result of additional information from program.GetBuildLog():
C:\Users\otter\AppData\Local\Temp\OCL20648T1.cl:3:13: error: access qualifier can only be used for pipe and image type
global read_only float* a,
^
C:\Users\otter\AppData\Local\Temp\OCL20648T1.cl:4:13: error: access qualifier can only be used for pipe and image type
global read_only float* b,
^
C:\Users\otter\AppData\Local\Temp\OCL20648T1.cl:5:12: error: access qualifier can only be used for pipe and image type
global write_only float* c )
^
3 errors generated.error: Clang front-end compilation failed!
Frontend phase failed compilation.
Error: Compiling CL to IR
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.