Generated OpenCL bindings with fixed function pointers.

This commit is contained in:
the_fiddler 2009-08-11 19:26:27 +00:00
parent 6492945554
commit ed48992d81
6 changed files with 1501 additions and 62 deletions

File diff suppressed because it is too large Load diff

View file

@ -40,19 +40,19 @@ namespace OpenTK.Compute.CL10
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(CL.Library, EntryPoint = "clBuildProgram", ExactSpelling = true)]
internal extern static unsafe int BuildProgram(IntPtr program, uint num_devices, IntPtr* device_list, String options);
internal extern static unsafe int BuildProgram(IntPtr program, uint num_devices, IntPtr* device_list, String options, IntPtr pfn_notify, IntPtr user_data);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(CL.Library, EntryPoint = "clCreateBuffer", ExactSpelling = true)]
internal extern static unsafe IntPtr CreateBuffer(IntPtr context, MemFlags flags, IntPtr size, IntPtr host_ptr, [Out] OpenTK.Compute.CL10.ErrorCode* errcode_ret);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(CL.Library, EntryPoint = "clCreateCommandQueue", ExactSpelling = true)]
internal extern static unsafe IntPtr CreateCommandQueue(IntPtr context, IntPtr device, CommandQueueProperties properties, [Out] OpenTK.Compute.CL10.ErrorCode* errcode_ret);
internal extern static unsafe IntPtr CreateCommandQueue(IntPtr context, IntPtr device, CommandQueueFlags properties, [Out] OpenTK.Compute.CL10.ErrorCode* errcode_ret);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(CL.Library, EntryPoint = "clCreateContext", ExactSpelling = true)]
internal extern static unsafe IntPtr CreateContext(ContextProperties* properties, uint num_devices, IntPtr* devices);
internal extern static unsafe IntPtr CreateContext(ContextProperties* properties, uint num_devices, IntPtr* devices, IntPtr pfn_notify, IntPtr user_data, [Out] int* errcode_ret);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(CL.Library, EntryPoint = "clCreateContextFromType", ExactSpelling = true)]
internal extern static unsafe IntPtr CreateContextFromType(ContextProperties* properties, DeviceTypeFlags device_type);
internal extern static unsafe IntPtr CreateContextFromType(ContextProperties* properties, DeviceTypeFlags device_type, IntPtr pfn_notify, IntPtr user_data, [Out] OpenTK.Compute.CL10.ErrorCode* errcode_ret);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(CL.Library, EntryPoint = "clCreateImage2D", ExactSpelling = true)]
internal extern static unsafe IntPtr CreateImage2D(IntPtr context, MemFlags flags, ImageFormat* image_format, IntPtr image_width, IntPtr image_height, IntPtr image_row_pitch, IntPtr host_ptr, [Out] int* errcode_ret);
@ -67,7 +67,7 @@ namespace OpenTK.Compute.CL10
internal extern static unsafe int CreateKernelsInProgram(IntPtr program, uint num_kernels, IntPtr* kernels, [Out] uint* num_kernels_ret);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(CL.Library, EntryPoint = "clCreateProgramWithBinary", ExactSpelling = true)]
internal extern static unsafe IntPtr CreateProgramWithBinary(IntPtr context, uint num_devices, IntPtr* device_list, IntPtr* lengths, String binaries, int* binary_status, [Out] OpenTK.Compute.CL10.ErrorCode* errcode_ret);
internal extern static unsafe IntPtr CreateProgramWithBinary(IntPtr context, uint num_devices, IntPtr* device_list, IntPtr* lengths, byte @char, int* binary_status, [Out] OpenTK.Compute.CL10.ErrorCode* errcode_ret);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(CL.Library, EntryPoint = "clCreateProgramWithSource", ExactSpelling = true)]
internal extern static unsafe IntPtr CreateProgramWithSource(IntPtr context, uint count, String[] strings, IntPtr* lengths, [Out] OpenTK.Compute.CL10.ErrorCode* errcode_ret);
@ -100,7 +100,7 @@ namespace OpenTK.Compute.CL10
internal extern static unsafe int EnqueueMarker(IntPtr command_queue, IntPtr* @event);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(CL.Library, EntryPoint = "clEnqueueNativeKernel", ExactSpelling = true)]
internal extern static int EnqueueNativeKernel(IntPtr command_queue);
internal extern static unsafe int EnqueueNativeKernel(IntPtr command_queue, IntPtr user_func, IntPtr args, IntPtr cb_args, uint num_mem_objects, IntPtr* mem_list, IntPtr args_mem_loc, uint num_events_in_wait_list, IntPtr* event_wait_list, IntPtr* @event);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(CL.Library, EntryPoint = "clEnqueueNDRangeKernel", ExactSpelling = true)]
internal extern static unsafe int EnqueueNDRangeKernel(IntPtr command_queue, IntPtr kernel, uint work_dim, IntPtr* global_work_offset, IntPtr* global_work_size, IntPtr* local_work_size, uint num_events_in_wait_list, IntPtr* event_wait_list, IntPtr* @event);
@ -223,7 +223,7 @@ namespace OpenTK.Compute.CL10
internal extern static int RetainSampler(IntPtr sampler);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(CL.Library, EntryPoint = "clSetCommandQueueProperty", ExactSpelling = true)]
internal extern static unsafe int SetCommandQueueProperty(IntPtr command_queue, CommandQueueProperties properties, bool enable, CommandQueueProperties* old_properties);
internal extern static unsafe int SetCommandQueueProperty(IntPtr command_queue, CommandQueueFlags properties, bool enable, CommandQueueFlags* old_properties);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(CL.Library, EntryPoint = "clSetKernelArg", ExactSpelling = true)]
internal extern static int SetKernelArg(IntPtr kernel, uint arg_index, IntPtr arg_size, IntPtr arg_value);

