Repository navigation
Expand file tree
/
Copy pathInfos
More file actions
107 lines (67 loc) · 2.79 KB
/
Copy pathInfos
File metadata and controls
107 lines (67 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Shared Pointers
===============
* LAMA takes heavy use of shared pointers so ownership can be kept at
different places and delete/destructor is called when all pointers are reset
* LAMA uses std::shared_ptr (C++11), for portability we use common::shared_ptr
(where shared_ptr might be implemented by boost::shared_ptr)
* #include <common/shared_ptr.hpp> has the correct replacement
* Weak pointers can also be used in the same way
Unique Pointers
===============
* Preferred to shared pointer whenever ownership is clearly limited within
one object or one scope
* Should be used instead of usual pointer to make sure that object is deleted
in case of exceptions ( and avoids garbage in case of delete has been forgotten)
* Not recommended when ownership changes ( pointer assignment, argument or result
of functions)
* Container can use unique_ptr, but not the auto_ptr. LAMA does not use it. Only
vector of shared pointers should be used.
* LAMA uses std::unique_ptr (C++11) for portability we use common::unique_ptr
(where unique_ptr might be implemented by std::auto_ptr)
Scoped Array
============
* Light alternative to std::vector even if less flexible
* Same as unique_ptr but for new of arrays.
* Same rules for using it apply as for unique pointers (never argument,
result, or use in container)
* std::unique_ptr (C++11) can be used like scoped_array
boost::scoped_array<Dummy> X( new Dummy[10] );
std::unique_ptr<Dummy[]> X( new Dummy[10] );
* LAMA uses common::unique_ptr (either implemented by std::unique_ptr
or boost::interprocess::unique_ptr
Some Remarks
============
* Keep always pointers (as result of new or other create methods)
* Only used shared_ptr or
* In containers (vector, queue, etc) only shared_ptr should be used.
ToDo
====
- Extension of getScalarType for new types
- getScalarTypeSize : routine make no sense, should be removed
Next Steps
==========
LAMAArray:
* What about two- and three-dimensional arrays
LAMAArrayView:
* How to deal with it
* WriteAccess: how to deal with small sections
LAMAInterface:
* Not one large interface, but many ones, extendible
* each application might use its own interface
LAMAConfiguratin:
* one lamarc file with all relevant configurations
* general strategy
* should also contain section for logging configuration
SCAI_CONTEXT:
* context is set globally
* ReadAccess, WriteAccess for this context (as default, instead Host)
* acceses for context are counted
* push implicitly to other context if interface routine is not available
+ currently not obvious how changing context works (context variable in macro!!)
ScaLAPack:
* This should be done by LAMA
ToDos:
* Working test suite
* Test that will copy from CUDAHostContext to Context
* lama info example update
* solver example should run