-1

An unhandled exception of type 'System.AccessViolationException' occurred in OpenCLNet.dll

@

Platform test = new Platform(platformid); and "platformID" has a value of 1 in runtime.

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);
    }
}

Am I even getting the PlatfromID or the platfromid correctly?

1 Answers1

2

The OpenCL.GetPlatformIDs out parameter is not a platform ID, it is the amount of platforms that are set in your IntPtrArr, check to see the entries in IntPtrArr have been set, and if so use them as your platformID.

jacob
  • 4,656
  • 1
  • 23
  • 32