Skip to content

Commit

Permalink
Work around icpc bug ONCE AND FOR ALL! (yeah right)
Browse files Browse the repository at this point in the history
  • Loading branch information
devinamatthews committed Dec 11, 2016
1 parent 24f0433 commit 9bf5871
Show file tree
Hide file tree
Showing 9 changed files with 159 additions and 91 deletions.
13 changes: 9 additions & 4 deletions src/configs/bulldozer/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@

#include "configs/config_builder.hpp"

extern "C" tblis::gemm_ukr_func< float> bli_sgemm_asm_8x8_fma4;
extern "C" tblis::gemm_ukr_func< double> bli_dgemm_asm_4x6_fma4;
extern "C" tblis::gemm_ukr_func<tblis::scomplex> bli_cgemm_asm_8x4_fma4;
extern "C" tblis::gemm_ukr_func<tblis::dcomplex> bli_zgemm_asm_4x4_fma4;
extern "C"
{

EXTERN_GEMM_UKR( float, bli_sgemm_asm_8x8_fma4);
EXTERN_GEMM_UKR( double, bli_dgemm_asm_4x6_fma4);
EXTERN_GEMM_UKR(tblis::scomplex, bli_cgemm_asm_8x4_fma4);
EXTERN_GEMM_UKR(tblis::dcomplex, bli_zgemm_asm_4x4_fma4);

}

namespace tblis
{
Expand Down
86 changes: 46 additions & 40 deletions src/configs/config_builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#define TBLIS_HAS_COMMA_HELPER(_0,_1,_2,...) _2
#define TBLIS_HAS_COMMA(...) TBLIS_HAS_COMMA_HELPER(__VA_ARGS__,1,0)
#define TBLIS_COMMA_IF_EMPTY() ,
#define TBLIS_COMMA_IF_EMPTY_() ,
#define TBLIS_IS_EMPTY(x) TBLIS_HAS_COMMA(TBLIS_PASTE(TBLIS_COMMA_IF_EMPTY,x)())
#define _TBLIS_COMMA_IF_EMPTY() ,
#define TBLIS_IS_EMPTY(x) TBLIS_HAS_COMMA(TBLIS_PASTE(x,TBLIS_COMMA_IF_EMPTY)())
#define TBLIS_GET_VALUE_OR_DEFAULT_CASE_0(value,default) value
#define TBLIS_GET_VALUE_OR_DEFAULT_CASE_1(value,default) default
#define TBLIS_GET_VALUE_OR_DEFAULT_CASE(value,default,case) \
Expand Down Expand Up @@ -102,25 +102,25 @@ config cfg##_config_instance = config(cfg##_config());
TBLIS_CONFIG_BOOL(gemm_row_major, S,D,C,Z, false,false,false,false)

#define TBLIS_CONFIG_UKR(name, type, S,D,C,Z, def_ker) \
template <typename T> struct name : static_microkernel<T, type, \
TBLIS_GET_VALUE_OR_DEFAULT(S,def_ker< float>), \
TBLIS_GET_VALUE_OR_DEFAULT(D,def_ker< double>), \
TBLIS_GET_VALUE_OR_DEFAULT(C,def_ker<scomplex>), \
TBLIS_GET_VALUE_OR_DEFAULT(Z,def_ker<dcomplex>)> {};
template <typename T> struct name : static_microkernel<T, \
type< float>, TBLIS_GET_VALUE_OR_DEFAULT(S,def_ker< float>), \
type< double>, TBLIS_GET_VALUE_OR_DEFAULT(D,def_ker< double>), \
type<scomplex>, TBLIS_GET_VALUE_OR_DEFAULT(C,def_ker<scomplex>), \
type<dcomplex>, TBLIS_GET_VALUE_OR_DEFAULT(Z,def_ker<dcomplex>)> {};

#define TBLIS_CONFIG_UKR2(config, name, type, S,D,C,Z, def_ker) \
template <typename T> struct name : static_microkernel<T, type, \
TBLIS_GET_VALUE_OR_DEFAULT(S,(def_ker<config, float>)), \
TBLIS_GET_VALUE_OR_DEFAULT(D,(def_ker<config, double>)), \
TBLIS_GET_VALUE_OR_DEFAULT(C,(def_ker<config,scomplex>)), \
TBLIS_GET_VALUE_OR_DEFAULT(Z,(def_ker<config,dcomplex>))> {};
template <typename T> struct name : static_microkernel<T, \
type< float>, TBLIS_GET_VALUE_OR_DEFAULT(S,(def_ker<config, float>)), \
type< double>, TBLIS_GET_VALUE_OR_DEFAULT(D,(def_ker<config, double>)), \
type<scomplex>, TBLIS_GET_VALUE_OR_DEFAULT(C,(def_ker<config,scomplex>)), \
type<dcomplex>, TBLIS_GET_VALUE_OR_DEFAULT(Z,(def_ker<config,dcomplex>))> {};

#define TBLIS_CONFIG_UKR3(config, mat, name, type, S,D,C,Z, def_ker) \
template <typename T> struct name : static_microkernel<T, type, \
TBLIS_GET_VALUE_OR_DEFAULT(S,(def_ker<config, float,mat>)), \
TBLIS_GET_VALUE_OR_DEFAULT(D,(def_ker<config, double,mat>)), \
TBLIS_GET_VALUE_OR_DEFAULT(C,(def_ker<config,scomplex,mat>)), \
TBLIS_GET_VALUE_OR_DEFAULT(Z,(def_ker<config,dcomplex,mat>))> {};
template <typename T> struct name : static_microkernel<T, \
type< float>, TBLIS_GET_VALUE_OR_DEFAULT(S,(def_ker<config, float,mat>)), \
type< double>, TBLIS_GET_VALUE_OR_DEFAULT(D,(def_ker<config, double,mat>)), \
type<scomplex>, TBLIS_GET_VALUE_OR_DEFAULT(C,(def_ker<config,scomplex,mat>)), \
type<dcomplex>, TBLIS_GET_VALUE_OR_DEFAULT(Z,(def_ker<config,dcomplex,mat>))> {};

#define TBLIS_CONFIG_TRANS_ADD_UKR(S,D,C,Z) \
TBLIS_CONFIG_UKR2(this_config, trans_add_ukr, trans_add_ukr_t, S,D,C,Z, trans_add_ukr_def)
Expand Down Expand Up @@ -214,41 +214,47 @@ struct cache_blocksize
ZM;
};

