| #------------------------------------------------------------------------------- | |
| # Build the mlir bytecode modules with iree-translate. Note the last three flags | |
| # are for RVV support. | |
| #------------------------------------------------------------------------------- | |
| springbok_bytecode_module( | |
| NAME | |
| mobilenet_v1_bytecode_module_dylib | |
| SRC | |
| "$ENV{ROOTDIR}/ml/ml-models-public/float_models/mobilenet_v1_0.25_224_float.tflite" | |
| C_IDENTIFIER | |
| "samples_float_model_mobilenet_v1_bytecode_module_dylib" | |
| FLAGS | |
| "-iree-input-type=tosa" | |
| "-riscv-v-vector-bits-min=512" | |
| "-riscv-v-fixed-length-vector-lmul-max=8" | |
| "-riscv-v-fixed-length-vector-elen-max=32" | |
| PUBLIC | |
| ) | |
| springbok_bytecode_module( | |
| NAME | |
| mnist_bytecode_module_dylib | |
| SRC | |
| "$ENV{ROOTDIR}/toolchain/iree/iree/samples/models/mnist.mlir" | |
| C_IDENTIFIER | |
| "samples_float_model_mnist_bytecode_module_dylib" | |
| FLAGS | |
| "-iree-input-type=mhlo" | |
| "-riscv-v-vector-bits-min=512" | |
| "-riscv-v-fixed-length-vector-lmul-max=8" | |
| "-riscv-v-fixed-length-vector-elen-max=32" | |
| PUBLIC | |
| ) | |
| #------------------------------------------------------------------------------- | |
| # Binaries to execute the IREE model input | |
| #------------------------------------------------------------------------------- | |
| iree_model_input( | |
| NAME | |
| mobilenet_input | |
| SHAPE | |
| "1, 224, 224, 3" | |
| SRC | |
| "https://storage.googleapis.com/download.tensorflow.org/ \ | |
| example_images/YellowLabradorLooking_new.jpg" | |
| ) | |
| iree_model_input( | |
| NAME | |
| mnist_input | |
| SHAPE | |
| "1, 28, 28, 1" | |
| SRC | |
| "https://raw.githubusercontent.com/google/iree/main/ \ | |
| iree/samples/vision/mnist_test.png" | |
| RANGE | |
| "0, 1" | |
| ) | |
| #------------------------------------------------------------------------------- | |
| # Binaries to execute the MLIR bytecode modules | |
| #------------------------------------------------------------------------------- | |
| # If the program requires a larger stack size, add | |
| # | |
| # LINKOPTS | |
| # "LINKER:--defsym=__stack_size__=<new stack size>" | |
| # | |
| # to increase it. | |
| iree_cc_binary( | |
| NAME | |
| mobilenet_v1_embedded_sync | |
| SRCS | |
| "mobilenet_v1.c" | |
| DEPS | |
| ::mobilenet_v1_bytecode_module_dylib_c | |
| ::mobilenet_input_c | |
| samples::util::util | |
| LINKOPTS | |
| "LINKER:--defsym=__stack_size__=200k" | |
| ) | |
| iree_cc_binary( | |
| NAME | |
| mnist_embedded_sync | |
| SRCS | |
| "mnist.c" | |
| DEPS | |
| ::mnist_bytecode_module_dylib_c | |
| ::mnist_input_c | |
| samples::util::util | |
| LINKOPTS | |
| "LINKER:--defsym=__stack_size__=100k" | |
| ) |