Results 1 to 5 of 5

Thread: does opencl support inline assembly?

  1. #1
    Junior Member
    Join Date
    Feb 2010
    Posts
    12

    does opencl support inline assembly?

    hi i am a OpenCL beginner, and have two general questions:

    1. Can i include C inline assembly code in my openCL code?

    2. Does OpenCL support addtion and subtraction with carry?

    thanks!

  2. #2
    Senior Member
    Join Date
    Jul 2009
    Location
    Northern Europe
    Posts
    311

    Re: does opencl support inline assembly?

    1. No. (what assembly would you use? PTX, x86? )
    2. Not explicitly. If you want to detect a carry/overflow you need to check the output with respect to the input or use a larger data type as far as I know.

  3. #3
    Junior Member
    Join Date
    Feb 2010
    Posts
    12

    Re: does opencl support inline assembly?

    Quote Originally Posted by dbs2
    1. No. (what assembly would you use? PTX, x86? )


    2. Not explicitly. If you want to detect a carry/overflow you need to check the output with respect to the input or use a larger data type as far as I know.
    i see, thanks!

    yes X86. then if i want to implement part of the code assembly, how can i call them from the main opencl program?

  4. #4
    Junior Member
    Join Date
    Feb 2010
    Posts
    12

    Re: does opencl support inline assembly?

    Quote Originally Posted by dbs2
    1. No. (what assembly would you use? PTX, x86? )
    2. Not explicitly. If you want to detect a carry/overflow you need to check the output with respect to the input or use a larger data type as far as I know.
    then how can opencl code access assembler instructions, such as if the GPU has assembly instruction addc?

  5. #5
    Senior Member
    Join Date
    Jul 2009
    Location
    Northern Europe
    Posts
    311

    Re: does opencl support inline assembly?

    There's no supported way to do that. Some OpenCL implementations will return PTX if you ask for a program binary, and you could probably modify it and send it back, but that's not really supported.

Similar Threads

  1. can iPhone OS support OpenCL?
    By yile in forum OpenCL - parallel programming of heterogeneous systems
    Replies: 5
    Last Post: 06-08-2011, 11:36 AM
  2. OpenCL 1.0 - Any vendors support 3D write_imagef?
    By AlexAtOSU in forum OpenCL - parallel programming of heterogeneous systems
    Replies: 0
    Last Post: 06-28-2010, 09:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •