Answer the question
In order to leave comments, you need to log in
Windows services, C# and OpenCL.dll?
Hello habrohumans!
I'm writing a Windows Service that, among other things, checks for OpenCL devices on the system. For this check, the already installed OpenCL.dll library is used, namely, the clGetPlatformIDs function .
The problem is that after calling this function, there is no return to the program. The service hangs for a while, after which it is killed by Windows (timeout). No exceptions are thrown.
The service runs as LocalSystem.
I import like this:
[DllImport("OpenCL.dll")]
public static extern int clGetPlatformIDs(
uint num_entries,
[MarshalAs(UnmanagedType.LPArray)] System.IntPtr[] platforms,
out uint num_platforms);
int error;
uint numPlatforms;
error = Test.clGetPlatformIDs(0, null, out numPlatforms);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question