template <typename T, template <typename> class kernel,
kernel< float> S, kernel< double> D,
kernel<scomplex> C, kernel<dcomplex> Z>
template <typename T,
typename skernel, skernel S,
typename dkernel, dkernel D,
typename ckernel, ckernel C,
typename zkernel, zkernel Z>
struct static_microkernel;

template <template <typename> class kernel,
kernel< float> S, kernel< double> D,
kernel<scomplex> C, kernel<dcomplex> Z>
struct static_microkernel<float, kernel, S, D, C, Z>
template <typename skernel, skernel S,
typename dkernel, dkernel D,
typename ckernel, ckernel C,
typename zkernel, zkernel Z>
struct static_microkernel<float, skernel, S, dkernel, D, ckernel, C, zkernel, Z>
{
static constexpr kernel<float> value = S;
static constexpr skernel value = S;
};

template <template <typename> class kernel,
kernel< float> S, kernel< double> D,
kernel<scomplex> C, kernel<dcomplex> Z>
struct static_microkernel<double, kernel, S, D, C, Z>
template <typename skernel, skernel S,
typename dkernel, dkernel D,
typename ckernel, ckernel C,
typename zkernel, zkernel Z>
struct static_microkernel<double, skernel, S, dkernel, D, ckernel, C, zkernel, Z>
{
static constexpr kernel<double> value = D;
static constexpr dkernel value = D;
};

