PDA

View Full Version : does opencl support inline assembly?



kang13
02-23-2010, 12:35 PM
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!

dbs2
02-24-2010, 05:38 AM
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.

kang13
02-24-2010, 10:16 AM
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?

kang13
02-24-2010, 03:44 PM
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?

dbs2
02-26-2010, 12:53 PM
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.