13.07.2015 Views

Paper - IDAV: Institute for Data Analysis and Visualization

Paper - IDAV: Institute for Data Analysis and Visualization

Paper - IDAV: Institute for Data Analysis and Visualization

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

14 · Lefohn, Kniss, Strzodka, Sengupta, <strong>and</strong> Owens4.3.1 Address Iterators. Address iterators are an important concept <strong>for</strong> the Glift implementation <strong>for</strong> two reasons.First, address iterators can be efficiently implemented as GPU rasterizer interpolants (i.e., texture coordinates). Second,they are the iterator type supported by AddrTrans components. The concept enables address translators to specifyiteration without having knowledge of physical data.Glift address translators generate a stream of valid virtual addresses <strong>for</strong> a GPU data structure. They abstract thescreen-space geometry used to initiate GPU computation as well as the physical-to-virtual translation required to mapfrom fragment position to the virtual address domain. Glift represents address iterators using vertex data, vertex shadercode <strong>and</strong> parameters, <strong>and</strong> a viewport specification.Note that this design means that modifying a Glift data structure (e.g., inserting or deleting elements) means writingto both the address translator memory <strong>and</strong> the iterator representation. The latter operation requires either render-tovertex-arraysupport or CPU involvement.4.3.2 Element Iterators. Glift element iterators pose several challenges <strong>for</strong> implementation on current GPUs.First, element iterators are a pointer-like abstraction, <strong>and</strong> GPUs do not support pointers. Second, GPU data structuretraversal is usually accomplished with the rasterizer, yet the rasterizer cannot generate true memory addresses.It can only generate N-D indices via texture coordinate interpolation (i.e., address iterators). As such, Glift implementselement iterators by combining an address iterator with a Glift container (either PhysMem or VirtMem). Thelast challenge is the design requires shading language structures that contain a mixture of uni<strong>for</strong>m <strong>and</strong> varyingmembers. This feature has recently only been added to Cg <strong>and</strong> is not yet supported in other languages.4.4 Mapping Glift <strong>Data</strong> into CPU MemoryAll Glift components are designed to support data access on both the CPU <strong>and</strong> GPU. Glift implements this featureby supporting explicit map cpu <strong>and</strong> unmap cpu functionality. Just as with mappable GPU memory like vertexbuffer objects <strong>and</strong> pixel buffer objects, map copies the data into CPU memory while unmap copies data into GPUmemory. The default behavior is to transfer the entire data structure; however, Glift can optionally operate in a paged,lazy-transfer mode where only the required portions of the structure are copied. This mode reduces CPU read/writeefficiency but can greatly reduce the amount of data sent between the CPU <strong>and</strong> GPU.Initial designs attempted to automatically map data to the appropriate processor based on usage. This proved problematic,however, because it is not possible to detect all cases when a GPU-to-CPU or CPU-to-GPU synchronizationis required. For example, this can arise if a user binds a Glift structure to a shader, writes to the CPU mapping ofthe structure, then later re-binds the shader without explicitly re-binding the Glift structure. This is a perfectly legalOpenGL usage pattern, but one in which Glift cannot detect that the structure is now being read by the GPU. To supportthis automatic virtualization, Glift would either have to subsume a much larger portion of the GPU programmingmodel (shader binding, etc.) or be integrated directly into GPU drivers.4.5 Virtualized Range OperationsProviding generic support <strong>for</strong> virtualized range operations (read, write, copy) was one of the toughest challenges inthe design of Glift. The goal is <strong>for</strong> application programmers to be able to easily create new containers that havefull support <strong>for</strong> these operations. The challenge is that the contiguous virtual region over which these operations aredefined often maps to multiple physical regions.Early designs placed this functionality in the VirtMem component. This approach, however, required each datastructure to implement a significant amount of redundant, complex code. Our solution is inspired by a concept fromautomatic parallelization research. In their work to create a parallel STL, Austern et al. describe a range partitionadaptor as an entity that takes a range defined by a begin <strong>and</strong> end iterator <strong>and</strong> breaks it up into subranges which canbe executed in parallel [1996]. Applying this idea to Glift, the generic range operation problem is solved if addresstranslators can translate a virtual range into an ordered sequence of physical ranges.The prototypical usage of this operation is:ACM Transactions on Graphics, Vol. 25, No. 1, January 2006.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!