Example #1
0
        private static String GetPlatformInfo(Platform platform, CLPlatformInfo platformInfo)
        {
            if (platform.CLPlatformID.Value == IntPtr.Zero)
            {
                return("None");
            }
            else
            {
                SizeT buffer_size = SizeT.Zero;

                OpenCLError.Validate(OpenCLDriver.clGetPlatformInfo(platform.CLPlatformID, platformInfo, SizeT.Zero, null, ref buffer_size));

                Byte[] buffer = new Byte[(Int64)buffer_size];

                OpenCLError.Validate(OpenCLDriver.clGetPlatformInfo(platform.CLPlatformID, platformInfo, buffer_size, buffer, ref buffer_size));

                Int32 count = Array.IndexOf <byte>(buffer, 0);

                return(System.Text.Encoding.ASCII.GetString(buffer, 0, count < 0 ? buffer.Length : count));
            }
        }
Example #2
0
 public static extern CLError clGetPlatformInfo(
     CLPlatformID platform,
     CLPlatformInfo param_name,
     SizeT param_value_size,
     IntPtr param_value,
     ref SizeT param_value_size_ret);
Example #3
0
        private static String GetPlatformInfo(Platform platform, CLPlatformInfo platformInfo)
        {
            if (platform.CLPlatformID.Value == IntPtr.Zero)
            {
                return "None";
            }
            else
            {
                SizeT buffer_size = SizeT.Zero;

                OpenCLError.Validate(OpenCLDriver.clGetPlatformInfo(platform.CLPlatformID, platformInfo, SizeT.Zero, null, ref buffer_size));

                Byte[] buffer = new Byte[(Int64)buffer_size];

                OpenCLError.Validate(OpenCLDriver.clGetPlatformInfo(platform.CLPlatformID, platformInfo, buffer_size, buffer, ref buffer_size));

                Int32 count = Array.IndexOf<byte>(buffer, 0);

                return System.Text.Encoding.ASCII.GetString(buffer, 0, count < 0 ? buffer.Length : count);
            }
        }
Example #4
0
 internal static extern CLError clGetPlatformInfo(CLPlatformID platform, CLPlatformInfo param_name, SizeT param_value_size, IntPtr param_value, ref SizeT param_value_size_ret);
Example #5
0
 internal static extern CLError clGetPlatformInfo(CLPlatformID platform, CLPlatformInfo param_name, SizeT param_value_size, [Out] byte[] param_value, ref SizeT param_value_size_ret);