Skip to content

Commit 12ff8fd

Browse files
committed
Add meson build option for ILP64
fixes compiler warning about unused function
1 parent 3fb7aff commit 12ff8fd

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ py = import('python').find_installation(pure: false)
1515

1616
c_args = ['-DNDEBUG']
1717

18+
if get_option('ilp64')
19+
c_args += '-DMKL_ILP64'
20+
endif
21+
1822
thread_dep = dependency('threads')
1923

2024
cc = meson.get_compiler('c')

meson.options

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
option('ilp64', type: 'boolean', value: false,
2+
description: 'Build with MKL ILP64 interface')

mkl/_mklinitmodule.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ static struct PyMethodDef methods[] = {{NULL, NULL, 0, NULL}};
2828
#define MKL_SERVICE_INLINE inline
2929
#endif
3030

31+
#ifdef MKL_ILP64
3132
static MKL_SERVICE_INLINE void _set_mkl_ilp64(void);
33+
#else
3234
static MKL_SERVICE_INLINE void _set_mkl_lp64(void);
35+
#endif
3336
static MKL_SERVICE_INLINE void _set_mkl_interface(void);
3437

3538
static const char *mtlayer;
@@ -154,25 +157,31 @@ static void _preload_threading_layer(void)
154157
return;
155158
}
156159

160+
#ifdef MKL_ILP64
157161
static MKL_SERVICE_INLINE void _set_mkl_ilp64(void)
158162
{
159163
#ifdef USING_MKL_RT
160164
mkl_set_interface_layer(MKL_INTERFACE_ILP64);
161165
#endif
162166
return;
163167
}
164-
168+
#else
165169
static MKL_SERVICE_INLINE void _set_mkl_lp64(void)
166170
{
167171
#ifdef USING_MKL_RT
168172
mkl_set_interface_layer(MKL_INTERFACE_LP64);
169173
#endif
170174
return;
171175
}
176+
#endif
172177

173178
static MKL_SERVICE_INLINE void _set_mkl_interface(void)
174179
{
180+
#ifdef MKL_ILP64
181+
_set_mkl_ilp64();
182+
#else
175183
_set_mkl_lp64();
184+
#endif
176185
_preload_threading_layer();
177186
}
178187

0 commit comments

Comments
 (0)