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)); } }
public static extern CLError clGetPlatformInfo( CLPlatformID platform, CLPlatformInfo param_name, SizeT param_value_size, IntPtr param_value, ref SizeT param_value_size_ret);
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); } }
internal static extern CLError clGetPlatformInfo(CLPlatformID platform, CLPlatformInfo param_name, SizeT param_value_size, IntPtr param_value, ref SizeT param_value_size_ret);
internal static extern CLError clGetPlatformInfo(CLPlatformID platform, CLPlatformInfo param_name, SizeT param_value_size, [Out] byte[] param_value, ref SizeT param_value_size_ret);