View file

@ -38,19 +38,19 @@ namespace OpenTK.Compute.CL10
internal static partial class Delegates
{
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate int BuildProgram(IntPtr program, uint num_devices, IntPtr* device_list, String options);
internal unsafe delegate int BuildProgram(IntPtr program, uint num_devices, IntPtr* device_list, String options, IntPtr pfn_notify, IntPtr user_data);
internal unsafe static BuildProgram clBuildProgram;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate IntPtr CreateBuffer(IntPtr context, MemFlags flags, IntPtr size, IntPtr host_ptr, [Out] OpenTK.Compute.CL10.ErrorCode* errcode_ret);
internal unsafe static CreateBuffer clCreateBuffer;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate IntPtr CreateCommandQueue(IntPtr context, IntPtr device, CommandQueueProperties properties, [Out] OpenTK.Compute.CL10.ErrorCode* errcode_ret);
internal unsafe delegate IntPtr CreateCommandQueue(IntPtr context, IntPtr device, CommandQueueFlags properties, [Out] OpenTK.Compute.CL10.ErrorCode* errcode_ret);
internal unsafe static CreateCommandQueue clCreateCommandQueue;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate IntPtr CreateContext(ContextProperties* properties, uint num_devices, IntPtr* devices);
internal unsafe delegate IntPtr CreateContext(ContextProperties* properties, uint num_devices, IntPtr* devices, IntPtr pfn_notify, IntPtr user_data, [Out] int* errcode_ret);
internal unsafe static CreateContext clCreateContext;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate IntPtr CreateContextFromType(ContextProperties* properties, DeviceTypeFlags device_type);
internal unsafe delegate IntPtr CreateContextFromType(ContextProperties* properties, DeviceTypeFlags device_type, IntPtr pfn_notify, IntPtr user_data, [Out] OpenTK.Compute.CL10.ErrorCode* errcode_ret);
internal unsafe static CreateContextFromType clCreateContextFromType;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate IntPtr CreateImage2D(IntPtr context, MemFlags flags, ImageFormat* image_format, IntPtr image_width, IntPtr image_height, IntPtr image_row_pitch, IntPtr host_ptr, [Out] int* errcode_ret);
@ -65,7 +65,7 @@ namespace OpenTK.Compute.CL10
internal unsafe delegate int CreateKernelsInProgram(IntPtr program, uint num_kernels, IntPtr* kernels, [Out] uint* num_kernels_ret);
internal unsafe static CreateKernelsInProgram clCreateKernelsInProgram;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate IntPtr CreateProgramWithBinary(IntPtr context, uint num_devices, IntPtr* device_list, IntPtr* lengths, String binaries, int* binary_status, [Out] OpenTK.Compute.CL10.ErrorCode* errcode_ret);
internal unsafe delegate IntPtr CreateProgramWithBinary(IntPtr context, uint num_devices, IntPtr* device_list, IntPtr* lengths, byte @char, int* binary_status, [Out] OpenTK.Compute.CL10.ErrorCode* errcode_ret);
internal unsafe static CreateProgramWithBinary clCreateProgramWithBinary;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate IntPtr CreateProgramWithSource(IntPtr context, uint count, String[] strings, IntPtr* lengths, [Out] OpenTK.Compute.CL10.ErrorCode* errcode_ret);
@ -98,8 +98,8 @@ namespace OpenTK.Compute.CL10
internal unsafe delegate int EnqueueMarker(IntPtr command_queue, IntPtr* @event);
internal unsafe static EnqueueMarker clEnqueueMarker;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate int EnqueueNativeKernel(IntPtr command_queue);
internal static EnqueueNativeKernel clEnqueueNativeKernel;
internal unsafe delegate int EnqueueNativeKernel(IntPtr command_queue, IntPtr user_func, IntPtr args, IntPtr cb_args, uint num_mem_objects, IntPtr* mem_list, IntPtr args_mem_loc, uint num_events_in_wait_list, IntPtr* event_wait_list, IntPtr* @event);
internal unsafe static EnqueueNativeKernel clEnqueueNativeKernel;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate int EnqueueNDRangeKernel(IntPtr command_queue, IntPtr kernel, uint work_dim, IntPtr* global_work_offset, IntPtr* global_work_size, IntPtr* local_work_size, uint num_events_in_wait_list, IntPtr* event_wait_list, IntPtr* @event);
internal unsafe static EnqueueNDRangeKernel clEnqueueNDRangeKernel;
@ -221,7 +221,7 @@ namespace OpenTK.Compute.CL10
internal delegate int RetainSampler(IntPtr sampler);
internal static RetainSampler clRetainSampler;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate int SetCommandQueueProperty(IntPtr command_queue, CommandQueueProperties properties, bool enable, CommandQueueProperties* old_properties);
internal unsafe delegate int SetCommandQueueProperty(IntPtr command_queue, CommandQueueFlags properties, bool enable, CommandQueueFlags* old_properties);
internal unsafe static SetCommandQueueProperty clSetCommandQueueProperty;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate int SetKernelArg(IntPtr kernel, uint arg_index, IntPtr arg_size, IntPtr arg_value);

View file

@ -362,6 +362,12 @@ namespace OpenTK.Compute.CL10
Queued = ((int)0X3),
}
public enum CommandQueueFlags
{
QueueOutOfOrderExecModeEnable = ((int)(1 << 0)),
QueueProfilingEnable = ((int)(1 << 1)),
}
public enum CommandQueueInfo
{
QueueContext = ((int)0X1090),
@ -370,12 +376,6 @@ namespace OpenTK.Compute.CL10
QueueProperties = ((int)0X1093),
}
public enum CommandQueuePropertiesFlags
{
QueueOutOfOrderExecModeEnable = ((int)(1 << 0)),
QueueProfilingEnable = ((int)(1 << 1)),
}
public enum CommandType
{
CommandNdrangeKernel = ((int)0X11f0),

View file

@ -1,4 +1,31 @@
using System;
#region License
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
using System.Text;

View file

@ -0,0 +1,45 @@
#region License
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace OpenTK.Compute.CL10
{
[StructLayout(LayoutKind.Sequential)]
public struct ImageFormat
{
ChannelOrder image_channel_order;
ChannelType image_channel_data_type;
public ChannelOrder ChannelOrder { get { return image_channel_order; } set { image_channel_order = value; } }
public ChannelType ChannelType { get { return image_channel_data_type; } set { image_channel_data_type = value; } }
}
}