If I want to write and publish a book where I use my examples with C++ code that I have written for specific GPUs, what are the steps? Is there an infringement, because I will base the examples to GPU code??
Manufacturers of GPUs do not sell you their product with a condition attached that you cannot publish code for them. In any case, this stipulation would probably not hold up in a court of law. Thus, providing code written by you for a patent and trademark protected GPU is not a violation of your purchasing agreement.