template <template <typename> class kernel,
kernel< float> S, kernel< double> D,
kernel<scomplex> C, kernel<dcomplex> Z>
struct static_microkernel<scomplex, kernel, S, D, C, Z>
template <typename skernel, skernel S,
typename dkernel, dkernel D,
typename ckernel, ckernel C,
typename zkernel, zkernel Z>
struct static_microkernel<scomplex, skernel, S, dkernel, D, ckernel, C, zkernel, Z>
{
static constexpr kernel<scomplex> value = C;
static constexpr ckernel value = C;
};

template <template <typename> class kernel,
kernel< float> S, kernel< double> D,
kernel<scomplex> C, kernel<dcomplex> Z>
struct static_microkernel<dcomplex, kernel, S, D, C, Z>
template <typename skernel, skernel S,
typename dkernel, dkernel D,
typename ckernel, ckernel C,
typename zkernel, zkernel Z>
struct static_microkernel<dcomplex, skernel, S, dkernel, D, ckernel, C, zkernel, Z>
{
static constexpr kernel<dcomplex> value = Z;
static constexpr zkernel value = Z;
};

template <typename Config>
Expand Down
13 changes: 9 additions & 4 deletions src/configs/core2/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@

#include "configs/config_builder.hpp"

extern "C" tblis::gemm_ukr_func< float> bli_sgemm_asm_8x4;
extern "C" tblis::gemm_ukr_func< double> bli_dgemm_asm_4x4;
extern "C" tblis::gemm_ukr_func<tblis::scomplex> bli_cgemm_asm_4x2;
extern "C" tblis::gemm_ukr_func<tblis::dcomplex> bli_zgemm_asm_2x2;
extern "C"
{

EXTERN_GEMM_UKR( float, bli_sgemm_asm_8x4);
EXTERN_GEMM_UKR( double, bli_dgemm_asm_4x4);
EXTERN_GEMM_UKR(tblis::scomplex, bli_cgemm_asm_4x2);
EXTERN_GEMM_UKR(tblis::dcomplex, bli_zgemm_asm_2x2);

}

