Results 1 to 5 of 5

Thread: Pointers to arrays

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    10

    Pointers to arrays

    I have an array of pointers to global inside a function, I'm having issues with having a pointer then to this array.
    For example if I have
    global double2 * Start[SIZE];

    I get errors when I try to pass it as (global double2 **) argument to a function.
    Are these errors from the specific implementation or am I doing things incorrectly?

    Error Message:

    Call parameter type does not match function signature!
    %ptr210 = getelementptr inbounds [6 x <2 x double> addrspace(1)*]* %Start, i32 0, i32 0 ; <<2 x double> addrspace(1)**> [#uses=1]
    <2 x double> addrspace(1)* addrspace(1)* %call216 = call i32 @func(<2 x double> addrspace(1)** %ptr210) nounwind ; <i32> [#uses=0]
    Broken module found, compilation aborted!
    Stack dump:
    0. Running pass 'Module Verifier' on function '@__OpenCL_Main_kernel'
    Aborted

    note: I am not passing it as a kernel function

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

    Re: Pointers to arrays

    I get errors when I try to pass it as (global double2 **) argument to a function.
    Are these errors from the specific implementation or am I doing things incorrectly?
    From section 6.8 of the specification:

    Arguments to __kernel functions in a program cannot be declared as a pointer to a pointer(s). Variables inside a function or arguments to non __kernel functions in a program can be declared as a pointer to a pointer(s)
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  3. #3
    Junior Member
    Join Date
    Mar 2011
    Posts
    10

    Re: Pointers to arrays

    As I have already mentioned it's not an argument to a kernel function. so therefore it's an implementation error?

  4. #4
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: Pointers to arrays

    Right, it's an implementation bug:

    Variables inside a function [this includes kernel functions] or arguments to non __kernel functions in a program can be declared as a pointer to a pointer(s)
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  5. #5
    Junior Member
    Join Date
    Mar 2011
    Posts
    10

    Re: Pointers to arrays

    Cheers: ati v2.2 update to ati v2.3 solved the issue

Similar Threads

  1. address space qualifiers and pointers to arrays
    By romein in forum Interoperability issues
    Replies: 4
    Last Post: 11-14-2012, 08:27 PM
  2. Pointers to Pointers
    By IRWolfie- in forum OpenCL
    Replies: 2
    Last Post: 04-05-2011, 05:00 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
  •