Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ py = import('python').find_installation(pure: false)

c_args = ['-DNDEBUG']

if get_option('ilp64')
c_args += '-DMKL_ILP64'
endif

thread_dep = dependency('threads')

cc = meson.get_compiler('c')
Expand Down
2 changes: 2 additions & 0 deletions meson.options
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
option('ilp64', type: 'boolean', value: false,
description: 'Build with MKL ILP64 interface')
11 changes: 10 additions & 1 deletion mkl/_mklinitmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ static struct PyMethodDef methods[] = {{NULL, NULL, 0, NULL}};
#define MKL_SERVICE_INLINE inline
#endif

#ifdef MKL_ILP64
static MKL_SERVICE_INLINE void _set_mkl_ilp64(void);
#else
static MKL_SERVICE_INLINE void _set_mkl_lp64(void);
#endif
static MKL_SERVICE_INLINE void _set_mkl_interface(void);

static const char *mtlayer;
Expand Down Expand Up @@ -154,25 +157,31 @@ static void _preload_threading_layer(void)
return;
}

#ifdef MKL_ILP64
static MKL_SERVICE_INLINE void _set_mkl_ilp64(void)
{
#ifdef USING_MKL_RT
mkl_set_interface_layer(MKL_INTERFACE_ILP64);
#endif
return;
}

#else
static MKL_SERVICE_INLINE void _set_mkl_lp64(void)
{
#ifdef USING_MKL_RT
mkl_set_interface_layer(MKL_INTERFACE_LP64);
#endif
return;
}
#endif

static MKL_SERVICE_INLINE void _set_mkl_interface(void)
{
#ifdef MKL_ILP64
_set_mkl_ilp64();
#else
_set_mkl_lp64();
#endif
_preload_threading_layer();
}

Expand Down
Loading