Previous | Next --- Slide 17 of 57
Back to Lecture Thumbnails
anonymous

I'm having trouble understanding the difference between abstraction vs. implementation. From my understanding an abstraction is a general idea of what is going on, while an implementation is the technical details on how the abstraction was actually implemented. Is this correct?

mperron

This is not exactly correct. An abstraction is an idea which we use to assist in our understanding. Consider an Object in the java or c++ sense. Objects assist in the design of clean code, but at the processor level objects do not exist. The in-memory layout of data structures, and the particular assembly instructions used to manipulate and handle "objects" are implementation details. You could imagine a number of implementations of objects which may have different performance results.

For example, take a particular C program with structs, functions, types, function pointers, and other semantics and makes guarantees about what the semantics mean. Different compilers LLVM and GCC may implement those semantics in very different ways, often with differing performance. A small example is that 2 different compilers may differ in the choice of inlining a function.

PandaX

I think the reason for providing this kind of abstraction is to encapsulate the unnecessary details from the user(programmer). However, just like the slide points out, in ISPC, we are hoping to describe the job in high level, but we are also allowed to specify implementation details(like uniform keyword). It seems that the semantic of ISPC is not very well designed.

yimmyz

@PandaX I personally wouldn't consider "uniform" keyword as implementation details (since it doesn't touch, say, AVX intrinsics), but it is just an interface for the programmer to provide "hints" on how to convert SPMD to SIMD instructions behind the scene. What are your thoughts on this?

jerryzh

I agree with @yimmyz. The uniform key word is saying that a particular variable will be shared among all program instances, and it doesn't specify how this feature is implemented in any way. I think abstractions can be viewed as interfaces or the "languages" people use to express their higher level ideas, without touching the some unnecessary lower level details. Also it is surely limited by the actual implementation in some way because we need to be able to support the abstractions using one of the implementations.

maxdecmeridius

Just to make sure I understand his correctly, the difference between SPMD and SIMD is simply abstraction vs. implementation, respectively? That is to say, SPMD is the ISPC model that we're using, with gangs and program instances, whereas SIMD is the implementation with multiple ALUs. Is this correct?

eknight7

@maxdecmeridus Yes, thats exactly what this slide is saying.