예제 #1
0
 public static extern ComputeErrorCode BuildProgram(
     CLProgramHandle program,
     Int32 num_devices,
     [MarshalAs(UnmanagedType.LPArray)] CLDeviceHandle[] device_list,
     String options,
     ComputeProgramBuildNotifier pfn_notify,
     IntPtr user_data);
예제 #2
0
 public extern static ComputeErrorCode BuildProgram(
     CLProgramHandle program,
     Int32 num_devices,
     [MarshalAs(UnmanagedType.LPArray)] CLDeviceHandle[] device_list,
     String options,
     ComputeProgramBuildNotifier pfn_notify,
     IntPtr user_data);
예제 #3
0
 public extern static ComputeErrorCode GetProgramBuildInfo(
     CLProgramHandle program,
     CLDeviceHandle device,
     ComputeProgramBuildInfo param_name,
     IntPtr param_value_size,
     IntPtr param_value,
     out IntPtr param_value_size_ret);
예제 #4
0
        public static CLKernelHandle CreateKernelWrapper(CLProgramHandle program, String kernel_nam)
        {
            var handle = CreateKernel(program, kernel_nam, out ComputeErrorCode errcode_ret);

            ComputeException.ThrowOnError(errcode_ret);
            return(handle);
        }
 private void notify(CLProgramHandle programHandle, IntPtr userDataPtr)
 {
     log.WriteLine("Program build notification.");
     byte[] bytes = program.Binaries[0];
     log.WriteLine("Beginning of program binary (compiled for the 1st selected device):");
     log.WriteLine(BitConverter.ToString(bytes, 0, 24) + "...");
 }
예제 #6
0
 public static extern CLKernelHandle CreateKernel(
     CLProgramHandle program,
     String kernel_name,
     out ComputeErrorCode errcode_ret);
예제 #7
0
 public ComputeErrorCode GetProgramInfo(CLProgramHandle program, ComputeProgramInfo param_name, IntPtr param_value_size, IntPtr param_value, out IntPtr param_value_size_ret)
 {
     return StaticGetProgramInfo(program, param_name, param_value_size, param_value, out param_value_size_ret);
 }
예제 #8
0
 public ComputeErrorCode CompileProgram(CLProgramHandle program, int num_devices, [MarshalAs(UnmanagedType.LPArray)] CLDeviceHandle[] device_list, string options, int num_input_headers, [MarshalAs(UnmanagedType.LPArray)] CLProgramHandle[] input_headers, string[] header_include_names, ComputeProgramBuildNotifier pfn_notify, IntPtr user_data)
 {
     throw new NotImplementedException();
 }
예제 #9
0
 public static extern ComputeErrorCode StaticGetProgramBuildInfo(CLProgramHandle program, CLDeviceHandle device, ComputeProgramBuildInfo param_name, IntPtr param_value_size, IntPtr param_value, out IntPtr param_value_size_ret);
예제 #10
0
 public extern static ComputeErrorCode ReleaseProgram(
     CLProgramHandle program);
예제 #11
0
        private unsafe void notify(CLProgramHandle programHandle, IntPtr userDataPtr)
        {
            uint[] dst = new uint[16];

            fixed (uint* dstPtr = dst)
            {
                using (var queue = new ComputeCommandQueue(ccontext, device, ComputeCommandQueueFlags.None))
                {
                    var buf = new ComputeBuffer<uint>(ccontext, ComputeMemoryFlags.WriteOnly, 16);

                    var kernel = program.CreateKernel("test");
                    kernel.SetValueArgument(0, 1443351125U);
                    kernel.SetMemoryArgument(1, buf);

                    var eventList = new ComputeEventList();

                    queue.Execute(kernel, null, new long[] { 16L, 256L, 1048576L }, null, null);
                    queue.Finish();
                    queue.Read<uint>(buf, true, 0, 16, (IntPtr)dstPtr, null);
                    queue.Finish();
                    queue.Finish();
                }
            }
        }
예제 #12
0
 private static void notify(CLProgramHandle programHandle, IntPtr userDataPtr)
 {            
     Console.WriteLine("Program build notification.");
 }
예제 #13
0
 ComputeErrorCode ICL10.CreateKernelsInProgram(CLProgramHandle program, int num_kernels, CLKernelHandle[] kernels,
                                               out int num_kernels_ret)
 {
     return(CreateKernelsInProgram(program, num_kernels, kernels, out num_kernels_ret));
 }
예제 #14
0
 CLKernelHandle ICL10.CreateKernel(CLProgramHandle program, string kernel_name, out ComputeErrorCode errcode_ret)
 {
     return(CreateKernel(program, kernel_name, out errcode_ret));
 }
예제 #15
0
 ComputeErrorCode ICL10.GetProgramBuildInfo(CLProgramHandle program, CLDeviceHandle device, ComputeProgramBuildInfo param_name,
                                            IntPtr param_value_size, IntPtr param_value, out IntPtr param_value_size_ret)
 {
     return(GetProgramBuildInfo(program, device, param_name, param_value_size, param_value, out param_value_size_ret));
 }
예제 #16
0
 ComputeErrorCode ICL10.BuildProgram(CLProgramHandle program, int num_devices, CLDeviceHandle[] device_list, string options,
                                     ComputeProgramBuildNotifier pfn_notify, IntPtr user_data)
 {
     return(BuildProgram(program, num_devices, device_list, options, pfn_notify, user_data));
 }
예제 #17
0
 public static extern ComputeErrorCode GetProgramInfo(
     CLProgramHandle program,
     ComputeProgramInfo param_name,
     IntPtr param_value_size,
     IntPtr param_value,
     out IntPtr param_value_size_ret);
