a computeProgram Failure!!!!!

Help
Walid
2011-06-18
2012-12-21
  • Walid
    Walid
    2011-06-18

    excuse me, may the kernel cause a build program failure???

    this is part of hte code
                #region build clprogram

                prgm = new ComputeProgram(context, new string { clk.kernels });
                prgm.Build(null, null, null, IntPtr.Zero);
                display_kernel = prgm.CreateKernel("kernel_filter");

                #endregion
    any help please…

     
  • nythrix
    nythrix
    2011-06-19

    Yes, it may. Any syntax error in the kernel will trigger a build failure. Try compiling the kernel using an OpenCL compiler (comes with most SDKs).

     
  • Walid
    Walid
    2011-06-30

    Thats ok, now i'm trying to implement a convolution application on a bitmap displayed image, now i' trying to send that displayed image as a parameter to the OCL image buffer?? that's a part of the code:

    #region display image
    ComputeImage img = new ComputeImage2D(context, ComputeMemoryFlags.CopyHostPointer, new ComputeImageFormat(
                            ComputeImageChannelOrder.Bgra, ComputeImageChannelType.UnsignedInt8), btmp.Width, btmp.Height, 0, btmpData.Scan0);
                        btmp.UnlockBits(btmpData);
    #endregion

    #region clBuffer
    ComputeImageFormat format = new ComputeImageFormat(ComputeImageChannelOrder.Rgba, ComputeImageChannelType.Float);

                ComputeImage2D source_image = new ComputeImage2D(context,
                    ComputeMemoryFlags.ReadWrite, format, btmp.Width, btmp.Height, btmp.Width * 4 * sizeof(float), (????));
    #endregion

    and really thnx for ur interest :)

     
  • nythrix
    nythrix
    2011-06-30

    I don't understand. What is your question? The last parameter of the ComputeImage2D? Unfortunately, you cannot directly create a ComputeImage2D with a RGBA float format from a Bitmap class. You should, however, be able to write a simple kernel to convert data between the 1st ComputeImage2D (img) and the second one (source_image).

     
  • Walid
    Walid
    2011-06-30

    i have already displayed the image in the bitmap, what i want is to convolve this image, so i want to send that image to the convolution kernel to process it in the buffer as an argument to the kernel :) :)

     
  • Walid
    Walid
    2011-07-04

    excuse me… now what i want is to display the convolved image in the bitmap, this is part of the code:

    #region set kernel parameters & execute

                filter_kernel.SetMemoryArgument(0, img);
                filter_kernel.SetMemoryArgument(1, conv_kernel);
                filter_kernel.SetMemoryArgument(2, filter_size);
                filter_kernel.SetMemoryArgument(3, convolved_img);

                CQ.Execute(filter_kernel, new long { 0 }, new long { btmp.Width * btmp.Height }, null, events);
      #region display filtered image
    i want to display the convolved_img  param. in the bitmap????