SConscript 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. from building import *
  2. import os
  3. if GetDepend(['PKG_USING_TENSORFLOWLITEMICRO_REFERENCE']):
  4. src = Glob('kernels/*.cc') + Glob('*.c') + Glob('*.cc') + Glob('benchmarks/*.cc') \
  5. + Glob('examples/person_detection_experimental/*.cc') \
  6. + Glob('memory_planner/*.cc') + Glob('testing/*.cc') + Glob('kernels/reference/*.cc') \
  7. + Glob('tools/make/downloads/person_model_int8/*.cc')
  8. if GetDepend(['PKG_USING_TENSORFLOWLITEMICRO_CMSISNN']):
  9. src = Glob('kernels/*.cc') + Glob('*.c') + Glob('*.cc') + Glob('benchmarks/*.cc') \
  10. + Glob('examples/person_detection_experimental/*.cc') \
  11. + Glob('memory_planner/*.cc') + Glob('testing/*.cc') + Glob('kernels/cmsis-nn/*.cc') \
  12. + Glob('tools/make/downloads/person_model_int8/*.cc')
  13. src += Glob('tools/make/downloads/cmsis/CMSIS/NN/Source/ActivationFunctions/*.c')
  14. src += Glob('tools/make/downloads/cmsis/CMSIS/NN/Source/BasicMathFunctions/*.c')
  15. src += Glob('tools/make/downloads/cmsis/CMSIS/NN/Source/ConcatenationFunctions/*.c')
  16. src += Glob('tools/make/downloads/cmsis/CMSIS/NN/Source/ConvolutionFunctions/*.c')
  17. src += Glob('tools/make/downloads/cmsis/CMSIS/NN/Source/FullyConnectedFunctions/*.c')
  18. src += Glob('tools/make/downloads/cmsis/CMSIS/NN/Source/NNSupportFunctions/*.c')
  19. src += Glob('tools/make/downloads/cmsis/CMSIS/NN/Source/PoolingFunctions/*.c')
  20. src += Glob('tools/make/downloads/cmsis/CMSIS/NN/Source/ReshapeFunctions/*.c')
  21. src += Glob('tools/make/downloads/cmsis/CMSIS/NN/Source/SoftmaxFunctions/*.c')
  22. #.
  23. root = str(Dir('#'))
  24. packages = os.path.join(root, 'packages')
  25. file_list = os.listdir(packages)
  26. for f in file_list:
  27. if(f.split('-')[0] == 'TensorflowLiteMicro'):
  28. tflm_pkg = os.path.join(packages, f)
  29. break
  30. #./third_party/flatbuffer/include
  31. flatbuffer = os.path.join(tflm_pkg, "third_party/flatbuffers/include")
  32. #./third_party/gemmlowp
  33. gemmlowp = os.path.join(tflm_pkg, "third_party/gemmlowp")
  34. #./third_party/kissfft
  35. kissfft = os.path.join(tflm_pkg, "third_party/kissfft")
  36. #./third_party/ruy
  37. ruy = os.path.join(tflm_pkg, "third_party/ruy")
  38. #./tensorflow/lite/micro/tools/make/downloads
  39. cmsis = os.path.join(tflm_pkg, "tensorflow/lite/micro/tools/make/downloads")
  40. CPPPATH = [tflm_pkg, flatbuffer, gemmlowp, kissfft, ruy, cmsis]
  41. group = DefineGroup('lite', src, depend = ['PKG_USING_TENSORFLOWLITEMICRO'], CPPPATH = CPPPATH)
  42. Return('group')