Skip to content

Commit

Permalink
[ Meson ] BCQTensor dependency is added for Android build
Browse files Browse the repository at this point in the history
- This commit add BiQGEMM path to nntrainer_inc_abs to support Android
  build with enable-biqgemm option.

**Self evaluation:**

Build test: [X]Passed [ ]Failed [ ]Skipped
Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Eunju Yang <[email protected]>
  • Loading branch information
EunjuYang committed Dec 11, 2024
1 parent cd17a66 commit 78067df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions nntrainer/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ nntrainer_inc_abs = [
meson.source_root() / 'api' / 'ccapi' / 'include'
]


nntrainer_sources = []
nntrainer_headers = [
meson.current_source_dir() / 'nntrainer_log.h',
Expand Down
17 changes: 10 additions & 7 deletions nntrainer/tensor/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ tensor_headers = [
'char_tensor.h',
'uint_tensor.h',
'weight.h',
'var_grad.h',
'var_grad.h',
'tensor_wrap_specs.h',
'blas_interface.h',
'manager.h',
Expand All @@ -43,19 +43,21 @@ tensor_headers = [
'cache_elem.h',
'memory_pool.h',
'swap_device.h',
'task.h'
'task.h',
]

arch = host_machine.cpu_family()

if get_option('enable-avx') and get_option('platform') != 'android'
tensor_sources += 'blas_avx.cpp'
tensor_headers += 'blas_avx.h'
tensor_sources += 'blas_avx.cpp'
tensor_headers += 'blas_avx.h'
endif

if get_option('enable-fp16')
if get_option('enable-fp16')
if arch == 'arm'
error ('FP16/ARM code (blas_neon.cpp) uses armv8.2 instructions. armv7 is not supported.')
error(
'FP16/ARM code (blas_neon.cpp) uses armv8.2 instructions. armv7 is not supported.',
)
elif arch == 'aarch64' or get_option('platform') == 'android'
if get_option('enable-neon')
tensor_sources += 'blas_neon.cpp'
Expand All @@ -80,6 +82,7 @@ if get_option('enable-biqgemm')
tensor_headers += 'bcq_tensor.h'
tensor_sources += 'bcq_tensor.cpp'
nntrainer_inc += biqgemm_inc
nntrainer_inc_abs += meson.source_root() / '..' / 'BiQGEMM'
endif

if get_option('enable-opencl')
Expand All @@ -94,4 +97,4 @@ endforeach

foreach h : tensor_headers
nntrainer_headers += meson.current_source_dir() / h
endforeach
endforeach

0 comments on commit 78067df

Please sign in to comment.