Skip to Content
GPGPU Programming for Games and Science
book

GPGPU Programming for Games and Science

by David H. Eberly
August 2014
Intermediate to advanced
469 pages
16h 30m
English
A K Peters/CRC Press
Content preview from GPGPU Programming for Games and Science
98 GPGPU Programming for Games and Science
}
m12 8 number ;
} ;
The general rule for alignment of a struct is that it is equal to the largest
alignment of its components. In this case,
m128 is 16-byte aligned which
guarantees that
MyTuple4 is 16-byte aligned.
The alignment of the struct is based on stack location. In the
MyTuple4
version with m128 number,aMyTuple4 object declared on the stack is 16-
byte aligned; that is, its address is a multiple of 16 bytes. However, if you
were to dynamically allocate the object using
new or malloc, the address is not
guaranteed to be 16-byte aligned. Fortunately with Microsoft Visual Studio
2013, warnings are generated ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Graphics Gems V (IBM Version)

Graphics Gems V (IBM Version)

Alan W. Paeth
GPU Pro 6

GPU Pro 6

Wolfgang Engel

Publisher Resources

ISBN: 9781466595354