C# 类型为';的未处理异常;System.AccessViolationException';发生在OpenCLNet.dll中
OpenCLNet.dll中发生类型为“System.AccessViolationException”的未处理异常 @ 平台测试=新平台(平台ID); “platformID”在运行时的值为1C# 类型为';的未处理异常;System.AccessViolationException';发生在OpenCLNet.dll中,c#,opencl.net,C#,Opencl.net,OpenCLNet.dll中发生类型为“System.AccessViolationException”的未处理异常 @ 平台测试=新平台(平台ID); “platformID”在运行时的值为1 public class Program { static void Main(string[] args) { IntPtr[] IntPtrArr = new IntPtr[10]; uint platformID; OpenCL.Ge
public class Program
{
static void Main(string[] args)
{
IntPtr[] IntPtrArr = new IntPtr[10];
uint platformID;
OpenCL.GetPlatformIDs(1, IntPtrArr,out platformID);
IntPtr platformid = new IntPtr(platformID);
Platform test = new Platform(platformid);
}
}
我是否正确获取了PlatfromID或PlatfromID?OpenCL.GetPlatformIDsout参数不是平台ID,而是在
IntPtrArr
中设置的平台数量,检查IntPtrArr
中的条目是否已设置,如果已设置,则将其用作platformID