Vector Optimized Library of Kernels  3.0.0
Architecture-tuned implementations of math kernels
volk_machines.tmpl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2011-2012 Free Software Foundation, Inc.
4  *
5  * This file is part of VOLK
6  *
7  * SPDX-License-Identifier: LGPL-3.0-or-later
8  */
9 
10 #ifndef INCLUDED_LIBVOLK_MACHINES_H
11 #define INCLUDED_LIBVOLK_MACHINES_H
12 
13 #include <volk/volk_common.h>
14 #include <volk/volk_typedefs.h>
15 
16 #include <stdbool.h>
17 #include <stdlib.h>
18 
20 
21 struct volk_machine {
22  const unsigned int caps; //capabilities (i.e., archs compiled into this machine, in the volk_get_lvarch format)
23  const char *name;
24  const size_t alignment; //the maximum byte alignment required for functions in this library
25  %for kern in kernels:
26  const char *${kern.name}_name;
27  const char *${kern.name}_impl_names[<%len_archs=len(archs)%>${len_archs}];
28  const int ${kern.name}_impl_deps[${len_archs}];
29  const bool ${kern.name}_impl_alignment[${len_archs}];
30  const ${kern.pname} ${kern.name}_impls[${len_archs}];
31  const size_t ${kern.name}_n_impls;
32  %endfor
33 };
34 
35 %for machine in machines:
36 #ifdef LV_MACHINE_${machine.name.upper()}
37 extern struct volk_machine volk_machine_${machine.name};
38 #endif
39 %endfor
40 
42 
43 #endif //INCLUDED_LIBVOLK_MACHINES_H
archs
Definition: volk_arch_defs.py:10
machines
Definition: volk_machine_defs.py:11
Definition: volk_machines.tmpl.h:21
const size_t alignment
Definition: volk_machines.tmpl.h:24
const unsigned int caps
Definition: volk_machines.tmpl.h:22
const char * name
Definition: volk_machines.tmpl.h:23
for kern in kernels
Definition: volk_machines.tmpl.h:26
#define __VOLK_DECL_END
Definition: volk_common.h:94
#define __VOLK_DECL_BEGIN
Definition: volk_common.h:93
<% this_machine=machine_dict[args[0]] %><% arch_names=this_machine.arch_names %> for arch in this_machine<% this_machine_name="\""+this_machine.name+"\"" %> for kern in<% make_impl_name_list="{"+', '.join(['"%s"'%i.name for i in impls])+"}" %><% make_impl_deps_list="{"+', '.join(['|'.join(['(1<< LV_%s)'%d.upper() for d in i.deps]) for i in impls])+"}" %><% make_impl_align_list="{"+', '.join([ 'true' if i.is_aligned else 'false' for i in impls])+"}" %><% make_impl_fcn_list="{"+', '.join(['%s_%s'%(kern.name, i.name) for i in impls])+"}" %><% len_impls=len(impls) %> endfor
Definition: volk_machine_xxx.tmpl.c:47