How to run a cuda file?

I am a beginner in cuda programming. I just copied some example.cu files from online, then i did some modifications on it.

I tried to compiled it

nvcc -cuda example.cu

A temporary file example.cu.cpp is created.

But How do I run this file? I have some main() method inside of example.cu. :blink:

I tried to do ./example.cu.cpp, ==> I get permission denied. :blink:

I changed permission, run it again ==> syntax error around ( (it is the first ‘(’ in the first line of code)) :blink:

Could anyone helps me??? How can I run a file written by .cu

Thank you a lot!!!

Compile:

nvcc -o a.out example.cu

Run:

./a.out