predication in inline PTX

Why can’t you do this in C? An “if (flag) x = shared[i];” should do what you want.

If you really want to use PTX, you should create (and use) all predicates within a PTX assembly clause.

Example of declaring and using a predicate:

Alternatively, if it’s possible, you can create a boolean flag and enclose your PTX assembly in an “if(flag)” clause. Then doublecheck the generated PTX/SASS.