Results 1 to 7 of 7

Thread: using printf in the .cl file

  1. #1
    Junior Member
    Join Date
    May 2012
    Posts
    10

    using printf in the .cl file

    Hi everyone,

    I'd like to use
    Code :
    printf("test\n")

    Unfortunately, I get the following mistake:

    Code :
     
    ptxas application ptx input, line 43; error   : Call has wrong number of parameters
    ptxas fatal   : Ptx assembly aborted due to errors

    Has anyone any idea about where does that mistake comes from?

    Regards,

    Elrachal

  2. #2
    Junior Member
    Join Date
    Apr 2012
    Posts
    9

    Re: using printf in the .cl file

    Hi,

    printf() is not a standard openCL function. Then it depends on wich implementation you are using. I have no problem using it with Intel.

    I you are using AMD SDK perhaps you could try to put this line into your kernel file:

    #pragma OPENCL EXTENSION cl_amd_printf

  3. #3
    Junior Member
    Join Date
    May 2012
    Posts
    10

    Re: using printf in the .cl file

    I'm using Nvidia,

    Does something like this exists on Nvidia?

  4. #4

    Re: using printf in the .cl file

    No, NVIDIA does not expose a printf extension in OpenCL, even though its Fermi (and higher) cards actually support it. Complain to NVIDIA about it.

  5. #5
    Junior Member
    Join Date
    Jun 2012
    Location
    Toulon, France
    Posts
    7

    Re: using printf in the .cl file

    Or wait for them to release some OpenCl 1.2 compliant drivers

  6. #6

    Re: using printf in the .cl file

    I doubt they'll ever think about doing that, unless a sizeable number of users complain about the lack of support and possibly threatens to switch to the competition.

  7. #7
    Junior Member
    Join Date
    Jan 2012
    Posts
    2

    Re: using printf in the .cl file

    Hi, i got the ptxas: Call has wrong number of parameters

    I believe that it has to do compiling inline functions, after i transformed some of them to macros the error disappeared. My problem wasn't related to printf at all, but i'm posting maybe somebody finds it useful.
    I join too the group of enthusiasts hoping Nvidia will continue support OpenCL.

Similar Threads

  1. Troubleshooting via printf?
    By The.Scotsman in forum OpenCL
    Replies: 1
    Last Post: 06-06-2012, 01:48 AM
  2. Printf within a Kernel
    By nachovall in forum OpenCL
    Replies: 6
    Last Post: 02-09-2011, 04:35 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
  •