Conversation
Uses an empty asm statement to convince the compiler to generate code for loops but do nothing inside
|
Does it make more sense to put EMPTY in basic or algorithm? |
Basic I would think. |
|
@MrBurmark are we sure that the kernel doesn't get optimized away in all cases? |
|
That's something we'd have to double check, but it should be pretty easy to tell if its very short and not tied to problem size. |
|
I'm trying to guard the asm statement with |
I think |
|
Interestingly MSVC doesn't support its __asm on x64, only x86. Hence the build failure |
While this adds a store to stack memory into the loop this is the least overhead option I have found. Also remove ::: "memory" from the asm statement as it appears to be unnecessary and is a gnu extension.
|
I changed the windows build to write to a volatile local variable which adds a store to the stack into the loop. This seems like the lowest overhead option that is fairly robust where asm is not supported. |
Add a kernel that does nothing inside of the loop to try have a way to get the minimal cost of running a loop.
Uses an empty asm statement to convince the compiler to generate code for loops even though they do nothing.
Summary