Главная / Программирование /
Introduction to performance optimization using Intel SW tools / Тест 8
Introduction to performance optimization using Intel SW tools - тест 8
Упражнение 1:
Номер 1
What of the following could be considered as a
good style of programming?
Ответ:
 (1) unconditional jumps 
 (2) loop exit operators 
 (3) modularity 
 (4) labels 
 (5) short variable names 
 (6) none of the answers 
Номер 2
What of the following could be considered as a
bad style of programming?
Ответ:
 (1) loop constructions 
 (2) global variable usage 
 (3) long functional names 
 (4) if
operators 
 (5) none of the answers 
Номер 3
How global variables usage affects?
Ответ:
 (1) none 
 (2) too few names are left for the local 
 (3) code size is increased because of the long global names 
 (4) harder to optimize this code 
 (5) harder to read and understand this code 
Упражнение 2:
Номер 1
What is variable scope?
Ответ:
 (1) part of the program where no such name can be defined 
 (2) memory range can be used as a pointer value 
 (3) variable value range 
 (4) context where this variable is defined 
 (5) basic block where this variable is defined 
Номер 2
What benefits would give correct code formatting?
Ответ:
 (1) inlining is faster 
 (2) variable scopes are separated 
 (3) it is easier to read source code 
 (4) compiler optimizations are simplified 
 (5) none of the answers 
Номер 3
What is the aim when the program is divided into functions
and procedures?
Ответ:
 (1) standartization 
 (2) serilization 
 (3) rasterization 
 (4) decompozition 
 (5) abstraction 
Упражнение 3:
Номер 1
What are disadvantages of the procedural-level optimizations?
Ответ:
 (1) they could be used for procedures and not for functions 
 (2) only constant length arrays are used 
 (3) can't be used in a highly loaded functions 
 (4) every function call is "black box" for them 
 (5) can't work with record type 
Номер 2
What are disadvantages of the procedural-level optimizations?
Ответ:
 (1) they could be used for procedures and not for functions 
 (2) they have no disadvantages 
 (3) they can't use pointer type variable 
 (4) global variables properties is unknown 
 (5) vectorization is not allowed 
Номер 3
What are disadvantages of the procedural-level optimizations?
Ответ:
 (1) variable serialization is not enough 
 (2) memory usage is not optimal 
 (3) procedure parameter properties is unknown 
 (4) they have no disadvantages 
 (5) loop optimization is not provided 
Упражнение 4:
Номер 1
What is node in call graph?
Ответ:
 (1) program and the time of the call 
 (2) program without a time of the call 
 (3) variable of the program 
 (4) function of the program 
 (5) basic block 
Номер 2
What information is corresponding to vertexes
in a call graph?
Ответ:
 (1) syntax construction nesting 
 (2) how functions calling each other 
 (3) program calls 
 (4) system utility calls 
 (5) system calls 
Номер 3
Why call graph may be considered as not full?
Ответ:
 (1) properties of the some used libraries are unknown 
 (2) pointer data type is used 
 (3) single assignment is used 
 (4) full call statistics is unknown 
 (5) system call statistics is unknown 
Упражнение 5:
Номер 1
Static call graph is
Ответ:
 (1) program calls on representative data set 
 (2) call graph without dynamical variables 
 (3) call graph, built at compilation of the program 
 (4) call graph, built statically 
 (5) such notion is not exists in this course 
Номер 2
Dynamic call graph is
Ответ:
 (1) call graph with pointer variables 
 (2) base block graph 
 (3) call graph, built during the program execution 
 (4) call graph, dynamically determines the operation system
and uses necessary system calls 
 (5) statistical graph with temporal data at the nodes 
Номер 3
Dynamical call graph
Ответ:
 (1) do not give any advantages 
 (2) do not use static
data 
 (3) uses abstract system calls 
 (4) built at program execution 
 (5) is a dense 
Упражнение 6:
Номер 1
This command line parameter is used
to enable inter-file optimization
Ответ:
 (1) /Qipf
 
 (2) /Qmulti-file
 
 (3) /Qipo
 
 (4) /Om
 
Номер 2
This command line parameter is used to disable
interprocedural optimizations
Ответ:
 (1) /Qip-
 
 (2) /Qip-disable
 
 (3) /Qipo-disable
 
 (4) /Qno-ipo
 
Номер 3
What kind of interprocedural optimization is used
by default?
Ответ:
 (1) no interprocedural optimizations at all 
 (2) optimizations without pointer variables 
 (3) single file optimizations 
 (4) multiple file optimizations 
Упражнение 7:
Номер 1
What is alias analysis?
Ответ:
 (1) analysis when the information from different procedures is aliased 
 (2) analysis aliased to build 
 (3) search for the variables that could point to the same memory cell 
 (4) search for the functions aliased temporary 
 (5) search and analysis of the functions, executed in parallel 
Номер 2
Aliasing could be occurred between
Ответ:
 (1) any variables 
 (2) only pointer variables 
 (3) any functions 
 (4) any programs 
