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!

  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?

then how can opencl code access assembler instructions, such as if the GPU has assembly instruction addc?

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.