Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-codegen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Christian Heinigk
dune-codegen
Commits
9757ba41
Commit
9757ba41
authored
6 years ago
by
Dominic Kempf
Browse files
Options
Downloads
Patches
Plain Diff
Add a bit more traits concept around the vector class library
parent
94d31143
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dune/codegen/common/simdtraits.hh
+16
-0
16 additions, 0 deletions
dune/codegen/common/simdtraits.hh
dune/codegen/common/vcltraits.hh
+86
-0
86 additions, 0 deletions
dune/codegen/common/vcltraits.hh
dune/codegen/common/vectorclass.hh
+5
-53
5 additions, 53 deletions
dune/codegen/common/vectorclass.hh
with
107 additions
and
53 deletions
dune/codegen/common/simdtraits.hh
0 → 100644
+
16
−
0
View file @
9757ba41
#ifndef DUNE_CODEGEN_COMMON_SIMD_TRAITS_HH
#define DUNE_CODEGEN_COMMON_SIMD_TRAITS_HH
/** This is just the declaration of the traits classes, specialization for VCL and
* OpCounter VCL are elsewhere.
*/
template
<
typename
T
>
struct
base_floatingpoint
{};
template
<
typename
T
>
struct
simd_size
{};
#endif
This diff is collapsed.
Click to expand it.
dune/codegen/common/vcltraits.hh
0 → 100644
+
86
−
0
View file @
9757ba41
#ifndef DUNE_CODEGEN_COMMON_VCLTRAITS_HH
#define DUNE_CODEGEN_COMMON_VCLTRAITS_HH
/** A collection of traits tools for the Vector Class Library */
#include
<dune/codegen/common/vectorclass.hh>
template
<
>
struct
base_floatingpoint
<
Vec2d
>
{
using
value
=
double
;
};
template
<
>
struct
base_floatingpoint
<
Vec4f
>
{
using
value
=
float
;
};
template
<
>
struct
simd_size
<
Vec2d
>
{
static
constexpr
std
::
size_t
value
=
2
;
};
template
<
>
struct
simd_size
<
Vec4f
>
{
static
constexpr
std
::
size_t
value
=
4
;
};
#if MAX_VECTOR_SIZE >= 256
template
<
>
struct
base_floatingpoint
<
Vec4d
>
{
using
value
=
double
;
};
template
<
>
struct
base_floatingpoint
<
Vec8f
>
{
using
value
=
float
;
};
template
<
>
struct
simd_size
<
Vec4d
>
{
static
constexpr
std
::
size_t
value
=
4
;
};
template
<
>
struct
simd_size
<
Vec8f
>
{
static
constexpr
std
::
size_t
value
=
8
;
};
#endif
#if MAX_VECTOR_SIZE >= 512
template
<
>
struct
base_floatingpoint
<
Vec8d
>
{
using
value
=
double
;
};
template
<
>
struct
base_floatingpoint
<
Vec16f
>
{
using
value
=
float
;
};
template
<
>
struct
simd_size
<
Vec8d
>
{
static
constexpr
std
::
size_t
value
=
8
;
};
template
<
>
struct
simd_size
<
Vec16f
>
{
static
constexpr
std
::
size_t
value
=
16
;
};
#endif
#endif
This diff is collapsed.
Click to expand it.
dune/codegen/common/vectorclass.hh
+
5
−
53
View file @
9757ba41
#ifndef DUNE_CODEGEN_COMMON_VECTORCLASS_HH
#ifndef DUNE_CODEGEN_COMMON_VECTORCLASS_HH
#define DUNE_CODEGEN_COMMON_VECTORCLASS_HH
#define DUNE_CODEGEN_COMMON_VECTORCLASS_HH
#include
<dune/codegen/common/simdtraits.hh>
template
<
typename
T
>
struct
base_floatingpoint
{};
#ifdef ENABLE_COUNTER
#ifdef ENABLE_COUNTER
#if HAVE_DUNE_OPCOUNTER
#if HAVE_DUNE_OPCOUNTER
#include
<dune/opcounter/vectorclass.hh>
#include
<dune/opcounter/vectorclass.hh>
template
<
typename
F
,
int
size
>
struct
base_floatingpoint
<
OpCounter
::
impl
::
OpCounterVector
<
F
,
size
>>
{
using
value
=
OpCounter
::
OpCounter
<
F
>
;
};
#else
#else
#error "dune-opcounter is needed for opcounted vector types"
#error "dune-opcounter is needed for opcounted vector types"
#endif
#endif
#else
#else
#include
<dune/codegen/vectorclass/vectorclass.h>
#include
<dune/codegen/vectorclass/vectorclass.h>
#include
<dune/codegen/vectorclass/vectormath_exp.h>
#include
<dune/codegen/vectorclass/vectormath_exp.h>
#include
<dune/codegen/vectorclass/vectormath_hyp.h>
#include
<dune/codegen/vectorclass/vectormath_hyp.h>
#include
<dune/codegen/vectorclass/vectormath_trig.h>
#include
<dune/codegen/vectorclass/vectormath_trig.h>
#include
<dune/codegen/common/vcltraits.hh>
template
<
>
struct
base_floatingpoint
<
Vec2d
>
{
using
value
=
double
;
};
template
<
>
struct
base_floatingpoint
<
Vec4f
>
{
using
value
=
float
;
};
#if MAX_VECTOR_SIZE >= 256
template
<
>
struct
base_floatingpoint
<
Vec4d
>
{
using
value
=
double
;
};
template
<
>
struct
base_floatingpoint
<
Vec8f
>
{
using
value
=
float
;
};
#endif
#if MAX_VECTOR_SIZE >= 512
template
<
>
struct
base_floatingpoint
<
Vec8d
>
{
using
value
=
double
;
};
template
<
>
struct
base_floatingpoint
<
Vec16f
>
{
using
value
=
float
;
};
#endif
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment