In January 2021 we will introduce a 10 GB quota for project repositories. Higher limits for individual projects will be available on request. Please see https://doku.lrz.de/display/PUBLIC/GitLab for more information.

Commit bdaa2308 authored by Jean-Matthieu Gallard's avatar Jean-Matthieu Gallard

KernelGen - PoC: precision support for allocateArray macro

parent 898c50d3
......@@ -14,13 +14,13 @@
Allocate array
*/
#}
{% macro allocateArray(name, size, setToZero=False, pointerExists=False, forceStack=False) %}
{% macro allocateArray(name, size, precision="double", setToZero=False, pointerExists=False, forceStack=False) %}
{% if tempVarsOnStack or forceStack %}
double {{name}}[{{size}}] __attribute__((aligned(ALIGNMENT))){% if setToZero %} = {0.}{% endif %};
{{precision}} {{name}}[{{size}}] __attribute__((aligned(ALIGNMENT))){% if setToZero %} = {0.}{% endif %};
{% else %}
{% if not pointerExists %}double* {% endif %}{{name}} = ((double *) _mm_malloc(sizeof(double)*{{size}}, ALIGNMENT));
{% if not pointerExists %}{{precision}}* {% endif %}{{name}} = (({{precision}} *) _mm_malloc(sizeof({{precision}})*{{size}}, ALIGNMENT));
{% if setToZero %}
std::memset({{name}}, 0, sizeof(double)*{{size}});
std::memset({{name}}, 0, sizeof({{precision}})*{{size}});
{% endif %}
{% endif %}
{% endmacro %} {##}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment