Originally Posted by
knightjp
You learned Assembly? You must be a master. Do you think that it will be good for AI? Or is it too complex?
as matsp states there are some caveats, but he forgot my favorite -
4. To make your collegues gape in wonderment.
and
5. When you can do in 12 lines of assembly what it will take 1 lines in C/C++, e.g.
Code:
__asm pusha
__asm mov ecx , 0x00100000
__asm mov eax , GPU_Array
__asm mov edx , Inputs
__asm mov esi , 0x00000010
loop_start:
__asm add eax , esi
__asm movapd xmm0 , [edx]
__asm add edx , esi
__asm movapd [eax] , xmm0
__asm loop loop_start
__asm popa
why would you do that you ask? because it lends itself to optimizations that are not possible in C/C++, because it produces faster code, because it obfuscates what you are doing, and because it produces different results than a simple CopyMemory(), specifically it will throw if you try to use unaligned memory which may indicate an error condition on the GPU.