Previous | Next --- Slide 13 of 59
Back to Lecture Thumbnails
tigerpanda

Are the variables listed in the parenthesis parameters which specify some characteristic of the "data types" ? I am not too sure if "data types" are even the correct way to be thinking of these values listed on the left hand side of the equals signs. For example, it seems pretty clear to me that H,W for the val image probably specify the height and width of an image and the the D, R and C for the vals above this are probably used to specify the size of these structures. However, I am somewhat confused about why the LineBuffer and ShiftReg are split into R and C? Something else I also found very confusing is the parameters for the buffer load image. What do these specify? This may have been mentioned during lecture but looking back at the slides, I could not figure out the significance of these variables.

ghostcow

Some notes from Kunle's discussion on SRAM and DRAM: - SRAM stands for static random access memory, DRAM stands for dynamic random access memory. One can conceptualize SRAM like L1/L2/L3 caches - The circuit-level implementation of SRAM is faster than DRAM; it takes 6 transistors per bit while DRAM is slower and only takes a single transistor per bit (+ a capacitor for store and charge). As a result, DRAM is much denser; for a given area of silicon, DRAM is 8-10x as dense as SRAM, which means you can get higher capacity DRAM. DRAM is off-chip, SRAM is on-chip.

fromscratch

@tigerpanda My understanding is: the code you write in Spatial [i.e., ultimately in Scala] is fairly high level, and so there's some "syntactic sugar" for things like 2D address spaces for the image memory. Presumably, this just gets compiled into a flat address as usual by multiplying out one dimension. The "data types" are essential for knowing how much storage to allocate each element and how to compile the operations (e.g., floating-point addition != uint8 addition). For your last question, I'd guess the "C" in pixels might hold the channels or colors, like RBG values?

yt1118

Curious if we define an SRAM buffer and put more data than its capacity, will it generate runtime errors or fall back to use DRAM?

yt1118

Also, I am not sure the real benefit of statements like buffer load image(i, j::j+C). If we access elements from the image array in C/C++, wouldn't the data be loaded into cache automatically?

yt1118

Re my above comment, Kunle mentioned in the lecture that just touching the data doesn't make data movement happen in the special-purpose hardware (which is the case in the general-purposes CPU). Whereas, programmers are responsible for data movement.

bmehta22

Having the ability to specify a cache is important, but having one with the right specifications (size, cache line size, etc.) is even more important. Spatial is allowing for specifying cache size/line size, etc. here.

Please log in to leave a comment.