Skip to content

Commit

Permalink
Update documentation for branch main
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Mar 6, 2024
1 parent 498e700 commit d4790a3
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 14 deletions.
8 changes: 7 additions & 1 deletion main/dsppp_guidelines.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,13 @@
<div class="headertitle"><div class="title">Guidelines </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><a class="anchor" id="md_src_guidelines"></a></p>
<div class="textblock"><p><a class="anchor" id="md_src_guidelines"></a> If you use dynamic objects in your algorithms and some temporaries need to be allocated, they'll generally be allocated through a <code>malloc</code> since the size is not known at build time. It can be an issue:</p>
<ul>
<li>Cost of the memory allocation</li>
<li>Fragmentations</li>
</ul>
<p>If you need to allocate those temporaries very often then it may be better to write the algorithm in such a way that the temporary can be reused between different calls.</p>
<p>The function implementing your algorithm would have additional arguments for the temporary matrixes and vectors required in the algorithm. </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
</div><!-- doc-content -->
Expand Down
2 changes: 1 addition & 1 deletion main/dsppp_memory_allocator.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
<div class="line"> <span class="keyword">template</span>&lt;<span class="keywordtype">int</span>&gt; <span class="keyword">typename</span> Allocator = TMP_ALLOC&gt;</div>
<div class="line"><span class="keyword">struct </span>Vector:Vector_Base&lt;P&gt;</div>
</div><!-- fragment --><p>It means that by default the memory allocator is <code>TMP_ALLOC</code>.</p>
<p>This <code>TMP_ALLOC</code> <code>#define</code> can be changed if you define it before including any header from the library.</p>
<p>This <code>TMP_ALLOC</code> is a <code>#define</code> and can be changed if you define it before including any header from the library.</p>
<p>An allocator should implement a template like:</p>
<div class="fragment"><div class="line"><span class="keyword">template</span>&lt;<span class="keywordtype">int</span> L&gt;</div>
<div class="line"><span class="keyword">struct </span>malloc_allocator {</div>
Expand Down
10 changes: 5 additions & 5 deletions main/dsppp_memory_static_dynamic.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,19 @@
<div class="contents">
<div class="textblock"><p><a class="anchor" id="md_src_memory_static_dynamic"></a> As we have seen in the previous sections, there are two kind of vectors:</p>
<ul>
<li><code>Vector&lt;T&gt;</code> with a dimension know at runtime</li>
<li><code>Vector&lt;T&gt;</code> with a dimension known at runtime</li>
<li><code>Vector&lt;T,NB&gt;</code> with a dimension known at build time</li>
</ul>
<p>The former vectors are called "dynamic" ins this library. The later are called "static".</p>
<p>The former vectors are called "dynamic" in this library. The later are called "static".</p>
<p>This naming "static" / "dynamic" is referring to the dimension. With "dynamic" vectors the same code can, at runtime, create vectors of different length based on a runtime length.</p>
<p>With "static" vectors : the length is fixed at build time and will never change at runtime.</p>
<p>Note that the library also have "static" / "dynamic" matrixes. So, we are going to use "objects" to cover both cases</p>
<p>Note that the library also have "static" / "dynamic" matrixes. So, we are going to use the name "object" to cover both cases in the below explanations.</p>
<h1><a class="anchor" id="autotoc_md16"></a>
Static objects</h1>
<p>The advantage of static objects is that the dimension is known at build time. The compiler can thus generate an algorithm that is specialized for those dimensions and thus more efficient.</p>
<p>With static objects it is also possible to use different memory allocator with better performances and determinism.</p>
<p>But, with static objects, objects of different dimension are considered as different types. The compiler will generate different implementation so it will have an impact on the code dimension.</p>
<p>If you need lots of objects of different dimensions, or if the dimensions are nort known at build time, then you need to use dynamic object</p>
<p>But, with static objects, objects of different dimension are considered as different types. The compiler will generate different implementation so it will have an impact on the code size.</p>
<p>If you need lots of objects of different dimensions, or if the dimensions are not known at build time, then you need to use dynamic object</p>
<h1><a class="anchor" id="autotoc_md17"></a>
Dynamic objects</h1>
<p>With dynamic objects, the dimension is know at runtime. So object of different dimensions have the same datatype and the compiler is generating only one implementation for all those objects. It cannot generate specialized implementations based on the dimension. It is better for code size, but the implementations will be less efficient.</p>
Expand Down
1 change: 1 addition & 0 deletions main/dsppp_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ <h1><a class="anchor" id="autotoc_md6"></a>
<p>And if the function is used with a <code>float64_t *</code>, the compiler would generate code for a function using <code>float64_t</code>.</p>
<p>The generic <code>arm_add</code> source code is a template used to generate different implementations. It is like a code generator.</p>
<p>And if the compiler is unable to generate an implementation because the type variable <code>T</code> is replaced by a type with no addition operator, then it would be detected by the compiler.</p>
<p>Note that in C++, you can also use overloading of functions. They'll use the same name (but different arguments) but they won't share the same source code.</p>
<h1><a class="anchor" id="autotoc_md7"></a>
Templates for datatypes</h1>
<p>C++ templates also apply to structs and classes.</p>
Expand Down
2 changes: 1 addition & 1 deletion main/dsppp_vector.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ <h1><a class="anchor" id="autotoc_md18"></a>
</div><!-- fragment --><p>It is advised to always use the <code>copy</code> operator (even with normal vectors).</p>
<p>Virtual vectors can have a stride:</p>
<div class="fragment"><div class="line">d.sub&lt;2&gt;(1) = 0.0f;</div>
</div><!-- fragment --><p>This line sets the odd elements of the vector to <code>0.0f</code>. It is creating a vvirtual vector with stride <code>2</code> and starting at index <code>1</code> of first vector.</p>
</div><!-- fragment --><p>This line sets the odd elements of the vector to <code>0.0f</code>. It is creating a virtual vector with stride <code>2</code> and starting at index <code>1</code> of first vector.</p>
<p>Then, all elements of this virtual vector are set to <code>0.0f</code>.</p>
<p>The <code>sub</code> API is:</p>
<div class="fragment"><div class="line"><span class="keyword">template</span>&lt;<span class="keywordtype">int</span> S=1&gt;</div>
Expand Down
6 changes: 3 additions & 3 deletions main/dsppp_vector_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@
<h1><a class="anchor" id="autotoc_md11"></a>
Include the headers</h1>
<p>The headers are not yet part of the CMSIS-DSP packs since they are experimental. You can get them from the <a href="https://github.com/ARM-software/CMSIS-DSP/tree/main/dsppp/Include/dsppp">CMSIS-DSP github</a></p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;memory_pool&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;matrix&gt;</span></div>
<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;dsppp/memory_pool&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;dsppp/matrix&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">using namespace </span><a class="code hl_namespace" href="namespacearm__cmsis__dsp.html">arm_cmsis_dsp</a>;</div>
</div><!-- fragment --><p>If fixed point datatypes are required, <code>#include &lt;fixed_point&gt;</code> should be used before <code>&lt;matrix&gt;</code></p>
</div><!-- fragment --><p>If fixed point datatypes are required, <code>#include &lt;dsppp/fixed_point&gt;</code> should be used before <code>&lt;dsppp/matrix&gt;</code></p>
<p>Fixed point requires the use of CMSIS-DSP.</p>
<h1><a class="anchor" id="autotoc_md12"></a>
Creation of the vectors</h1>
Expand Down
4 changes: 2 additions & 2 deletions main/footer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function writeHeader() {
document.write('Version 1.15.1-dev32');
document.write('Version 1.15.1-dev33');
};

function writeFooter() {
document.write('Generated on Wed Mar 6 2024 07:10:14 for CMSIS-DSP 1.15.1-dev32+g1bd68d7. Copyright &copy; 2024 Arm Limited (or its affiliates). All rights reserved.');
document.write('Generated on Wed Mar 6 2024 08:04:00 for CMSIS-DSP 1.15.1-dev33+ga4e82f8. Copyright &copy; 2024 Arm Limited (or its affiliates). All rights reserved.');
};
2 changes: 1 addition & 1 deletion version.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//--- list of versions ---
const versions = {
"main": "1.15.1-dev32",
"main": "1.15.1-dev33",
"latest": "1.15.0",
"v1.14.4": "1.14.4",
"v1.14.3": "1.14.3",
Expand Down

0 comments on commit d4790a3

Please sign in to comment.