Saturday, April 28, 2012

include source code in latex

http://en.wikibooks.org/wiki/LaTeX/Packages/Listings

http://stackoverflow.com/questions/3175105/how-to-insert-code-into-a-latex-doc

LaTeX Sample with professional look
http://stackoverflow.com/questions/741985/latex-source-code-listing-like-in-professional-books

Daily Reading: Locality of reference

Spatial Locality, Temporal Locality, relevant knowledge of cache. (wiki)
http://en.wikipedia.org/wiki/Locality_of_reference#Use_of_spatial_and_temporal_locality:_hierarchical_memory

Texture memory speed test

Speed test program
http://forums.nvidia.com/index.php?showtopic=181432&st=0

"On Fermi, global memory loads are cached in L1 and L1 cache has higher bandwidth than the texture cache"
http://stackoverflow.com/questions/9893086/why-in-my-case-the-texture-memory-is-slower-than-the-global

Spatial Locality of texture memory usage.

Cache & Cache miss or hit

Most modern desktop and server CPUs have at least three independent caches: an Instruction cache to speed up executable instruction fetch, a data cache to speed up data fetch and store, and a translation lookaside buffer (TLB)???? used to speed up virtual-to-physical address translation for both executable instruction and data.

Cache Entries
Memory is split into "locations," which correspond to cache "lines".
The requested memory location (now called a tag)
a copy of the data

When the processor needs to read or write a location in main memory, it first checks for a corresponding entry in the cache. The cache checks for the contents of the requested memory location in any cache lines that might contain in that address. If the processor finds that the memory location is in the cache, a cache hit has occurred (otherwise, a cache miss).

A cache miss refers to a failed attempt to read or write a piece of data in the cache, which results in a main memory access with much longer latency.

Three kinds of cache misses : instruction read miss, data read miss, and data write miss.

A cache read miss from an instruction cache generally causes the most delay, because the processor, or at least the thread of execution, has to wait (stall) until the instruction is fetched from main memory.

A cache read miss from a data cache usually causes less delay, because instructions not dependent on the cache read can be issued and continue execution until the data is returned from main memory, and the dependent instructions can resume execution.

A cache write miss to a data cache generally causes the least delay, because the write can be queued and there are few limitations on the execution of subsequent  instructions. The processor can continue until the queue is full.

Reference:
http://en.wikipedia.org/wiki/CPU_cache#Cache_miss

Friday, April 27, 2012

Translation lookaside buffer (wiki)

A translation lookaside buffer (TLB) is a cache that memory management hardware uses to improve virtual address translation speed. All current desktop, notebook, and server processors use a TLB to map virtual and physical address spaces, and it is nearly always present in any hardware which utilizes virtual memory.

Reference:Wiki