Номер 3
Points to analysis is
Ответ:
 (1) alias analysis itself 
 (2) a part of alias analysis 
 (3) index variables analysis 
 (4) loop invariant analysis 
 (5) none of the answers 
Упражнение 8:
Номер 1
What is inlining?
Ответ:
 (1) variable substitution 
 (2) common expression substitution 
 (3) global equation substitution 
 (4) function body substitution 
Номер 2
What is the goals of inlining?
Ответ:
 (1) function call overhead decrease 
 (2) analysis simplify 
 (3) naming simplify 
 (4) simplification of dereferencing 
 (5) more short names 
Номер 3
What are disadvantages of inlining?
Ответ:
 (1) code expansion 
 (2) naming complexity for user 
 (3) execution time increase 
 (4) call overhead increase 
Упражнение 9:
Номер 1
What is memory diambiguation?
Ответ:
 (1) search for the objects, that may overlap in memory 
 (2) search for the objects, taking too much memory 
 (3) search for the objects, that could be not initialized 
Номер 2
What is taken into account during the memory
disambiguation?
Ответ:
 (1) language properties 
 (2) Local Point To analysis 
 (3) interprocedural analysis 
 (4) program performance analysis 
 (5) attributes and command line options are set by developer 
Номер 3
When permutation transformations are not allowed?
Ответ:
 (1) if there any objects that could be not loaded at a time 
 (2) if there any objects that probably overlap in memory 
 (3) if there any objects that take too much memory 
Упражнение 10:
Номер 1
What is - ansi-alias
for?
Ответ:
 (1) to enable ANSI aliasing in optimizatoin 
 (2) to diable ANSI aliasing in optimization 
 (3) to allow providing some more aggressive optimizations 
Номер 2
What is demanded by ANSI aliasing?
Ответ:
 (1) pointer can be
dereferenced to the variable of the same  
 (2) pointer can be dereferenced to the object of any type 
 (3) pointer can be dereferenced to the object of primitive type 
 (4) pointer can be dereferenced to the object of the compatible type  
Номер 3
What is the meaning of restrict
attribute at pointer definition in С/С++?
Ответ:
 (1) any pointer could be linked to this memory 
 (2) only this pointer could have its value 
 (3) only this pointer and the expression, based on this pointer could
link to its memory cell 
Номер 4
What is __declspec(align(n))
pragma used for?
Ответ:
 (1) to tell the compiler that the program couldn't be compiled when
the alignment is wrong 
 (2) to tell the compiler how to align variables in memory 
 (3) to tell the compiler that all the types must be aligned identically 
 (4) to disallow array alignment when its size is less than "n" 
Упражнение 11:
Номер 1
How compiler determines a case when it is better to
perform inlining?
Ответ:
 (1) only by compiler directives and source code pragmas 
 (2) only by directives 
 (3) it is performed always when is not disabled by options 
 (4) there is an heuristic method for that 
 (5) inline is not performed while it is not demanded by pragmas 
Номер 2
How developer could drive inlining process?
Ответ:
 (1) by command line options and the source code of the program 
 (2) only by program source code 
 (3) this process could be only enabled or disabled in general from the command line 
 (4) this process in unmanaged due to specific algorithms 
Номер 3
During the VTune analysis some of the functions is missed.
Why could it happened?
Ответ:
 (1) big amounts of interprocedural data leads to function name aggregation 
 (2) function was deleted during inlining 
 (3) function name was changed to system and VTune hides this name 
 (4) it is typical error for global scope 
 (5) function name was overlapped by reserved system word 
Упражнение 12:
Номер 1
What is used to suggest function for inline?
Ответ:
 (1) command line option -Qinline<func>
 
 (2) pragma #pragma inline
before the body of the function 
 (3) keyword forceinline
in function definition 
 (4) keyword inline
in function definition 
Номер 2
What could be used to force function inline?
Ответ:
 (1) #pragma forceinline
before the definition 
 (2) #pragma forceinline
before the call 
 (3) #pragma inline
before the definition 
 (4) #pragma inline
before the call 
Номер 3
What option is used to disable inline?
Ответ:
 (1) /Qb<0>
 
 (2) /Qnoinline
 
 (3) /Qinline<0>
 
Упражнение 13:
Номер 1
What is function cloning?
Ответ:
 (1) create clone-function, executed at the other device 
 (2) create clone-function, executed on built-in video chip 
 (3) copying function body and using separate optimizations for new instances 
 (4) parallel execution on cluster and super-computer 
Номер 2
What is partial inlining?
Ответ:
 (1) partial function substitution 
 (2) substitution defines pointer variable with name of the function inlined  
 (3) using basic block optimizations without any code transformation 
 (4) dynamical code substitution at runtime 
Номер 3
What interprocedural optimization is specific to C++?
Ответ:
 (1) deconstructization 
 (2) deobjectization 
 (3) devirtualization 
 (4) relation canceling 
 (5) depolymorphysm