예제 #18
0
 ComputeErrorCode ICL10.CreateKernelsInProgram(CLProgramHandle program, int num_kernels, CLKernelHandle[] kernels,
                                               out int num_kernels_ret)
 {
     return CreateKernelsInProgram(program, num_kernels, kernels, out num_kernels_ret);
 }
예제 #19
0
 ComputeErrorCode ICL10.ReleaseProgram(CLProgramHandle program)
 {
     return(ReleaseProgram(program));
 }
예제 #20
0
 ComputeErrorCode ICL10.BuildProgram(CLProgramHandle program, int num_devices, CLDeviceHandle[] device_list, string options,
                                     ComputeProgramBuildNotifier pfn_notify, IntPtr user_data)
 {
     return BuildProgram(program, num_devices, device_list, options, pfn_notify, user_data);
 }
예제 #21
0
 extern static ComputeErrorCode RetainProgram(
     CLProgramHandle program);
예제 #22
0
 ComputeErrorCode ICL10.GetProgramInfo(CLProgramHandle program, ComputeProgramInfo param_name, IntPtr param_value_size,
                                       IntPtr param_value, out IntPtr param_value_size_ret)
 {
     return GetProgramInfo(program, param_name, param_value_size, param_value, out param_value_size_ret);
 }
예제 #23
0
 public static void ReleaseProgramWrapper(CLProgramHandle program)
 {
     ComputeException.ThrowOnError(ReleaseProgram(program));
 }
예제 #24
0
 ComputeErrorCode ICL10.RetainProgram(CLProgramHandle program)
 {
     return RetainProgram(program);
 }
예제 #25
0
 public ComputeErrorCode UnloadPlatformCompiler(CLProgramHandle program)
 {
     throw new NotImplementedException();
 }
예제 #26
0
 CLKernelHandle ICL10.CreateKernel(CLProgramHandle program, string kernel_name, out ComputeErrorCode errcode_ret)
 {
     return CreateKernel(program, kernel_name, out errcode_ret);
 }
예제 #27
0
 public static extern ComputeErrorCode StaticReleaseProgram(CLProgramHandle program);
예제 #28
0
 public static extern ComputeErrorCode StaticUnloadPlatformCompiler(CLProgramHandle program);
예제 #29
0
 public CLKernelHandle CreateKernel(CLProgramHandle program, String kernel_name, out ComputeErrorCode errcode_ret)
 {
     return StaticCreateKernel(program, kernel_name, out errcode_ret);
 }
예제 #30
0
 public new ComputeErrorCode UnloadPlatformCompiler(CLProgramHandle program)
 {
     return StaticUnloadPlatformCompiler(program);
 }
예제 #31
0
 public ComputeErrorCode ReleaseProgram(CLProgramHandle program)
 {
     return StaticReleaseProgram(program);
 }
예제 #32
0
 public static extern ComputeErrorCode RetainProgram(
     CLProgramHandle program);
예제 #33
0
 public static extern ComputeErrorCode CreateKernelsInProgram(
     CLProgramHandle program,
     Int32 num_kernels,
     [Out, MarshalAs(UnmanagedType.LPArray)] CLKernelHandle[] kernels,
     out Int32 num_kernels_ret);
예제 #34
0
 public extern static ComputeErrorCode ReleaseProgram(
     CLProgramHandle program);
예제 #35
0
 public static extern ComputeErrorCode StaticCompileProgram(CLProgramHandle program, Int32 num_devices, [MarshalAs(UnmanagedType.LPArray)] CLDeviceHandle[] device_list, String options, Int32 num_input_headers, [MarshalAs(UnmanagedType.LPArray)] CLProgramHandle[] input_headers, String[] header_include_names, ComputeProgramBuildNotifier pfn_notify, IntPtr user_data);
예제 #36
0
 extern static ComputeErrorCode GetProgramInfo(
     CLProgramHandle program,
     ComputeProgramInfo param_name,
     IntPtr param_value_size,
     IntPtr param_value,
     out IntPtr param_value_size_ret);
예제 #37
0
 public extern static ComputeErrorCode CreateKernelsInProgram(
     CLProgramHandle program,
     Int32 num_kernels,
     [Out, MarshalAs(UnmanagedType.LPArray)] CLKernelHandle[] kernels,
     out Int32 num_kernels_ret);
예제 #38
0
 public static void BuildProgramWrapper(CLProgramHandle program, int num_devices, CLDeviceHandle[] device_list, string options, ComputeProgramBuildNotifier pfn_notify, IntPtr user_data)
 {
     ComputeException.ThrowOnError(BuildProgram(program, num_devices, device_list, options, pfn_notify, user_data));
 }
예제 #39
0
 public static void CreateKernelsInProgramWrapper(CLProgramHandle program, Int32 num_kernels, CLKernelHandle[] kernels, out Int32 num_kernels_ret)
 {
     ComputeException.ThrowOnError(CreateKernelsInProgram(program, num_kernels, kernels, out num_kernels_ret));
 }
예제 #40
0
 public static void GetProgramInfoWrapper(CLProgramHandle program, ComputeProgramInfo param_name, IntPtr param_value_size, IntPtr param_value, out IntPtr param_value_size_ret)
 {
     ComputeException.ThrowOnError(GetProgramInfo(program, param_name, param_value_size, param_value, out param_value_size_ret));
 }
예제 #41
0
 public extern static CLKernelHandle CreateKernel(
     CLProgramHandle program,
     String kernel_name,
     out ComputeErrorCode errcode_ret);
예제 #42
0
 public static extern ComputeErrorCode RetainProgram(
     CLProgramHandle program);