Results 1 to 2 of 2

Thread: How to use sqrt/cos/.. in kernel

  1. #1
    Junior Member
    Join Date
    May 2011

    How to use sqrt/cos/.. in kernel

    I try to use the function sqrt(5) or cos(5) like this:

    __kernel void hello(__global float *input, __global float *output)
    size_t id = get_global_id(0);

    float squareroot = cos(5);

    When i do this, clBuildProgram is != CL_SUCCESS and i got an error.
    if (clBuildProgram(program, 0, NULL, NULL, NULL, NULL) != CL_SUCCESS)

    Why i can't use these functions?
    Thanks for help

  2. #2
    Senior Member
    Join Date
    May 2010
    Toronto, Canada

    Re: How to use sqrt/cos/.. in kernel

    Which error code was returned? Also, have you tried looking at the build log? Use clGetProgramBuildInfo() with CL_PROGRAM_BUILD_LOG to get the compilation error messages.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

Similar Threads

  1. Kernel Memory Error (illegal access inside kernel) - why?
    By Syndacate in forum OpenCL - parallel programming of heterogeneous systems
    Replies: 4
    Last Post: 08-06-2012, 01:18 AM
  2. sin and cos in Symbian
    By miranda2112 in forum OpenGL ES general technical discussions
    Replies: 3
    Last Post: 03-10-2005, 02:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean