I got a problem about inline PTX code in CUDA program.
The “Using Inline PTX Assembly in CUDA” pdf tells the syntax of the “asm()” statement. Withint the pdf all the examples are passing the parameters as input parameters to the instructions. However, what should I do if I want to pass the address to the instructions in the “asm” statement?
Here is my code:(“a” is a float parameter)
asm(".reg .f32 t1;\n\t" // temp reg f1
“ld.global.f32 t1, %0;\n\t” // f1 =
: : “f” (a));
The ptxas will report the error like this:
ptxas /tmp/tmpxft_00003efc_00000000-2_test_float.ptx, line 68; error : Address expected for argument 1 of instruction ‘ld’
Is there anybody know how to deal with that? Thanks a lot!!!