namespace tblis
{
Expand Down
14 changes: 10 additions & 4 deletions src/configs/excavator/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@
/*
* These are actually the same kernels as Piledriver.
*/
extern "C" tblis::gemm_ukr_func< float> bli_sgemm_asm_16x3;
extern "C" tblis::gemm_ukr_func< double> bli_dgemm_asm_8x3;
extern "C" tblis::gemm_ukr_func<tblis::scomplex> bli_cgemm_asm_4x2;
extern "C" tblis::gemm_ukr_func<tblis::dcomplex> bli_zgemm_asm_2x2;

extern "C"
{

EXTERN_GEMM_UKR( float, bli_sgemm_asm_16x3);
EXTERN_GEMM_UKR( double, bli_dgemm_asm_8x3);
EXTERN_GEMM_UKR(tblis::scomplex, bli_cgemm_asm_4x2);
EXTERN_GEMM_UKR(tblis::dcomplex, bli_zgemm_asm_2x2);

}

namespace tblis
{
Expand Down
22 changes: 14 additions & 8 deletions src/configs/haswell/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@

#include "configs/config_builder.hpp"

extern "C" tblis::gemm_ukr_func< float> bli_sgemm_asm_24x4;
extern "C" tblis::gemm_ukr_func<double> bli_dgemm_asm_12x4;
extern "C" tblis::gemm_ukr_func< float> bli_sgemm_asm_4x24;
extern "C" tblis::gemm_ukr_func<double> bli_dgemm_asm_4x12;
extern "C" tblis::gemm_ukr_func< float> bli_sgemm_asm_16x6;
extern "C" tblis::gemm_ukr_func<double> bli_dgemm_asm_8x6;
extern "C" tblis::gemm_ukr_func< float> bli_sgemm_asm_6x16;
extern "C" tblis::gemm_ukr_func<double> bli_dgemm_asm_6x8;
extern "C"
{

EXTERN_GEMM_UKR( float, bli_sgemm_asm_24x4);
EXTERN_GEMM_UKR( float, bli_sgemm_asm_16x6);
EXTERN_GEMM_UKR( float, bli_sgemm_asm_6x16);
EXTERN_GEMM_UKR( float, bli_sgemm_asm_4x24);

EXTERN_GEMM_UKR(double, bli_dgemm_asm_12x4);
EXTERN_GEMM_UKR(double, bli_dgemm_asm_8x6);
EXTERN_GEMM_UKR(double, bli_dgemm_asm_6x8);
EXTERN_GEMM_UKR(double, bli_dgemm_asm_4x12);

}

namespace tblis
{
Expand Down
19 changes: 12 additions & 7 deletions src/configs/knl/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@

#include "configs/config_builder.hpp"

extern "C" tblis::gemm_ukr_func< float> bli_sgemm_opt_30x16_knc;
extern "C" tblis::gemm_ukr_func<double> bli_dgemm_opt_30x8_knc;
extern "C" tblis::gemm_ukr_func<double> bli_dgemm_opt_30x8;
extern "C" tblis::gemm_ukr_func<double> bli_dgemm_opt_24x8;
extern "C"
{

EXTERN_GEMM_UKR( float, bli_sgemm_opt_30x16_knc);
EXTERN_GEMM_UKR(double, bli_dgemm_opt_30x8_knc);
EXTERN_GEMM_UKR(double, bli_dgemm_opt_30x8);
EXTERN_GEMM_UKR(double, bli_dgemm_opt_24x8);

}

namespace tblis
{

extern pack_nn_ukr_func<double> knl_packm_30xk;
extern pack_nn_ukr_func<double> knl_packm_24xk;
extern pack_nn_ukr_func<double> knl_packm_8xk;
EXTERN_PACK_NN_UKR(double, knl_packm_30xk);
EXTERN_PACK_NN_UKR(double, knl_packm_24xk);
EXTERN_PACK_NN_UKR(double, knl_packm_8xk);

extern int knl_check();

Expand Down
13 changes: 9 additions & 4 deletions src/configs/piledriver/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@

#include "configs/config_builder.hpp"

extern "C" tblis::gemm_ukr_func< float> bli_sgemm_asm_16x3;
extern "C" tblis::gemm_ukr_func< double> bli_dgemm_asm_8x3;
extern "C" tblis::gemm_ukr_func<tblis::scomplex> bli_cgemm_asm_4x2;
extern "C" tblis::gemm_ukr_func<tblis::dcomplex> bli_zgemm_asm_2x2;
extern "C"
{

EXTERN_GEMM_UKR( float, bli_sgemm_asm_16x3);
EXTERN_GEMM_UKR( double, bli_dgemm_asm_8x3);
EXTERN_GEMM_UKR(tblis::scomplex, bli_cgemm_asm_4x2);
EXTERN_GEMM_UKR(tblis::dcomplex, bli_zgemm_asm_2x2);

}

namespace tblis
{
Expand Down
13 changes: 9 additions & 4 deletions src/configs/sandybridge/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@

#include "configs/config_builder.hpp"

extern "C" tblis::gemm_ukr_func< float> bli_sgemm_asm_8x8;
extern "C" tblis::gemm_ukr_func< double> bli_dgemm_asm_8x4;
extern "C" tblis::gemm_ukr_func<tblis::scomplex> bli_cgemm_asm_8x4;
extern "C" tblis::gemm_ukr_func<tblis::dcomplex> bli_zgemm_asm_4x4;
extern "C"
{

EXTERN_GEMM_UKR( float, bli_sgemm_asm_8x8);
EXTERN_GEMM_UKR( double, bli_dgemm_asm_8x4);
EXTERN_GEMM_UKR(tblis::scomplex, bli_cgemm_asm_8x4);
EXTERN_GEMM_UKR(tblis::dcomplex, bli_zgemm_asm_4x4);

}

namespace tblis
{
Expand Down
Loading

0 comments on commit 9bf5871

Please sign in to comment.