Skip to content

Commit

Permalink
meson: do not enable AVX in non-x64
Browse files Browse the repository at this point in the history
If avx is enabled for non-x64, let meson ignore it.

Signed-off-by: MyungJoo Ham <[email protected]>
  • Loading branch information
myungjoo committed Jun 10, 2024
1 parent 527becc commit 8b6517a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,16 @@ warning_c_flags = [

arch = host_machine.cpu_family()

if get_option('enable-avx')
if get_option('enable-avx') and arch == 'x86_64'
extra_defines += '-DUSE_AVX=1'
if get_option('platform') == 'tizen'
add_project_arguments(['-mavx2'], language: ['c','cpp'])
else
add_project_arguments(['-march=native'], language: ['c','cpp'])
endif
message('-march=native added for AVX hardware acceleration.')
elif get_option('enable_avx')
warning('AVX enabled for non x86_64 build target. The enable-avx option is ignored.')
endif

if get_option('enable-fp16')
Expand Down

0 comments on commit 8b6517a

Please sign in to comment.