Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8923273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:04:40+00:00 2026-06-15T07:04:40+00:00

While working with JOCl (java version opencl), I came across this error. Exception in

  • 0

While working with JOCl (java version opencl), I came across this error.

Exception in thread "main" org.jocl.CLException: CL_BUILD_PROGRAM_FAILURE
Build log for device 0:
<program source>:3:255: error: **call to '__cl_pow' is ambiguous**
__kernel void sampleKernel(__global short *x,             __global short *y,           __global uint *stop,           __global uint *moment){private uint a = 1;private uint b = 2;for(uint i =0; i<= 100;i++){ for(uint j = stop[i]; j < stop[i+1]; j++){    pow(a,b)      }  }}

My kernel code :

  private static String programSource =
            "__kernel void "
            + "sampleKernel(__global short *x,"
            + "             __global short *y,"
            + "           __global uint *stop,"
            + "           __global uint *moment)"
            + "{"
            + "for(uint i =0; i<= 100;i++){"
            + " for(uint j = stop[i]; j < stop[i+1]; j++){"
            + "    moment[i] = moment[i] + (pow(x[j],0)*pow(y[j],0))  "
            + "     }"
            + "  }"
            + "}";

I thought it was because of the datatype of x and y. But when I do a simple pow(1,1), it results in the same error.

How can I fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T07:04:42+00:00Added an answer on June 15, 2026 at 7:04 am

    Just a guess :

    there is no overload of pow for integral types so the compiler will try to find the closest match amongst all the available overloads :

    • pow(double, double)
    • pow(float, float)
    • …

    But as a short is convertible to a float as well as a double it doesn’t find a single overload to use, hence the error.

    To check this hypothese try to explicit the conversion you want to use with a cast :

    (pow((float)x[j],0)*pow((float)y[j],0))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

while working on thread in android I came across runnable and handler. My question
While working on jstree I came across this line of code- <!-- one of
While working my way through the Android tutorials, I came across something I don't
While working with Java, I find it hard to position my main window in
While working on a project, I came across a JS-script created by a former
While working on an auditing project I came across different problems regarding software and
While working on a web application with struts, I came across the following situation.
while working on the layout of a simple site I'm doing, I came across
while working with an old initscript in redhat, I came across the line like
While working with JSP files and servlets , I came across <% … %>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.